Solving the issue "AttributeError: 'NllbTokenizerFast' object has no attribute 'lang_code_to_id'"

#1

When trying to do a simple translation from french to Mooré, I encountered this error.

Capture d’écran (9).png

This seems to be related to an recent update from transformers library. To be more precise they removed the "lang_code_to_id" attribute from NllbTokenize and NllbTokenizerFast classes.

To solve the issue, I just replaced the "lang_code_to_id" attribute by "convert_tokens_to_ids()" method.

Hope this help to keep your great space updated.

khof312 changed pull request status to merged

Sign up or log in to comment