Update README.md
Browse files
README.md
CHANGED
@@ -72,9 +72,9 @@ Usage
|
|
72 |
import torch
|
73 |
from transformers import T5Tokenizer, AutoModelForSeq2SeqLM
|
74 |
|
75 |
-
tokenizer = T5Tokenizer.from_pretrained("yuyijiong/
|
76 |
-
model = AutoModelForSeq2SeqLM.from_pretrained("yuyijiong/
|
77 |
-
generation_config=GenerationConfig.from_pretrained("yuyijiong/
|
78 |
text = '情感四元组(对象 | 观点 | 方面 | 极性)抽取任务(观点可以较长): [个头大、口感不错,就是个别坏了的或者有烂掉口子刻意用泥土封着,这样做不好。]'
|
79 |
input_ids = tokenizer(text,return_tensors="pt", padding=True)['input_ids'].cuda(0)
|
80 |
with torch.no_grad():
|
|
|
72 |
import torch
|
73 |
from transformers import T5Tokenizer, AutoModelForSeq2SeqLM
|
74 |
|
75 |
+
tokenizer = T5Tokenizer.from_pretrained("yuyijiong/T5-large-sentiment-analysis-Chinese")
|
76 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("yuyijiong/T5-large-sentiment-analysis-Chinese", device_map="auto")
|
77 |
+
generation_config=GenerationConfig.from_pretrained("yuyijiong/T5-large-sentiment-analysis-Chinese")
|
78 |
text = '情感四元组(对象 | 观点 | 方面 | 极性)抽取任务(观点可以较长): [个头大、口感不错,就是个别坏了的或者有烂掉口子刻意用泥土封着,这样做不好。]'
|
79 |
input_ids = tokenizer(text,return_tensors="pt", padding=True)['input_ids'].cuda(0)
|
80 |
with torch.no_grad():
|