Update README.md
Browse files
README.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2 |
license: apache-2.0
|
3 |
language:
|
4 |
- en
|
|
|
|
|
|
|
|
|
5 |
library_name: transformers
|
6 |
tags:
|
7 |
- text-generation-inference
|
@@ -9,7 +13,26 @@ tags:
|
|
9 |
|
10 |
T5ForConditionalGeneration files for the [Madlad-400](https://github.com/google-research/google-research/tree/master/madlad_400) 3B parameter MT model.
|
11 |
|
12 |
-
**This is a WIP. I'm able to load and run the model, but output is nonsensical.**
|
13 |
|
14 |
-
|
|
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
license: apache-2.0
|
3 |
language:
|
4 |
- en
|
5 |
+
- pt
|
6 |
+
- es
|
7 |
+
- de
|
8 |
+
- it
|
9 |
library_name: transformers
|
10 |
tags:
|
11 |
- text-generation-inference
|
|
|
13 |
|
14 |
T5ForConditionalGeneration files for the [Madlad-400](https://github.com/google-research/google-research/tree/master/madlad_400) 3B parameter MT model.
|
15 |
|
|
|
16 |
|
17 |
+
```python
|
18 |
+
from transformers import T5ForConditionalGeneration, T5Tokenizer, GenerationConfig
|
19 |
|
20 |
+
model = T5ForConditionalGeneration.from_pretrained('jbochi/madlad400-3b-mt')
|
21 |
+
|
22 |
+
tokenizer = T5Tokenizer.from_pretrained('./madlad400-3b-mt')
|
23 |
+
|
24 |
+
text = "<2es> how do you say torch in portuguese?"
|
25 |
+
input_ids = tokenizer(text, return_tensors="pt").input_ids
|
26 |
+
|
27 |
+
outputs = model.generate(
|
28 |
+
input_ids=input_ids,
|
29 |
+
generation_config=GenerationConfig(
|
30 |
+
decoder_start_token_id=2,
|
31 |
+
))
|
32 |
+
|
33 |
+
tokenizer.decode(outputs[0], skip_special_tokens=True)
|
34 |
+
# como se dice antorcha en portugués?
|
35 |
+
```
|
36 |
+
|
37 |
+
|
38 |
+
Colab to generate these files is [here](https://colab.research.google.com/drive/1rZ2NRyl2zwmg0sQ2Wi-uZZF48iVYulTC#scrollTo=pVODoE6gA9sw).
|