From fa4ccdb4be63b66aeb2b3a3c57dfbed050eec945 Mon Sep 17 00:00:00 2001 From: glide-the <2533736852@qq.com> Date: Fri, 19 Jan 2024 17:38:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E6=88=90openai=5Fplugins/imitater?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/loom.yaml.example | 4 ++-- openai_plugins/imitater/templates/qwen.jinja | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/loom.yaml.example b/configs/loom.yaml.example index 0432b50a..1f7a3bfb 100644 --- a/configs/loom.yaml.example +++ b/configs/loom.yaml.example @@ -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" diff --git a/openai_plugins/imitater/templates/qwen.jinja b/openai_plugins/imitater/templates/qwen.jinja index 5debc9ad..1ac25602 100644 --- a/openai_plugins/imitater/templates/qwen.jinja +++ b/openai_plugins/imitater/templates/qwen.jinja @@ -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 -%}