ayucel commited on
Commit
beb1c22
1 Parent(s): d7fbe76

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -27
README.md CHANGED
@@ -1,27 +0,0 @@
1
- import torch
2
- from transformers import AutoModelForCausalLM, AutoTokenizer
3
-
4
- model = AutoModelForCausalLM.from_pretrained(
5
- "ayucel/multilabel_classification"
6
- device_map={"":0},
7
- torch_dtype=torch.float16,
8
- )
9
- tokenizer = AutoTokenizer.from_pretrained("ayucel/multilabel_classification")
10
-
11
- prompt = "The phone met all my expectations, but I wish the shipping could have as well."
12
-
13
- pipe = pipeline("text-generation",
14
- model=model,
15
- tokenizer=tokenizer,
16
- device_map={"":0},
17
- max_length=250,
18
- temperature=0.1,
19
- top_p=1.0,
20
- stop_sequence="}",
21
- truncation=True
22
- )
23
-
24
- result = pipe(f"<s>[INST] <<SYS>> Classify the text based on comments about the product and shipping as positive, negative, neutral, and None.<</SYS>> {prompt} [/INST]")
25
- print(result[0]['generated_text'])
26
-
27
- output="<s>[INST] <<SYS>> Classify the text based on comments about the product and shipping as positive, negative, neutral, and None.<</SYS>> The phone met all my expectations, but I wish the shipping could have as well. [/INST] {product: positive, shipping: negative}"