Skip to content

Commit

Permalink
Add support for gpt-4-1106-preview model.
Browse files Browse the repository at this point in the history
  • Loading branch information
yym68686 committed Nov 7, 2023
1 parent 0f22509 commit ab63bbc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 5 additions & 4 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,11 @@ async def delete_message(update, context, messageid, delay=10):
InlineKeyboardButton("gpt-4-32k", callback_data="gpt-4-32k"),
# InlineKeyboardButton("gpt-4-0314", callback_data="gpt-4-0314"),
],
# [
# InlineKeyboardButton("gpt-4-32k", callback_data="gpt-4-32k"),
# InlineKeyboardButton("gpt-4-32k-0314", callback_data="gpt-4-32k-0314"),
# ],
[
InlineKeyboardButton("gpt-4-1106-preview", callback_data="gpt-4-1106-preview"),
# InlineKeyboardButton("gpt-4-32k", callback_data="gpt-4-32k"),
# InlineKeyboardButton("gpt-4-32k-0314", callback_data="gpt-4-32k-0314"),
],
# [
# InlineKeyboardButton("gpt-4-0613", callback_data="gpt-4-0613"),
# InlineKeyboardButton("gpt-4-32k-0613", callback_data="gpt-4-32k-0613"),
Expand Down
9 changes: 7 additions & 2 deletions chatgpt2api/chatgpt2api.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def get_filtered_keys_from_object(obj: object, *keys: str) -> Set[str]:
"gpt-4-32k-0314",
"gpt-4-0613",
"gpt-4-32k-0613",
"gpt-4-1106-preview",
"claude-2-web",
"claude-2",
]
Expand Down Expand Up @@ -81,7 +82,9 @@ def __init__(
self.api_key: str = api_key
self.system_prompt: str = system_prompt
self.max_tokens: int = max_tokens or (
31000
4000
if "gpt-4-1106-preview" in engine
else 31000
if "gpt-4-32k" in engine
else 7000
if "gpt-4" in engine
Expand All @@ -92,7 +95,9 @@ def __init__(
else 4000
)
self.truncate_limit: int = truncate_limit or (
30500
126500
if "gpt-4-1106-preview" in engine
else 30500
if "gpt-4-32k" in engine
else 6500
if "gpt-4" in engine
Expand Down

0 comments on commit ab63bbc

Please sign in to comment.