Update README.md
Browse files
README.md
CHANGED
@@ -11,6 +11,24 @@ model-index:
|
|
11 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
12 |
should probably proofread and complete it, then remove this comment. -->
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
# checkpoint
|
15 |
|
16 |
This model is a fine-tuned version of [google/t5-efficient-base](https://huggingface.co/google/t5-efficient-base) on an unknown dataset.
|
|
|
11 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
12 |
should probably proofread and complete it, then remove this comment. -->
|
13 |
|
14 |
+
# how to use the model
|
15 |
+
|
16 |
+
# Load model directly
|
17 |
+
`from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
18 |
+
import torch
|
19 |
+
|
20 |
+
tokenizer = AutoTokenizer.from_pretrained("piazzola/test1")
|
21 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("piazzola/test1")
|
22 |
+
|
23 |
+
sentence = "i left the keys in the car."
|
24 |
+
|
25 |
+
with torch.no_grad():
|
26 |
+
inputs = tokenizer([sentence], return_tensors="pt")
|
27 |
+
outputs = model.generate(**inputs)
|
28 |
+
generated_text = tokenizer.decode(outputs[0])
|
29 |
+
|
30 |
+
print(generated_text)`
|
31 |
+
|
32 |
# checkpoint
|
33 |
|
34 |
This model is a fine-tuned version of [google/t5-efficient-base](https://huggingface.co/google/t5-efficient-base) on an unknown dataset.
|