提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
一、下载源码
git clone https://github.com/THUDM/ChatGLM3.git
#安装项目依赖
cd ChatGLM3
#使用清华源加速
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
二、修改配置
切换至composite_dem目录下
cd composite_demo
修改client.py
#找到MODEL_PATH 并将模型指向本地路径
MODEL_PATH = os.environ.get('MODEL_PATH', 'D:\\AIGC\\model hub\\THUDM\\chatglm3-6b')
启动main.py
#默认8501端口启动
python -m streamlit run main.py
预设提示词
main.py 14行DEFAULT_SYSTEM_PROMPT
#左侧预设提示词
You are ChatGLM3, a large language model trained by Zhipu.AI. Follow the user's instructions carefully. Respond using markdown
#修改默认提示词(也可在页面中直接修改)
你是一位记者,名字叫tom,你的工作是记录并总结用户的问答,并在最后总结输出.
Tool工具调用
写在最后
欢迎移步我的Github仓库,https://github.com/Jun-Howie/erniebot-openai-api
本仓库使用飞桨星河社区接入ernie-4.0联网功能,如果你需要可以Fork我的仓库,还请给个Star让我知道