fix(eval): 单条样本失败不再拖垮整轮评估
- cli:逐样本 transcribe 包 try/except,失败记为该样本 error 并继续; 失败样本 counts 置空,不计入准确率,仅在 errors 列计数 - custom 数据集:manifest 引用的音频不存在时 warn 跳过,不再让 soundfile 抛错崩掉整轮(修复默认 config 的 custom 示例集指向不存在音频导致的崩溃) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ from __future__ import annotations
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from collections.abc import Iterator
|
||||
|
||||
from ..manifest import Sample
|
||||
@@ -50,6 +51,9 @@ class CustomDataset:
|
||||
audio = row["audio"]
|
||||
if not os.path.isabs(audio):
|
||||
audio = os.path.join(self._base, audio)
|
||||
if not os.path.exists(audio):
|
||||
print(f"[custom] 跳过缺失音频:{audio}", file=sys.stderr)
|
||||
continue
|
||||
lang = row.get("lang") or _guess_lang(text)
|
||||
n += 1
|
||||
yield Sample(
|
||||
|
||||
Reference in New Issue
Block a user