fix exception

This commit is contained in:
Cyberes 2023-10-04 10:24:28 -06:00
parent 5f4e4710c1
commit b76e77a66a
1 changed files with 3 additions and 2 deletions

View File

@ -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.",