Decoder start token is actually 0
Browse files
README.md
CHANGED
|
@@ -441,16 +441,16 @@ from transformers import T5ForConditionalGeneration, T5Tokenizer, GenerationConf
|
|
| 441 |
model = T5ForConditionalGeneration.from_pretrained('jbochi/madlad400-3b-mt')
|
| 442 |
tokenizer = T5Tokenizer.from_pretrained('jbochi/madlad400-3b-mt')
|
| 443 |
|
| 444 |
-
text = "<
|
| 445 |
input_ids = tokenizer(text, return_tensors="pt").input_ids
|
| 446 |
outputs = model.generate(
|
| 447 |
input_ids=input_ids,
|
| 448 |
generation_config=GenerationConfig(
|
| 449 |
-
decoder_start_token_id=
|
| 450 |
))
|
| 451 |
|
| 452 |
tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 453 |
-
#
|
| 454 |
```
|
| 455 |
|
| 456 |
Colab to generate these files is [here](https://colab.research.google.com/drive/1rZ2NRyl2zwmg0sQ2Wi-uZZF48iVYulTC#scrollTo=pVODoE6gA9sw).
|
|
|
|
| 441 |
model = T5ForConditionalGeneration.from_pretrained('jbochi/madlad400-3b-mt')
|
| 442 |
tokenizer = T5Tokenizer.from_pretrained('jbochi/madlad400-3b-mt')
|
| 443 |
|
| 444 |
+
text = "<2pt> I love pizza!"
|
| 445 |
input_ids = tokenizer(text, return_tensors="pt").input_ids
|
| 446 |
outputs = model.generate(
|
| 447 |
input_ids=input_ids,
|
| 448 |
generation_config=GenerationConfig(
|
| 449 |
+
decoder_start_token_id=0,
|
| 450 |
))
|
| 451 |
|
| 452 |
tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 453 |
+
# Eu adoro pizza!
|
| 454 |
```
|
| 455 |
|
| 456 |
Colab to generate these files is [here](https://colab.research.google.com/drive/1rZ2NRyl2zwmg0sQ2Wi-uZZF48iVYulTC#scrollTo=pVODoE6gA9sw).
|