From 85f149c9755bd684b77d34982d58b8f8c4a925ce Mon Sep 17 00:00:00 2001 From: Megham Garg <95271253+gargmegham@users.noreply.github.com> Date: Fri, 21 Apr 2023 15:16:08 +0530 Subject: [PATCH] Missing self from error handler --- bot/openai_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/openai_utils.py b/bot/openai_utils.py index 423a3a9..cdb0110 100644 --- a/bot/openai_utils.py +++ b/bot/openai_utils.py @@ -44,7 +44,7 @@ class ChatGPT: ) answer = r.choices[0].text else: - raise ValueError(f"Unknown model: {model}") + raise ValueError(f"Unknown model: {self.model}") answer = self._postprocess_answer(answer) n_input_tokens, n_output_tokens = r.usage.prompt_tokens, r.usage.completion_tokens @@ -193,4 +193,4 @@ async def generate_images(prompt, n_images=4): async def is_content_acceptable(prompt): r = await openai.Moderation.acreate(input=prompt) - return not all(r.results[0].categories.values()) \ No newline at end of file + return not all(r.results[0].categories.values())