Update checkpoint for transformers>=4.29

#4
by ArthurZ HF staff - opened
Language Technology Research Group at the University of Helsinki org
edited Oct 10, 2023

Following the merge of a PR in transformers it appeared that this model was not properly converted. This PR will fix the inference and was tested using the following script:

>>> from transformers import AutoTokenizer, MarianMTModel
>>> tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-tc-big-gmw-gmw")
>>> inputs = tokenizer('>>nds<< Red keinen Quatsch.', return_tensors="pt", padding=True)
>>> model = MarianMTModel.from_pretrained("Helsinki-NLP/opus-mt-tc-big-gmw-gmw")
>>> print(tokenizer.batch_decode(model.generate(**inputs)))
['<pad> Kiek ok bi: Rott.</s>']

LGTM, thanks @ArthurZ .

I verified it worked with:

  • version v4.28.0 has the same results with and without the specific revision
  • current version fails with the main of this repo, but now works with this specific revision.

Thanks for your work!

lysandre changed pull request status to merged

Sign up or log in to comment