From 597c320808a21f6aa22a7d7de9e5318d4a72081f Mon Sep 17 00:00:00 2001 From: binary-husky Date: Sat, 14 Sep 2024 17:04:01 +0000 Subject: [PATCH] fix: system prompt err when using o1 models --- core_functional.py | 2 +- request_llms/bridge_chatgpt.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core_functional.py b/core_functional.py index 9cc00e6f62..f12eeb2c28 100644 --- a/core_functional.py +++ b/core_functional.py @@ -17,7 +17,7 @@ def get_core_functions(): text_show_english= r"Below is a paragraph from an academic paper. Polish the writing to meet the academic style, " r"improve the spelling, grammar, clarity, concision and overall readability. When necessary, rewrite the whole sentence. " - r"Firstly, you should provide the polished paragraph. " + r"Firstly, you should provide the polished paragraph (in English). " r"Secondly, you should list all your modification and explain the reasons to do so in markdown table.", text_show_chinese= r"作为一名中文学术论文写作改进助理,你的任务是改进所提供文本的拼写、语法、清晰、简洁和整体可读性," diff --git a/request_llms/bridge_chatgpt.py b/request_llms/bridge_chatgpt.py index cab5183a92..03694b1b52 100644 --- a/request_llms/bridge_chatgpt.py +++ b/request_llms/bridge_chatgpt.py @@ -447,7 +447,7 @@ def generate_payload(inputs:str, llm_kwargs:dict, history:list, system_prompt:st openai_disable_system_prompt = model_info[llm_kwargs['llm_model']].get('openai_disable_system_prompt', False) if openai_disable_system_prompt: - messages = [] + messages = [{"role": "user", "content": system_prompt}] else: messages = [{"role": "system", "content": system_prompt}]