Update README.md
Browse files
README.md
CHANGED
@@ -22,7 +22,8 @@ tokens = tokenizer.encode_plus(prompt, truncation=False)["input_ids"]
|
|
22 |
tokens = torch.tensor(tokens)[None,].to(device)
|
23 |
with torch.no_grad():
|
24 |
input_length = len(tokens[0])
|
25 |
-
out_ids = model.generate(input_ids=tokens, max_length=input_length+200, temperature=1.0,
|
|
|
26 |
out_ids = out_ids[0][input_length:].cpu().numpy()
|
27 |
out_text = tokenizer.decode(out_ids.tolist())
|
28 |
print(out_text)
|
|
|
22 |
tokens = torch.tensor(tokens)[None,].to(device)
|
23 |
with torch.no_grad():
|
24 |
input_length = len(tokens[0])
|
25 |
+
out_ids = model.generate(input_ids=tokens, max_length=input_length+200, temperature=1.0,
|
26 |
+
top_p=0.95, eos_token_id=tokenizer.eos_token_id, cg=True, top_k=15)
|
27 |
out_ids = out_ids[0][input_length:].cpu().numpy()
|
28 |
out_text = tokenizer.decode(out_ids.tolist())
|
29 |
print(out_text)
|