Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
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
|
12 |
+
---
|
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 |
+
model = T5ForConditionalGeneration.from_pretrained("iliemihai/madlad400-3b-mt")
|
20 |
+
tokenizer = T5Tokenizer.from_pretrained("iliemihai/madlad400-3b-mt")
|
21 |
+
|
22 |
+
text = """The quick brown fox jumped over the laisy dog."""
|
23 |
+
input_ids = tokenizer.encode(f"<2ro> {text} </s>", return_tensors="pt")
|
24 |
+
outputs = model.generate(input_ids,
|
25 |
+
do_sample=True,
|
26 |
+
early_stopping=True,
|
27 |
+
top_p=0.92,
|
28 |
+
top_k=50,
|
29 |
+
temperature=0.3,
|
30 |
+
max_length=256)
|
31 |
+
print(tokenizer.decode(outputs[0]))
|
32 |
+
```
|
33 |
+
|
34 |
+
**KUDOS TO jbochi FOR RELEASING THE COLAB AND CONVERSION CODE
|
35 |
+
Colab to generate these files is [here](https://colab.research.google.com/drive/1rZ2NRyl2zwmg0sQ2Wi-uZZF48iVYulTC#scrollTo=pVODoE6gA9sw).
|