From b76e77a66a0c8309f5ec4660c50d1b5f19e707b5 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Wed, 4 Oct 2023 10:24:28 -0600 Subject: [PATCH] fix exception --- llm_server/routes/openai_request_handler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llm_server/routes/openai_request_handler.py b/llm_server/routes/openai_request_handler.py index 835b575..468941f 100644 --- a/llm_server/routes/openai_request_handler.py +++ b/llm_server/routes/openai_request_handler.py @@ -78,8 +78,9 @@ class OpenAIRequestHandler(RequestHandler): def handle_ratelimited(self, do_log: bool = True): print('OAI ratelimited:', self.client_ip, self.request.headers) - _, default_model = get_model_choices() - w = int(default_model['estimated_wait']) if default_model['estimated_wait'] > 0 else 2 + model_choices, default_model = get_model_choices() + default_model_info = model_choices[default_model] + w = int(default_model_info['estimated_wait']) if default_model_info['estimated_wait'] > 0 else 2 response = jsonify({ "error": { "message": "Rate limit reached on tokens per min. Limit: 10000 / min. Please try again in 6s. Contact us through our help center at help.openai.com if you continue to have issues.",