Helsinki-NLP/opus-mt-en-fr missing tf_model.h5

Hi there,

I have been following the tensorflow track of the HF course and got an http 404 error when running the below:

from transformers import TFAutoModelForSeq2SeqLM

model = TFAutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)

error message:

404 Client Error: Not Found for url:

I went to the model card and could not find the tf_model.h5 file. Is there something that I am missing or does the model only work for Torch?


Hi @nickmuchi, thanks for the bug report!

Indeed, you’re right that this model only has weights for PyTorch. However, you can load it in TensorFlow using the from_pt argument as follows:

from transformers import TFAutoModelForSeq2SeqLM

model = TFAutoModelForSeq2SeqLM.from_pretrained(model_checkpoint, from_pt=True)

In the meantime, I’ll post a fix on the website - thanks!

That worked, thank you very much!

1 Like