madlad400-3b-mt / README.md
jbochi's picture
Update README.md
75e6a99
|
raw
history blame
990 Bytes
metadata
license: apache-2.0
language:
  - en
  - pt
  - es
  - de
  - it
library_name: transformers
tags:
  - text-generation-inference

T5ForConditionalGeneration files for the Madlad-400 3B parameter MT model.

from transformers import T5ForConditionalGeneration, T5Tokenizer, GenerationConfig

model = T5ForConditionalGeneration.from_pretrained('jbochi/madlad400-3b-mt')

tokenizer = T5Tokenizer.from_pretrained('./madlad400-3b-mt')

text = "<2es> how do you say torch in portuguese?"
input_ids = tokenizer(text, return_tensors="pt").input_ids

outputs = model.generate(
    input_ids=input_ids,
    generation_config=GenerationConfig(
        decoder_start_token_id=2,
))

tokenizer.decode(outputs[0], skip_special_tokens=True)
# como se dice antorcha en portugués?

Colab to generate these files is here.