Update README.md
Browse files
README.md
CHANGED
@@ -15,7 +15,9 @@ model.eval()
|
|
15 |
|
16 |
tokenizer = AutoTokenizer.from_pretrained(repo_id)
|
17 |
text = "写一首春节主题的七言绝句"
|
18 |
-
prompt = f"A chat between a curious human and an artificial intelligence assistant.
|
|
|
|
|
19 |
tokens = tokenizer.encode_plus(prompt, truncation=False)["input_ids"]
|
20 |
tokens = torch.tensor(tokens)[None,].to(device)
|
21 |
with torch.no_grad():
|
|
|
15 |
|
16 |
tokenizer = AutoTokenizer.from_pretrained(repo_id)
|
17 |
text = "写一首春节主题的七言绝句"
|
18 |
+
prompt = f"A chat between a curious human and an artificial intelligence assistant. "
|
19 |
+
prompt += f"The assistant gives helpful, detailed, and polite answers to the human's questions.\n\n"
|
20 |
+
prompt += f"<|startofpiece|>{text}<|endofpiece|>"
|
21 |
tokens = tokenizer.encode_plus(prompt, truncation=False)["input_ids"]
|
22 |
tokens = torch.tensor(tokens)[None,].to(device)
|
23 |
with torch.no_grad():
|