chatglm配置

推荐看这个链接,有些问题解决出处https://zhuanlan.zhihu.com/p/643824521

以及这个https://blog.csdn.net/weixin_40547993/article/details/131775275

1.需要pytorch2.0,所以CUDA推荐11.8

ChatGLM2-6B版本要装PYTORCH2.0,而且要2.0.1 ,所以CUDA不能用12.0 ,只能用11.x 版本,11.5也不支持,推荐11.8。

cuda和cudnn安装教程推荐

Cuda和cuDNN安装教程(超级详细)-CSDN博客

2.conda新建环境,否则很容易把之前环境毁了

python大于3.8即可

conda create -n chatGLM python==3.8

3. 源码安装

​​​​​​https://huggingface.co/THUDM/chatglm2-6b

或者国内镜像(不能翻墙的福音)

https://gitee.com/dadac/ChatGLM2-6B

cd chatglm2-6b
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
 #必要可以加清华源

4.下载模型

修改代码,web_demo.py和web_demo2.py

#你模型的位置
tokenizer = AutoTokenizer.from_pretrained("chatglm2-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("chatglm2-6b", trust_remote_code=True).cuda()

5.启动

运行python web_demo.py或者streamlit run web_demo2.py

我运行前者,问答没有结果,运行后者结果

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值