【大模型】llama模型加载报错 TypeError: not a string
llama模型:openlm-research/open_llama_3b_v2
加载代码:
from transformers import LlamaTokenizer
model_path = 'openlm-research/open_llama_3b_v2'
tokenizer = LlamaTokenizer.from_pretrained(model_path)
报错信息
return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg)
TypeError: not a string
原因
模型下载不完整导致的错误
修正方法
重新到官网下载模型
我这里到:https://huggingface.co/openlm-research/open_llama_3b_v2/tree/main 重新下载了所有文件。