xusenlinzy / api-for-open-llm

Openai style api for open large language models, using LLMs just as chatgpt! Support for LLaMA, LLaMA-2, BLOOM, Falcon, Baichuan, Qwen, Xverse, SqlCoder, CodeLLaMA, ChatGLM, ChatGLM2, ChatGLM3 etc. 开源大模型的统一后端接口
Apache License 2.0
2.16k stars 252 forks source link

BaiChuan2Template不支持system prompt,需要添加以下模板支持 #203

Closed DarkDance closed 6 months ago

DarkDance commented 6 months ago

提交前必须检查以下项目 | The following items must be checked before submission

问题类型 | Type of problem

效果问题 | Effectiveness issues

操作系统 | Operating system

Windows

详细描述问题 | Detailed description of the problem

class BaiChuan2Template(BaseTemplate) 里面返回的模板开头没有system_prompt的处理,导致模型测试的时候实际上没有效果

Dependencies

加上下面的代码就好了 "{% if messages[0]['role'] == 'system' %}" "{{ messages[0]['content'] }}" "{% else %}" "{{ system_prompt }}" "{% endif %}"

运行日志或截图 | Runtime logs or screenshots

No response

xusenlinzy commented 6 months ago

已经加上了,使用时需要指定PROMPT_NAME=baichuan2