Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NllbTokenizerFast' object has no attribute 'lang_code_to_id #20

Open
Devloper-Sigmoid opened this issue Jul 25, 2024 · 4 comments
Open

Comments

@Devloper-Sigmoid
Copy link

NllbTokenizerFast' object has no attribute 'lang_code_to_id

@GOvEy1nw
Copy link

hey, I found a fix for this.

line 145 in app.py needs changing from:

**inputs, forced_bos_token_id=tokenizer.lang_code_to_id[tgt_lang],

To:

**inputs, forced_bos_token_id=tokenizer.convert_tokens_to_ids(tgt_lang),

@snap-star
Copy link

hey, I found a fix for this.

line 145 in app.py needs changing from:

**inputs, forced_bos_token_id=tokenizer.lang_code_to_id[tgt_lang],

To:

**inputs, forced_bos_token_id=tokenizer.convert_tokens_to_ids(tgt_lang),

thanks a lot man!

hdcola added a commit to hdcola/nllb-serve that referenced this issue Aug 20, 2024
@brauliobo
Copy link

brauliobo commented Sep 30, 2024

fixed here by downgrading transformers, see huggingface/transformers#31348 (comment)

@jksab
Copy link

jksab commented Nov 6, 2024

hey, I found a fix for this.

line 145 in app.py needs changing from:

**inputs, forced_bos_token_id=tokenizer.lang_code_to_id[tgt_lang],

To:

**inputs, forced_bos_token_id=tokenizer.convert_tokens_to_ids(tgt_lang),

Thanks it worked, you fixed it

lrq3000 added a commit to lrq3000/nllb-serve that referenced this issue Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants