Update README.md
Browse files
README.md
CHANGED
@@ -72,6 +72,17 @@ This is the model card of a 🤗 transformers model that has been pushed on the
|
|
72 |
|
73 |
### Direct Use
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
76 |
|
77 |
[More Information Needed]
|
|
|
72 |
|
73 |
### Direct Use
|
74 |
|
75 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
76 |
+
|
77 |
+
tokenizer = AutoTokenizer.from_pretrained("shkna1368/v1-Kurdana")
|
78 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("shkna1368/v1-Kurdana")
|
79 |
+
|
80 |
+
input_ids = tokenizer.encode(question, return_tensors="pt")
|
81 |
+
|
82 |
+
output_ids = model.generate(input_ids, max_length=1200, num_beams=200, early_stopping=False)
|
83 |
+
|
84 |
+
answer = t5_tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
85 |
+
|
86 |
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
87 |
|
88 |
[More Information Needed]
|