Update README_zh.md
Browse files- README_zh.md +1 -1
README_zh.md
CHANGED
@@ -78,7 +78,7 @@ tokens = tokenizer.encode_plus(text)['input_ids']
|
|
78 |
tokens = torch.tensor(tokens)[None,].to(device)
|
79 |
|
80 |
with torch.no_grad():
|
81 |
-
out =
|
82 |
out = tokenizer.decode(out.cpu().numpy().tolist())
|
83 |
print(out)
|
84 |
```
|
|
|
78 |
tokens = torch.tensor(tokens)[None,].to(device)
|
79 |
|
80 |
with torch.no_grad():
|
81 |
+
out = model.generate(tokens, do_sample=False, max_length=128, eos_token_id=tokenizer.eos_token_id)[0]
|
82 |
out = tokenizer.decode(out.cpu().numpy().tolist())
|
83 |
print(out)
|
84 |
```
|