From 4ce7a973f9b20d66d912ad053a3a60f4cd5cffc2 Mon Sep 17 00:00:00 2001 From: yym68686 Date: Mon, 18 Dec 2023 00:12:47 +0800 Subject: [PATCH] =?UTF-8?q?Fixed=20bug:=20=F0=9F=A4=96=EF=B8=8F=20gpt-3.5-?= =?UTF-8?q?turbo-16k=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 2 +- utils/chatgpt2api.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index 69f64203..48aaa55d 100644 --- a/config.py +++ b/config.py @@ -23,7 +23,7 @@ from datetime import datetime current_date = datetime.now() Current_Date = current_date.strftime("%Y-%m-%d") -systemprompt = os.environ.get('SYSTEMPROMPT', f"You are ChatGPT, a large language model trained by OpenAI. Respond conversationally in {LANGUAGE}. Knowledge cutoff: 2021-09. Current date: [ {Current_Date} ]") +systemprompt = os.environ.get('SYSTEMPROMPT', f"You are ChatGPT, a large language model trained by OpenAI. Respond conversationally in {LANGUAGE}. Knowledge cutoff: 2023-04. Current date: [ {Current_Date} ]") from utils.chatgpt2api import Chatbot as GPT from utils.chatgpt2api import Imagebot, claudebot diff --git a/utils/chatgpt2api.py b/utils/chatgpt2api.py index 8754e711..a1d38e49 100644 --- a/utils/chatgpt2api.py +++ b/utils/chatgpt2api.py @@ -448,7 +448,7 @@ def get_token_count(self, convo_id: str = "default") -> int: return num_tokens def get_message_token(self, url, json_post): - json_post["max_tokens"] = 5000 + json_post["max_tokens"] = 17000 headers = {"Authorization": f"Bearer {os.environ.get('API', None)}"} response = requests.Session().post( url, @@ -456,6 +456,7 @@ def get_message_token(self, url, json_post): json=json_post, timeout=None, ) + # print(response.text) if response.status_code != 200: json_response = json.loads(response.text) string = json_response["error"]["message"]