【大模型】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 重新下载了所有文件。
文章讲述了在使用Llama模型时遇到的TypeError,原因是模型下载不完整。作者提供了解决方案,即从HuggingFace官网重新下载所有文件。
3630

被折叠的 条评论
为什么被折叠?



