Update README.md
Browse files
README.md
CHANGED
@@ -71,7 +71,7 @@ tokens = tokenizer.encode_plus(text)['input_ids']
|
|
71 |
tokens = torch.tensor(tokens)[None,].to(device)
|
72 |
|
73 |
with torch.no_grad():
|
74 |
-
out =
|
75 |
out = tokenizer.decode(out.cpu().numpy().tolist())
|
76 |
print(out)
|
77 |
```
|
|
|
71 |
tokens = torch.tensor(tokens)[None,].to(device)
|
72 |
|
73 |
with torch.no_grad():
|
74 |
+
out = model.generate(tokens, do_sample=False, max_length=128, eos_token_id=tokenizer.eos_token_id)[0]
|
75 |
out = tokenizer.decode(out.cpu().numpy().tolist())
|
76 |
print(out)
|
77 |
```
|