Skip to content

Commit

Permalink
o1 error
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaGusev committed Dec 1, 2024
1 parent c03c667 commit 60e1347
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions configs/localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"PAY_SUPPORT": "Возврат средств за подписку возможен в течение 12 часов с момента её оформления, и если с момента оформления было сделано менее 20 запросов к любым моделями. Контакт: @YallenGusev",
"FILE_IS_TOO_BIG": "Слишком большой файл! Телеграм-боты не могут скачивать файлы больше 20 МБ.",
"MESSAGE_FILTERED": "Я не могу обсуждать эту тему, сработал фильтр.",
"O1_WRONG_PARAMS": "O1 модели поддерживают только temperature=1.0, top_p=1.0 и пустой системный промпт. Измените параметры.",
"PRIVACY": {
"template_name": "ru_privacy"
},
Expand Down
7 changes: 5 additions & 2 deletions src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,12 +1008,15 @@ async def _handle_message(self, message: Message, override_content: Optional[str
if "claude" in model and params["temperature"] > 1.0:
await message.reply(self.localization.CLAUDE_HIGH_TEMPERATURE)
return
if not isinstance(content, str) and not provider.can_handle_images:
await message.reply(self.localization.CONTENT_NOT_SUPPORTED_BY_MODEL)
if "o1" in model and (params["temperature"] != 1.0 or params["top_p"] != 1.0 or system_prompt):
await message.reply(self.localization.O1_WRONG_PARAMS)
return
if content is None:
await message.reply(self.localization.CONTENT_NOT_SUPPORTED)
return
if not isinstance(content, str) and not provider.can_handle_images:
await message.reply(self.localization.CONTENT_NOT_SUPPORTED_BY_MODEL)
return

self.db.save_user_message(content, conv_id=conv_id, user_id=user_id, user_name=user_name)

Expand Down
1 change: 1 addition & 0 deletions src/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class Localization:
PRIVACY: Template
FILE_IS_TOO_BIG: str
MESSAGE_FILTERED: str
O1_WRONG_PARAMS: str

@classmethod
def load(cls, path: str, language: str) -> "Localization":
Expand Down

0 comments on commit 60e1347

Please sign in to comment.