YanshekWoo
commited on
Commit
•
e000310
1
Parent(s):
85e7694
Update README.md
Browse files
README.md
CHANGED
@@ -25,8 +25,9 @@ tokenizer = BertTokenizer.from_pretrained("HIT-TMG/dialogue-bart-large-chinese")
|
|
25 |
model = BartForConditionalGeneration.from_pretrained("HIT-TMG/dialogue-bart-large-chinese")
|
26 |
|
27 |
# an example from CPC dev data
|
28 |
-
|
29 |
-
|
|
|
30 |
output_ids = model.generate(input_ids)[0]
|
31 |
print(tokenizer.decode(output_ids))
|
32 |
```
|
|
|
25 |
model = BartForConditionalGeneration.from_pretrained("HIT-TMG/dialogue-bart-large-chinese")
|
26 |
|
27 |
# an example from CPC dev data
|
28 |
+
history = ["可以 认识 一下 吗 ?", "当然 可以 啦 , 你好 。", "嘿嘿 你好 , 请问 你 最近 在 忙 什么 呢 ?", "我 最近 养 了 一只 狗狗 , 我 在 训练 它 呢 。"]
|
29 |
+
history_str = "历史:" + tokenizer.sep_token.join(history)
|
30 |
+
input_ids = tokenizer(history_str, return_tensors='pt').input_ids
|
31 |
output_ids = model.generate(input_ids)[0]
|
32 |
print(tokenizer.decode(output_ids))
|
33 |
```
|