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