Saidtaoussi
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -55,16 +55,16 @@ To get started with the model, follow the steps below:
|
|
55 |
|
56 |
```python
|
57 |
# Example code
|
58 |
-
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
59 |
|
60 |
-
model_name = "Saaidtaoussi/AraT5_Darija_to_MSA"
|
61 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
62 |
-
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
63 |
|
64 |
# Example translation
|
65 |
-
input_text = "أه, يالاه رجاعت غير من شهار لعاسال ديالي ف شفشاون"
|
66 |
-
inputs = tokenizer(input_text, return_tensors="pt", padding=True)
|
67 |
-
translated = model.generate(**inputs)
|
68 |
-
output_text = tokenizer.decode(translated[0], skip_special_tokens=True)
|
69 |
-
print(output_text)
|
70 |
-
|
|
|
55 |
|
56 |
```python
|
57 |
# Example code
|
58 |
+
>>> from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
59 |
|
60 |
+
>>> model_name = "Saaidtaoussi/AraT5_Darija_to_MSA"
|
61 |
+
>>> tokenizer = AutoTokenizer.from_pretrained(model_name)
|
62 |
+
>>> model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
63 |
|
64 |
# Example translation
|
65 |
+
>>> input_text = "أه, يالاه رجاعت غير من شهار لعاسال ديالي ف شفشاون"
|
66 |
+
>>> inputs = tokenizer(input_text, return_tensors="pt", padding=True)
|
67 |
+
>>> translated = model.generate(**inputs)
|
68 |
+
>>> output_text = tokenizer.decode(translated[0], skip_special_tokens=True)
|
69 |
+
>>> print(output_text)
|
70 |
+
```
|