oweller2
commited on
Commit
•
db0a77e
1
Parent(s):
f051168
make nice
Browse files
README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
|
|
|
5 |
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoModel
|
6 |
import torch
|
7 |
|
@@ -18,4 +19,5 @@ inputs = tokenizer(prompt, return_tensors="pt").input_ids
|
|
18 |
# put the input ids on the right device
|
19 |
inputs = inputs.to(device)
|
20 |
outputs = model.generate(inputs, max_new_tokens=5, do_sample=True, top_p=0.95)
|
21 |
-
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
|
|
|
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
|
5 |
+
```
|
6 |
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoModel
|
7 |
import torch
|
8 |
|
|
|
19 |
# put the input ids on the right device
|
20 |
inputs = inputs.to(device)
|
21 |
outputs = model.generate(inputs, max_new_tokens=5, do_sample=True, top_p=0.95)
|
22 |
+
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
|
23 |
+
```
|