ldwang commited on
Commit
d9ff58d
·
verified ·
1 Parent(s): 5bc5f68

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -1
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. The assistant gives helpful, detailed, and polite answers to the human's questions.\n\n<|startofpiece|>{text}<|endofpiece|>"
 
 
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():