from transformers import BertTokenizer
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
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.
其实是因为连不上hugging face。
解决方法:用国内的镜像站,在前面加 HF_ENDPOINT=https://hf-mirror.com
HF_ENDPOINT=https://hf-mirror.com python your_script.py