Update README.md
Browse files
README.md
CHANGED
|
@@ -27,7 +27,13 @@ It achieves the following results on the evaluation set:
|
|
| 27 |
|
| 28 |
## 模型的使用
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
from typing import Any
|
| 32 |
import torch
|
| 33 |
|
|
@@ -60,8 +66,9 @@ class MultipleChoicePipeline:
|
|
| 60 |
|
| 61 |
if __name__ == "__main__":
|
| 62 |
pipe = MultipleChoicePipeline(model, tokenizer)
|
| 63 |
-
result1 = pipe("
|
| 64 |
print(result1)
|
|
|
|
| 65 |
```
|
| 66 |
|
| 67 |
## Intended uses & limitations
|
|
|
|
| 27 |
|
| 28 |
## 模型的使用
|
| 29 |
|
| 30 |
+
from transformers import AutoTokenizer, AutoModelForMultipleChoice
|
| 31 |
+
from typing import Any
|
| 32 |
+
import torch
|
| 33 |
+
|
| 34 |
+
tokenizer = AutoTokenizer.from_pretrained('roberthsu2003/for_multiple_choice')
|
| 35 |
+
model = AutoModelForMultipleChoice.from_pretrained('roberthsu2003/for_multiple_choice')
|
| 36 |
+
|
| 37 |
from typing import Any
|
| 38 |
import torch
|
| 39 |
|
|
|
|
| 66 |
|
| 67 |
if __name__ == "__main__":
|
| 68 |
pipe = MultipleChoicePipeline(model, tokenizer)
|
| 69 |
+
result1 = pipe("男:你今天晚上有時間嗎?我們一起去看電影吧? 女:你喜歡恐怖片和愛情片,但是我喜歡喜劇片","女的最喜歡哪種電影?",["恐怖片","愛情片","喜劇片","科幻片"])
|
| 70 |
print(result1)
|
| 71 |
+
|
| 72 |
```
|
| 73 |
|
| 74 |
## Intended uses & limitations
|