Skip to content

Commit

Permalink
Fixed bug: 🤖️ gpt-3.5-turbo-16k error
Browse files Browse the repository at this point in the history
  • Loading branch information
yym68686 committed Dec 17, 2023
1 parent ce26978 commit 4ce7a97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion utils/chatgpt2api.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,14 +448,15 @@ 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,
headers=headers,
json=json_post,
timeout=None,
)
# print(response.text)
if response.status_code != 200:
json_response = json.loads(response.text)
string = json_response["error"]["message"]
Expand Down

0 comments on commit 4ce7a97

Please sign in to comment.