matteo
commited on
Commit
·
2e9d7dd
1
Parent(s):
5aedc32
Update README.md
Browse files
README.md
CHANGED
@@ -7,14 +7,14 @@ pipeline_tag: translation
|
|
7 |
To initialize the model:
|
8 |
|
9 |
```python
|
10 |
-
from transformers import MBartForConditionalGeneration
|
11 |
-
|
12 |
model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50", output_hidden_states=True)
|
13 |
```
|
14 |
|
15 |
To generate text using the model:
|
16 |
|
17 |
```python
|
|
|
18 |
input_ids = tokenizer.encode("Input text", return_tensors="pt")
|
19 |
output = model.generate(input_ids)
|
20 |
```
|
|
|
7 |
To initialize the model:
|
8 |
|
9 |
```python
|
10 |
+
from transformers import MBartForConditionalGeneration, MBart50TokenizerFast
|
|
|
11 |
model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-50", output_hidden_states=True)
|
12 |
```
|
13 |
|
14 |
To generate text using the model:
|
15 |
|
16 |
```python
|
17 |
+
tokenizer = MBart50TokenizerFast.from_pretrained("facebook/mbart-large-50", src_lang="it_IT", tgt_lang="it_IT")
|
18 |
input_ids = tokenizer.encode("Input text", return_tensors="pt")
|
19 |
output = model.generate(input_ids)
|
20 |
```
|