refactor: share INFRA stop-reason set from core.evolution
This commit is contained in:
@@ -53,7 +53,7 @@ if TYPE_CHECKING:
|
||||
_SPAN_EVAL_TOOLS: frozenset[str] = frozenset({"view_node", "search_similar", "observe_frame"})
|
||||
"""span 级评估涵盖的工具集合。"""
|
||||
|
||||
_INFRA_STOP_REASONS: frozenset[str] = frozenset({"error", "parse_error"})
|
||||
INFRA_STOP_REASONS: frozenset[str] = frozenset({"error", "parse_error"})
|
||||
"""执行/解析层失败导致排除的 stop_reason 集合。"""
|
||||
|
||||
|
||||
@@ -2007,7 +2007,7 @@ def _count_infra_excluded(
|
||||
qids = [
|
||||
row["question_id"]
|
||||
for row in prediction_rows
|
||||
if row.get("stop_reason") in _INFRA_STOP_REASONS
|
||||
if row.get("stop_reason") in INFRA_STOP_REASONS
|
||||
]
|
||||
return len(qids), qids
|
||||
|
||||
@@ -2083,7 +2083,7 @@ async def run_diagnosis(
|
||||
|
||||
for row in all_predictions:
|
||||
stop_reason = row.get("stop_reason")
|
||||
if stop_reason in _INFRA_STOP_REASONS:
|
||||
if stop_reason in INFRA_STOP_REASONS:
|
||||
continue
|
||||
if task_type_filter and row.get("task_type") not in task_type_filter:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user