做网站百度推广,网站创建公司哪家好,合肥建设局,产品设计用什么软件好MindNLP ChatGLM-6B StreamChat
本案例基于MindNLP和ChatGLM-6B实现一个聊天应用。
安装mindnlp
pip install mindnlp安装mdtex2html
pip install mdtex2html配置网络线路
export HF_ENDPOINThttps://hf-mirror.com代码开发
下载权重大约需要10分钟
from mindnlp.transf…MindNLP ChatGLM-6B StreamChat
本案例基于MindNLP和ChatGLM-6B实现一个聊天应用。
安装mindnlp
pip install mindnlp安装mdtex2html
pip install mdtex2html配置网络线路
export HF_ENDPOINThttps://hf-mirror.com代码开发
下载权重大约需要10分钟
from mindnlp.transformers import AutoModelForSeq2SeqLM, AutoTokenizer
import gradio as gr
import mdtex2htmlmodel AutoModelForSeq2SeqLM.from_pretrained(ZhipuAI/ChatGLM-6B, mirrormodelscope).half()
model.set_train(False)
tokenizer AutoTokenizer.from_pretrained(ZhipuAI/ChatGLM-6B, mirrormodelscope)可以修改下列参数和prompt体验模型
prompt 你好,简单介绍一下MindSpore
history []
response, _ model.chat(tokenizer, prompt, historyhistory, max_length20)
response结果
MindSpore 是一个基于人工智能的开源框架