Fix example code
Browse files
README.md
CHANGED
@@ -484,11 +484,15 @@ Find below some example scripts on how to use the model:
|
|
484 |
<details>
|
485 |
<summary> Click to expand </summary>
|
486 |
|
|
|
|
|
|
|
|
|
487 |
```python
|
488 |
-
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
489 |
|
490 |
model_name = 'jbochi/madlad400-3b-mt'
|
491 |
-
model = T5ForConditionalGeneration.from_pretrained(model_name,
|
492 |
tokenizer = T5Tokenizer.from_pretrained(model_name)
|
493 |
|
494 |
text = "<2pt> I love pizza!"
|
|
|
484 |
<details>
|
485 |
<summary> Click to expand </summary>
|
486 |
|
487 |
+
First, install the Python packages that are required:
|
488 |
+
|
489 |
+
`pip install transformers accelerate sentencepiece`
|
490 |
+
|
491 |
```python
|
492 |
+
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
493 |
|
494 |
model_name = 'jbochi/madlad400-3b-mt'
|
495 |
+
model = T5ForConditionalGeneration.from_pretrained(model_name, device_map="auto")
|
496 |
tokenizer = T5Tokenizer.from_pretrained(model_name)
|
497 |
|
498 |
text = "<2pt> I love pizza!"
|