transformers python代码 自动下载模型实现和参数。如果你的网络环境较差,下载模型参数可能会花费较长时间甚至失败。此时可以先将模型下载到本地,然后从本地加载。

根据
https://docs.github.com/zh/repositories/working-with-files/managing-large-files/installing-git-large-file-storage 先安装Git LFS

以chatglm-6b为例,然后运行
git clone https://huggingface.co/THUDM/chatglm-6b

参考 https://github.com/THUDM/ChatGLM-6B 的README