Update README.md
Browse files
README.md
CHANGED
|
@@ -4,15 +4,15 @@ license: apache-2.0
|
|
| 4 |
单论对话机器人
|
| 5 |
调用方式
|
| 6 |
|
| 7 |
-
from transformers import
|
| 8 |
|
| 9 |
|
| 10 |
checkpoint = "model"
|
| 11 |
|
| 12 |
|
| 13 |
-
tokenizer =
|
| 14 |
|
| 15 |
-
model =
|
| 16 |
|
| 17 |
text = 'Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{你想问的文本}\n\n### Response:'
|
| 18 |
|
|
|
|
| 4 |
单论对话机器人
|
| 5 |
调用方式
|
| 6 |
|
| 7 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 8 |
|
| 9 |
|
| 10 |
checkpoint = "model"
|
| 11 |
|
| 12 |
|
| 13 |
+
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
|
| 14 |
|
| 15 |
+
model = AutoModelForCausalLM.from_pretrained(checkpoint).cuda()
|
| 16 |
|
| 17 |
text = 'Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\n{你想问的文本}\n\n### Response:'
|
| 18 |
|