Open LeitHunt opened 1 month ago
I can confirm that this happens to me too; both in Windows 11 Pro, and Linux Mint 22 Xfce. I suspect that we are too low on RAM, I too have only 4GB, same as you.
It has nothing to do with RAM.
The true reason is that the version of transformers is too high for NLLB-serve
so the solution is: Try downgrading to an older version, such as 4.37.0
pip install transformers==4.37.0
Followed this Tutorial Getting Error: "thammegowda-nllb-serve" requires a web server running locally! Trying to Translate Japanese to English
In my CMD:
Microsoft Windows [Version 10.0.22631.4169] (c) Microsoft Corporation. All rights reserved.
C:\Users\xxxx>nllb-serve INFO:root:torch device=cuda INFO:root:Loading model facebook/nllb-200-distilled-600M ... INFO:root:Loading default tokenizer for facebook/nllb-200-distilled-600M ... C:\Users\xxxx\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\tokenization_utils_base.py:1601: FutureWarning:
clean_up_tokenization_spaces
was not set. It will be set toTrue
by default. This behavior will be depracted in transformers v4.45, and will be then set toFalse
by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884 warnings.warn( INFO:root:System Info: ${'transformer': '4.44.2', 'Python Version': '3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]', 'Platform': 'Windows-10-10.0.22631-SP0', 'Platform Version': '10.0.22631', 'Processor': 'Intel64 Family 6 Model 158 Stepping 10, GenuineIntel', 'GPU': "_CudaDeviceProperties(name='NVIDIA GeForce GTX 1650', major=7, minor=5, total_memory=4095MB, multi_processor_count=16)", 'Cuda Version': '12.4', 'model_id': 'facebook/nllb-200-distilled-600M'}Tried to find Solution Online and on ChatGPT..
ChatGPT: The error you're encountering indicates that the NllbTokenizerFast object does not have the attribute lang_code_to_id. This typically suggests that the tokenizer you are using is either outdated or improperly initialized.
Here are some steps to troubleshoot and resolve the issue:
pip install --upgrade transformers
from transformers import NllbTokenizerFast
tokenizer = NllbTokenizerFast.from_pretrained("facebook/nllb-200-distilled-600M")
print(tokenizer.get_langs())
Update Your Code: If lang_code_to_id is not available, check the documentation for the latest method to get the language IDs or update the way you handle language parameters in your translation request.
Check Documentation and Issues: Visit the official Hugging Face documentation or the GitHub repository for any changes in the API or for reported issues related to the NllbTokenizerFast.
If after these steps the error persists, please provide additional context or code snippets for further diagnosis.