集成openai_plugins/imitater插件

This commit is contained in:
glide-the 2024-01-19 17:38:59 +08:00 committed by liunux4odoo
parent c4d2075995
commit fa4ccdb4be
2 changed files with 6 additions and 6 deletions

View File

@ -22,12 +22,12 @@ plugins:
- imitater:
name: "imitater"
logdir: "/media/gpt4-pdf-chatbot-langchain/langchain-chatchat-archive/logs"
worker_name: "worker1"
worker_name: "qwen-worker1"
run_openai_api:
host: "127.0.0.1"
port: 30000
imitate_model_workers:
- worker1:
- qwen-worker1:
model:
name: "Qwen-1_8B-Chat"
chat_model_path: "/media/checkpoint/Qwen-1_8B"

View File

@ -8,13 +8,13 @@
{%- set loop_messages = messages -%}
{%- set system_message = 'You are a helpful assistant.' -%}
{%- endif -%}
{{ '<|im_start|>' + 'system' + '\\n' + system_message + '<|im_end|>' + '\\n' }}
{{ '<|im_start|>' + 'system' + '\n' + system_message + '<|im_end|>' + '\n' }}
{%- for message in loop_messages -%}
{{ '<|im_start|>' + message['role'] + '\\n' + message['content']}}
{{ '<|im_start|>' + message['role'] + '\n' + message['content']}}
{%- if (loop.last and add_generation_prompt) or not loop.last -%}
{{ '<|im_end|>' + '\\n' }}
{{ '<|im_end|>' + '\n' }}
{%- endif -%}
{%- endfor -%}
{%- if add_generation_prompt and messages[-1]['role'] != 'assistant' -%}
{{ '<|im_start|>' + 'assistant' + '\\n' }}
{{ '<|im_start|>' + 'assistant' + '\n' }}
{%- endif -%}