一、背景
从modelscope手动下载了bin参数放在本地文件夹,需要加载并运行。
二、问题及解决
错误1:
ValueError: Tokenizer class XXXTokenizer does not exist or is not
currently imported.
解决方案
AutoTokenizer.from_pretrained
和AutoModelForCausalLM.from_pretrained
参数中加上trust_remote_code=True
错误2:
ValueError: The current
device_map
had weights offloaded to the
disk. Please provide anoffload_folder
for them. Alternatively, make
sure you havesafetensors
installed if the model you are using
offers the weights in this format.
解决方案
AutoModelForCausalLM.from_pretrained
的参数中加上offload_folder="offload_folder"