AI4Finance-Foundation / FinGPT

FinGPT: Open-Source Financial Large Language Models! Revolutionize 🔥 We release the trained model on HuggingFace.
https://ai4finance.org
MIT License
13.48k stars 1.88k forks source link

报错信息如下,请指教。 #71

Open kongfanyu opened 1 year ago

kongfanyu commented 1 year ago

Mac系统,CPU i7 内存16G, 下载了001-007的文件;运行报错: /Users/kongfanyu/Downloads/MyFinGPT/venv/bin/python /Users/kongfanyu/Downloads/MyFinGPT/fingpt/FinGPT-v3/test.py Traceback (most recent call last): File "/Users/kongfanyu/Downloads/MyFinGPT/fingpt/FinGPT-v3/test.py", line 13, in model = AutoModel.from_pretrained(base_model, trust_remote_code=True, device_map="auto") File "/Users/kongfanyu/Downloads/MyFinGPT/venv/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 558, in from_pretrained return model_class.from_pretrained( File "/Users/kongfanyu/Downloads/MyFinGPT/venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3175, in from_pretrained ) = cls._load_pretrained_model( File "/Users/kongfanyu/Downloads/MyFinGPT/venv/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3296, in _load_pretrained_model raise ValueError( ValueError: The current device_map had weights offloaded to the disk. Please provide an offload_folder for them. Alternatively, make sure you have safetensors installed if the model you are using offers the weights in this format.

进程已结束,退出代码1

oliverwang15 commented 11 months ago

这个应该是GPU显存不足所以转用内存进行推理,解决方案可以参考这里这里。不过用内存+CPU推理的话速度可能会比较慢。