Update README.md
Browse files
README.md
CHANGED
@@ -42,10 +42,17 @@ outputs = model(input_ids=input_ids, use_cache=True, past_key_values=past_key_va
|
|
42 |
######## Generate!
|
43 |
with torch.autocast(**amp_settings), torch.no_grad():
|
44 |
output_ids = model.generate(input_ids, max_new_tokens=20, use_cache=True, num_steps=32)
|
|
|
45 |
print(tokenizer.decode(output_ids[0]))
|
46 |
|
47 |
|
48 |
# with or without cache
|
49 |
with torch.autocast(**amp_settings), torch.no_grad():
|
50 |
output_ids = model.generate(input_ids, max_new_tokens=20, use_cache=False, num_steps=32)
|
|
|
51 |
print(tokenizer.decode(output_ids[0]))
|
|
|
|
|
|
|
|
|
|
|
|
42 |
######## Generate!
|
43 |
with torch.autocast(**amp_settings), torch.no_grad():
|
44 |
output_ids = model.generate(input_ids, max_new_tokens=20, use_cache=True, num_steps=32)
|
45 |
+
|
46 |
print(tokenizer.decode(output_ids[0]))
|
47 |
|
48 |
|
49 |
# with or without cache
|
50 |
with torch.autocast(**amp_settings), torch.no_grad():
|
51 |
output_ids = model.generate(input_ids, max_new_tokens=20, use_cache=False, num_steps=32)
|
52 |
+
|
53 |
print(tokenizer.decode(output_ids[0]))
|
54 |
+
|
55 |
+
# Both are supposed to print:
|
56 |
+
|
57 |
+
# <|begin_text|>The capital of Westphalia is the city of Münster. The city is located in the north of the state and is
|
58 |
+
```
|