-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
Error when using AutoTokenizer to load local files without network #31712
Comments
cc @itazap can you have a look? |
Hello @pppppkun ! I'm not able to reproduce this issue, I cloned the repo and copied it to a local folder ('home/chatglm3-6b') and it correctly accesses it without network with |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
System Info
transformers
version: 4.42.3Who can help?
@ArthurZucker
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Here are the results of my analysis and the corresponding steps to reproduce:
I examined the stack trace in step 4 and found that the issue may stem from line 505 in
transformers/dynamic_module_utils.py
within theget_class_from_dynamic_module
function, where the first parameterrepo_id
is incorrectly set when callingget_cached_module_file
. It should have been set to the parameterpretrained_model_name_or_path
(in my case, the value of this parameter is/home/xx/chatglm3-6b
), but instead, it receivedTHUDM/chatglm3-6b--tokenization_chatglm.ChatGLMTokenizer
, as set in line 497.I believe the logic in lines 496-499 needs adjustment. When
pretrained_model_name_or_path
represents a file path,repo_id
should directly reflectpretrained_model_name_or_path
. Whether or not my analysis is correct, I would like to personally fix this issue and contribute to the open-source process.Expected behavior
The tokenizer should be loaded correctly
The text was updated successfully, but these errors were encountered: