本文主要是介绍解决Can‘t load tokenizer for ‘bert-base-chinese‘.问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
报错提示:
OSError: Can't load tokenizer for 'bert-base-chinese'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'bert-base-chinese' is the correct path to a directory containing all relevant files for a BertTokenizer tokenizer.
解决方法:
HF_ENDPOINT=https://hf-mirror.com python test.py
在运行.py命令前加上HF_ENDPOINT=https://hf-mirror.com就可以成功解决。
这篇关于解决Can‘t load tokenizer for ‘bert-base-chinese‘.问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!