今天在跑一个模型的时候出现该报错,完整报错为:
bash
OSError: Can't load tokenizer for 'bert-base-uncased'. 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-uncased' is the correct path to a directory containing all relevant files for a BertTokenizer tokenizer.
找了半天一直没找到解决方案,最后发现是transformers库的版本问题,要么在终端运行:
conda install transformers
要么就是更新该库transformers
就能解决了。