fix(#2180 P0): VLM/LLM timeout 调大,适配方舟视觉API 24-38s响应 #2180
@@ -451,7 +451,7 @@ def _analyze_single_image(
|
||||
|
||||
# 第二次:pro 降级重试
|
||||
if pro_fallback_model and pro_fallback_model != vision_model:
|
||||
pro_raw = _call(pro_fallback_model, 25) # #2173: pro 25s 上限(lite 已失败过,快速兜底)
|
||||
pro_raw = _call(pro_fallback_model, 60) # #2180: pro VLM 实测也需25-38s,原25s太短,提到60s
|
||||
pro_result = _normalize(pro_raw, "pro_fallback")
|
||||
if _is_vision_result_usable(pro_result):
|
||||
pro_result["_fallback_used"] = True
|
||||
@@ -485,7 +485,7 @@ def _step_image_analysis(job: ViralVideoJob) -> dict:
|
||||
if _s.doubao_vision_use_lite:
|
||||
vision_model = _s.doubao_vision_lite_model
|
||||
pro_model = _s.doubao_vision_model
|
||||
vision_timeout = 15 # #2173: lite 15s 快速失败转 pro(实测 lite 持续超时时白等137s是P0)
|
||||
vision_timeout = 45 # #2180: 方舟 VLM 实测服务端处理24-38s,原15s必超时3次重试全挂,提到45s
|
||||
else:
|
||||
vision_model = _s.doubao_vision_model
|
||||
pro_model = None # 已经是 pro,不再降级
|
||||
@@ -598,7 +598,7 @@ def _step_intent_parsing(job: ViralVideoJob, image_analysis: dict) -> dict:
|
||||
for _m, _lbl in [(_fast, "fast"), (_pro, "pro-fallback")]:
|
||||
try:
|
||||
logger.info("[爆款视频] 意图解析 model=%s label=%s", _m, _lbl)
|
||||
result = call_llm(prompt, temperature=0.4, max_tokens=800, model=_m, timeout=25)
|
||||
result = call_llm(prompt, temperature=0.4, max_tokens=800, model=_m, timeout=45)
|
||||
return (
|
||||
result
|
||||
if isinstance(result, dict)
|
||||
@@ -1033,16 +1033,16 @@ def _step_script_generation(job: ViralVideoJob, intent: dict, image_analysis: di
|
||||
|
||||
try:
|
||||
# 第一次:快模型 25s
|
||||
normalized = _try_gen(_fast, 0.8, 2500, "fast-first", tmo=25)
|
||||
normalized = _try_gen(_fast, 0.8, 2500, "fast-first", tmo=45)
|
||||
if normalized is not None:
|
||||
return normalized
|
||||
# 第二次:快模型降温度+加大 max_tokens,25s
|
||||
normalized = _try_gen(_fast, 0.6, 3200, "fast-retry", tmo=25)
|
||||
normalized = _try_gen(_fast, 0.6, 3200, "fast-retry", tmo=45)
|
||||
if normalized is not None:
|
||||
return normalized
|
||||
# 第三次:用主力模型兜底,给 40s
|
||||
if _pro and _pro != _fast:
|
||||
normalized = _try_gen(_pro, 0.7, 3500, "pro-fallback", tmo=40)
|
||||
normalized = _try_gen(_pro, 0.7, 3500, "pro-fallback", tmo=60)
|
||||
if normalized is not None:
|
||||
return normalized
|
||||
logger.warning("[爆款视频] 编导脚本三次都未生成合格结果,使用兜底脚本")
|
||||
@@ -1079,7 +1079,7 @@ def _step_review(job: ViralVideoJob, copy_result: dict) -> dict:
|
||||
for _m, _lbl in [(_fast, "fast"), (_pro, "pro-fallback")]:
|
||||
try:
|
||||
logger.info("[爆款视频] 合规审核 model=%s label=%s", _m, _lbl)
|
||||
result = call_llm(prompt, temperature=0.1, max_tokens=500, model=_m, timeout=20)
|
||||
result = call_llm(prompt, temperature=0.1, max_tokens=500, model=_m, timeout=30)
|
||||
return result if isinstance(result, dict) else {"passed": True, "score": 80, "details": {}}
|
||||
except Exception as e:
|
||||
logger.warning("[爆款视频] 合规审核失败 label=%s err=%s", _lbl, e)
|
||||
|
||||
@@ -95,8 +95,8 @@ class SharedSettings(BaseSettings):
|
||||
"doubao-seed-2-1-lite-260915" # 快速模型(Seed 2.1 Lite,高 RPM,编导/审核/VLM lite;原 1-5-pro-32k 已 Retiring)
|
||||
)
|
||||
doubao_base_url: str = "https://ark.cn-beijing.volces.com/api/v3"
|
||||
doubao_timeout: int = 30
|
||||
doubao_max_retries: int = 2
|
||||
doubao_timeout: int = 45 # #2180: 方舟LLM高峰期响应6-8s,原30s太紧提到45s
|
||||
doubao_max_retries: int = 1 # #2180: timeout调大后一次调用就够,1次重试防偶发抖动;避免6次重试叠加到351s
|
||||
doubao_vision_model: str = (
|
||||
"doubao-seed-2-1-pro-260915" # 高精度视觉(Seed 2.1 Pro 原生多模态;原 vision-pro-250328 已下线)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user