jbochi commited on
Commit
f53fec2
1 Parent(s): 38ea243

Decoder start token is actually 0

Browse files
Files changed (1) hide show
  1. README.md +3 -3
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 = "<2es> how do you say torch in portuguese?"
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=2,
450
  ))
451
 
452
  tokenizer.decode(outputs[0], skip_special_tokens=True)
453
- # como se dice antorcha en portugués?
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).