Update README.md
Browse files
README.md
CHANGED
@@ -28,6 +28,8 @@ tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
|
|
28 |
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct", device_map="auto")
|
29 |
|
30 |
inputs = tokenizer(["The quick brown"], return_tensors="pt").to(model.device)
|
|
|
31 |
gen_out = model.generate(**inputs, left_padding=5, custom_generate="transformers-community/custom_generate_example", trust_remote_code=True)
|
32 |
-
print(tokenizer.batch_decode(gen_out
|
|
|
33 |
```
|
|
|
28 |
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct", device_map="auto")
|
29 |
|
30 |
inputs = tokenizer(["The quick brown"], return_tensors="pt").to(model.device)
|
31 |
+
# There is a print message hardcoded in the custom generation method
|
32 |
gen_out = model.generate(**inputs, left_padding=5, custom_generate="transformers-community/custom_generate_example", trust_remote_code=True)
|
33 |
+
print(tokenizer.batch_decode(gen_out)) # don't skip special tokens
|
34 |
+
#['<|endoftext|><|endoftext|><|endoftext|><|endoftext|><|endoftext|>The quick brown fox jumps over the lazy dog.\n\nThe sentence "The quick']
|
35 |
```
|