ValueError: This model generation config doesn't have a `text_decoder_lang_to_code_id` key which maps the target language to the right token id. Make sure to load the right generation config.

#13
by ns98 - opened

I have tried upgrading transformers.
I am using this snippet for text to text:
from transformers import AutoProcessor, SeamlessM4TModel
processor = AutoProcessor.from_pretrained("facebook/hf-seamless-m4t-medium")
model = SeamlessM4TModel.from_pretrained("facebook/hf-seamless-m4t-medium")

text_inputs = processor(text = "Hello, my dog is cute", src_lang="eng", return_tensors="pt")

output_tokens = model.generate(**text_inputs, tgt_lang="fra", generate_speech=False)
translated_text_from_text = processor.decode(output_tokens[0].tolist()[0], skip_special_tokens=True)
print(translated_text_from_text)

Can anyone tell me what is wrong?

Sign up or log in to comment