ChatGLM3
ChatGLM3 copied to clipboard
微调后的chatGLM3-6b可以被api调用
Feature request / 功能建议
from zhipuai import ZhipuAI
client = ZhipuAI(api_key="fb0f86cfacb4bcdc858fedffb3576802.pKgPfSB3fWU1OpOv") # 填写您自己的APIKey while True: prompt = input("user:") response = client.chat.completions.create( model="chatglm3-6b", # 填写需要调用的模型名称 可以调用自己微调过的模型 messages=[ {"role": "user", "content": prompt} ], ) answer = response.choices[0].message.content print("ZhipuAI:", answer)
Motivation / 动机
这样就可以封装成自己的平台了
Your contribution / 您的贡献
无
建议仔细查看微调的readme,有告诉怎么自己改代码支持