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

No such file or directory: '/root/.cache/huggingface/modules/transformers_modules/chatglm-6b/tokenization_chatglm.py' #29

Open
Data2Me opened this issue Apr 12, 2023 · 8 comments

Comments

@Data2Me
Copy link

Data2Me commented Apr 12, 2023

No such file or directory: '/root/.cache/huggingface/modules/transformers_modules/chatglm-6b/tokenization_chatglm.py'

@Data2Me Data2Me changed the title 为什么训练的时候有时报这个错?有时候又不报错 No such file or directory: '/root/.cache/huggingface/modules/transformers_modules/chatglm-6b/tokenization_chatglm.py' Apr 12, 2023
@lich99
Copy link
Owner

lich99 commented Apr 12, 2023

site-packages/transformers/dynamic_module_utils.py Line 177
This appears to be a problem with transformers. A temp file is created, but conflicts may occur when running multiple threads.

@Data2Me
Copy link
Author

Data2Me commented Apr 12, 2023

site-packages/transformers/dynamic_module_utils.py Line 177 This appears to be a problem with transformers. A temp file is created, but conflicts may occur when running multiple threads.

怎么解决呢,我是在docker镜像里面跑的,我把container都删了还是会报错,有时候要过好久可能又可以run起来

@lich99
Copy link
Owner

lich99 commented Apr 12, 2023

while True:
    try:
        tokenizer = AutoTokenizer.from_pretrained(checkpoint, trust_remote_code=True, )
        model = AutoModel.from_pretrained(checkpoint, trust_remote_code=True, )
        break
    except:
        continue

最简单方法套一个try, except

@tu2022
Copy link

tu2022 commented May 10, 2023

这个有彻底解决的方法么?我这试了好多次,一直在报这个错,这个也看运气的吗

@EthenZhang
Copy link

同样的问题,尝试删除/home/admin/.cache/huggingface/ 文件夹也没用,多试几次成功一次

@zhaochs1995
Copy link

同样遇到了,有什么好的解决方式嘛

@jack12356
Copy link

修改transformer为4.28.1

@my-yy
Copy link

my-yy commented Nov 17, 2023

transformers库的一个bug,多进程\多线程同时加载模型时有可能会冲突,升级版本到4.28.1就好了

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

7 participants