Report === --- User-Friendly Information --- Message: 自定义模型 custom-local:ERNIE-5...
错误信息
=== Error Report ===
--- User-Friendly Information ---
Message: 自定义模型 custom-local:ERNIE-5.1 错误,请切换模型或重试。
--- Technical Details ---
Error Code: 10000
Request ID: 01a1154c3dec775594928ef3e5c7ec54
Trace ID: f918a2c877b74acb8666a74f20494757
Timestamp: 2026/10/07 15:38:03 (UTC+8)
Server Detail: {"code":-32603,"message":"Internal error","data":{"details":"No response received from model","category":"internal"}}
App Version: 5.7.6
User ID: 17bb7b83-78dc-4cdd-8d12-dfce40716631
AI 解决方案
🌐 错误翻译
原文:自定义模型 custom-local:ERNIE-5.1 错误,请切换模型或重试。
译文:自定义模型 custom-local:ERNIE-5.1 出现错误,请切换其他模型或重试请求。
原文:No response received from model
译文:未从模型接收到响应
🎯 原因分析
该错误表明你调用的自定义模型
custom-local:ERNIE-5.1 在请求过程中未能返回任何响应。底层服务器返回 Internal error(内部错误),属于服务端偶发异常,通常由以下原因导致:💡 解决方案
针对此错误,建议按以下步骤处理:
# 方案1:添加重试机制,应对偶发服务端异常
import time
def call_model_with_retry(prompt, model="ERNIE-5.1", retries=3):
for attempt in range(retries):
try:
response = model.generate(prompt) # 你的模型调用逻辑
return response
except Exception as e:
if attempt < retries - 1:
time.sleep(2 ** attempt) # 指数退避重试
else:
raise e
# 方案2:会选择可用模型进行降级处理,保证服务稳定性
def call_model_with_fallback(prompt):
model_configs = [
("ERNIE-5.1", "custom-local"), # 优先尝试
("ERNIE-4.0", "custom-local"), # 降级方案1
("default", "baichuan"), # 降级方案2
]
for model_name, model_type in model_configs:
try:
return call_model(prompt, model_name, model_type)
except Exception as e:
logging.warning(f"模型 {model_name} 调用失败: {e}")
continue
raise RuntimeError("所有模型均调用失败")