From 121c40f273bd3611254a45e08b80a8b00ba64a6a Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sun, 11 Aug 2024 01:49:33 -0400 Subject: [PATCH] perf: raise error when badrequest --- model/provider/openai_official.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/provider/openai_official.py b/model/provider/openai_official.py index b5eefcd23..fc02a77d5 100644 --- a/model/provider/openai_official.py +++ b/model/provider/openai_official.py @@ -359,7 +359,7 @@ class ProviderOpenAIOfficial(Provider): logger.warn(f"OpenAI 请求异常:{e}。") if "image_url is only supported by certain models." in str(e): raise Exception(f"当前模型 { self.model_configs['model'] } 不支持图片输入,请更换模型。") - retry += 1 + raise e except RateLimitError as e: if "You exceeded your current quota" in str(e): self.keys_data[self.chosen_api_key] = False