ruff fix但指定了--unsafe-fixes
This commit is contained in:
committed by
Windpicker-owo
parent
04feb585b4
commit
2a89efe47a
@@ -227,7 +227,7 @@ class _ModelSelector:
|
||||
penalty_increment = self.DEFAULT_PENALTY_INCREMENT
|
||||
|
||||
# 对严重错误施加更高的惩罚,以便快速将问题模型移出候选池
|
||||
if isinstance(e, (NetworkConnectionError, ReqAbortException)):
|
||||
if isinstance(e, NetworkConnectionError | ReqAbortException):
|
||||
# 网络连接错误或请求被中断,通常是基础设施问题,应重罚
|
||||
penalty_increment = self.CRITICAL_PENALTY_MULTIPLIER
|
||||
logger.warning(
|
||||
@@ -524,8 +524,8 @@ class _RequestExecutor:
|
||||
model_name = model_info.name
|
||||
retry_interval = api_provider.retry_interval
|
||||
|
||||
if isinstance(e, (NetworkConnectionError, ReqAbortException)):
|
||||
return await self._check_retry(remain_try, retry_interval, "连接异常", model_name)
|
||||
if isinstance(e, NetworkConnectionError | ReqAbortException):
|
||||
return self._check_retry(remain_try, retry_interval, "连接异常", model_name)
|
||||
elif isinstance(e, RespNotOkException):
|
||||
return await self._handle_resp_not_ok(e, model_info, api_provider, remain_try, messages_info)
|
||||
elif isinstance(e, RespParseException):
|
||||
|
||||
Reference in New Issue
Block a user