当前位置: 首页> 游戏> 评测 > 备案密码找回_市场推广工作内容_广告留电话号的网站_特大新闻凌晨刚刚发生

备案密码找回_市场推广工作内容_广告留电话号的网站_特大新闻凌晨刚刚发生

时间:2025/8/1 6:19:14来源:https://blog.csdn.net/qq_33043025/article/details/144872658 浏览次数:2次
备案密码找回_市场推广工作内容_广告留电话号的网站_特大新闻凌晨刚刚发生

参考

魔搭社区

https://zhuanlan.zhihu.com/p/720148240

智谱AI通用大模型:本地部署ChatGLM3-6B开源大模型 - 编程库

说明

搭建方式多篇文章结合着看;

模型下载强烈推荐魔塔社区下载ZhipuAI/chatglm3-6b;

官方github指定清华的模型没有config.json等文件,辣鸡;

最主要的就是模型下载比较费时间;

源码下载

踩坑:有说下载ChatGLM-6B的,不建议尝试。应该下载ChatGLM3。

目前ChatGLM3/basic_demo/web_demo_streamlit.py是可以跑通的。

git clone https://github.com/THUDM/ChatGLM3.git

下载技巧:若下载速度过慢,可以通过码云的“从GitHub导入仓库”,然后再通过码云下载源码。

cd ChatGLM3 

python依赖安装,踩坑:ChatGLMTokenizer._pad() got an unexpected keyword argument ‘padding_side

解决参考:报错:“TypeError: ChatGLMTokenizer._pad() got an unexpected keyword argument ‘padding_side‘ ”-CSDN博客

参考上述链接,我将transformers调整为4.40.2,同时只安装basic所需的依赖,减少依赖安装耗时

# basic requirements
#transformers==4.40.0
transformers==4.40.2
cpm_kernels>=1.0.11
torch>=2.3.0
vllm>=0.4.2
gradio>=4.26.0
sentencepiece>=0.2.0
sentence_transformers>=2.7.0
accelerate>=0.29.2
streamlit>=1.33.0
fastapi>=0.110.0
loguru~=0.7.2
mdtex2html>=1.3.0
latex2mathml>=3.77.0
jupyter_client>=8.6.1

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/

模型下载

modelscope API下载(推荐)

pip install modelscope

from modelscope import snapshot_download model_dir = snapshot_download("ZhipuAI/chatglm3-6b", revision = "v1.0.0")

git下载

git lfs install git clone https://www.modelscope.cn/ZhipuAI/chatglm3-6b.git

界面启动

streamlit run web_demo_stremlit.py,推荐该方式

python web_demo_gradio.py,仅能本地访问

运维脚本

# start.sh# conda activate LLM
item_path=/home/ChatGLM3/basic_demo
nohup streamlit run $item_path'/web_demo_streamlit.py' >> $item_path'/web.log' 2>&1 &
# status.shitem_path=/home/ChatGLM3/basic_demo
ps -aux|grep $item_path'/web_demo_streamlit.py'nvidia-smi
# stop.shitem_path=/home/ChatGLM3/basic_demo
kill -9 `ps -ef|grep $item_path'/web_demo_streamlit.py'|grep -v 'grep'|awk '{print $2}'`

关键字:备案密码找回_市场推广工作内容_广告留电话号的网站_特大新闻凌晨刚刚发生

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: