diff --git a/adapters/llm.py b/adapters/llm.py index 3e9223a..a8f646d 100644 --- a/adapters/llm.py +++ b/adapters/llm.py @@ -449,12 +449,15 @@ class GovernedLLMClient: }, ) if attempt < self._max_retries - 1: - delay = min( + import random + + base = min( self._retry_base_delay_s * (2**attempt), self._retry_max_delay_s, ) - if delay > 0: - await asyncio.sleep(delay) + jitter = base * random.uniform(0.5, 1.5) + if jitter > 0: + await asyncio.sleep(jitter) continue # 非瞬时、非致命 → 记遥测后直接抛出 diff --git a/adapters/ocr.py b/adapters/ocr.py index 0a2fbc3..c5dc1b0 100644 --- a/adapters/ocr.py +++ b/adapters/ocr.py @@ -14,7 +14,7 @@ from pathlib import Path # noqa: TC003 — 运行时需要(方法签名 + ope import requests from loguru import logger -_TIMEOUT_S = 15 +_TIMEOUT_S = 300 class MonkeyOCRClient: diff --git a/config/default.yaml b/config/default.yaml index 298d07e..ff4449a 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -20,7 +20,7 @@ embed: backend: "local" model_name: "BAAI/bge-base-zh-v1.5" embed_dim: 768 - device: "cpu" + device: "cuda" # ── Harness 自进化循环 ── harness: