Spaces:
Running
Running
Keep the public leaderboard suite and show the completed H200 results
Browse files- README.md +1 -1
- evaluate.py +9 -16
- public/index.html +3 -1
- run_eval.py +8 -15
- suite.json +2 -9
README.md
CHANGED
|
@@ -16,4 +16,4 @@ The evaluator reports mean WER by giving each dataset equal weight. RTFx include
|
|
| 16 |
|
| 17 |
The Space provides the Docker image for the H200 benchmark job. Results are saved to the private bucket, and the app reads progress and the final summary from the configured run directory.
|
| 18 |
|
| 19 |
-
The
|
|
|
|
| 16 |
|
| 17 |
The Space provides the Docker image for the H200 benchmark job. Results are saved to the private bucket, and the app reads progress and the final summary from the configured run directory.
|
| 18 |
|
| 19 |
+
The optimized run uses packed Musci prefill and reuses CUDA allocations between calls. The dashboard shows VoiceCodeBench alongside the seven default public sets and the ten-set comparison.
|
evaluate.py
CHANGED
|
@@ -17,7 +17,7 @@ import subprocess
|
|
| 17 |
import sys
|
| 18 |
|
| 19 |
ROOT = Path(__file__).resolve().parent
|
| 20 |
-
|
| 21 |
|
| 22 |
|
| 23 |
def now():
|
|
@@ -48,12 +48,10 @@ def parse_args(argv=None):
|
|
| 48 |
parser.add_argument("--engine-cache", type=Path, default=Path("/tmp/kroko-engines"))
|
| 49 |
parser.add_argument("--dry-run", action="store_true")
|
| 50 |
args = parser.parse_args(argv)
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
parser.error(f"{variable} must be 0 or 1")
|
| 56 |
-
setattr(args, f"include_{option}", args.mode == "full" and enabled == "1")
|
| 57 |
if not re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9_.-]*/[A-Za-z0-9][A-Za-z0-9_.-]*", args.model_id):
|
| 58 |
parser.error("--model-id must be owner/repository")
|
| 59 |
if not re.fullmatch(r"[0-9a-f]{40}", args.model_revision):
|
|
@@ -89,12 +87,9 @@ def build_plan(args):
|
|
| 89 |
rows = suite["datasets"]
|
| 90 |
if args.mode == "smoke":
|
| 91 |
rows = [row for row in rows if row["id"] == "librispeech_clean"]
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
extra = [row for name, row in optional.items() if name != "voice_code_bench"
|
| 96 |
-
and getattr(args, "include_extra_public", False)]
|
| 97 |
-
rows = [rows[0], *voice, *rows[1:], *extra]
|
| 98 |
plan = []
|
| 99 |
for row in rows:
|
| 100 |
command = [sys.executable, str(ROOT / "run_eval.py"),
|
|
@@ -113,8 +108,6 @@ def build_plan(args):
|
|
| 113 |
"--dataset-path", row["repo"], "--dataset", row["config"],
|
| 114 |
"--dataset-revision", suite["dataset_revisions"][row["repo"]],
|
| 115 |
"--split", row["split"], "--max-eval-samples", "3" if args.mode == "smoke" else "-1"]
|
| 116 |
-
if row.get("chunk_long_audio"):
|
| 117 |
-
command.append("--chunk-long-audio")
|
| 118 |
plan.append({"dataset": row, "command": command, "cwd": str(args.output_dir / row["id"])})
|
| 119 |
return plan
|
| 120 |
|
|
@@ -248,7 +241,7 @@ def execute(args, *, release_check=None, run_command=None, score=None):
|
|
| 248 |
"beam": args.beam,
|
| 249 |
"notes": f"RNN-T beam {args.beam}. This explicitly defined public-suite mean is not the live leaderboard default aggregate."}
|
| 250 |
if args.mode == "full":
|
| 251 |
-
default_public = [row for row in historical if row["id"] not in
|
| 252 |
if len(default_public) != 7:
|
| 253 |
raise ValueError("Expected seven default public Open ASR splits")
|
| 254 |
summary["open_asr_public"] = {
|
|
|
|
| 17 |
import sys
|
| 18 |
|
| 19 |
ROOT = Path(__file__).resolve().parent
|
| 20 |
+
NONDEFAULT_PUBLIC = {"librispeech_clean", "librispeech_other", "urgent2024_clean"}
|
| 21 |
|
| 22 |
|
| 23 |
def now():
|
|
|
|
| 48 |
parser.add_argument("--engine-cache", type=Path, default=Path("/tmp/kroko-engines"))
|
| 49 |
parser.add_argument("--dry-run", action="store_true")
|
| 50 |
args = parser.parse_args(argv)
|
| 51 |
+
include_voicecode = os.environ.get("KM_INCLUDE_VOICECODE", "0")
|
| 52 |
+
if include_voicecode not in ("0", "1"):
|
| 53 |
+
parser.error("KM_INCLUDE_VOICECODE must be 0 or 1")
|
| 54 |
+
args.include_voicecode = args.mode == "full" and include_voicecode == "1"
|
|
|
|
|
|
|
| 55 |
if not re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9_.-]*/[A-Za-z0-9][A-Za-z0-9_.-]*", args.model_id):
|
| 56 |
parser.error("--model-id must be owner/repository")
|
| 57 |
if not re.fullmatch(r"[0-9a-f]{40}", args.model_revision):
|
|
|
|
| 87 |
rows = suite["datasets"]
|
| 88 |
if args.mode == "smoke":
|
| 89 |
rows = [row for row in rows if row["id"] == "librispeech_clean"]
|
| 90 |
+
elif getattr(args, "include_voicecode", False):
|
| 91 |
+
voicecode, = [row for row in suite["optional_datasets"] if row["id"] == "voice_code_bench"]
|
| 92 |
+
rows = [rows[0], voicecode, *rows[1:]]
|
|
|
|
|
|
|
|
|
|
| 93 |
plan = []
|
| 94 |
for row in rows:
|
| 95 |
command = [sys.executable, str(ROOT / "run_eval.py"),
|
|
|
|
| 108 |
"--dataset-path", row["repo"], "--dataset", row["config"],
|
| 109 |
"--dataset-revision", suite["dataset_revisions"][row["repo"]],
|
| 110 |
"--split", row["split"], "--max-eval-samples", "3" if args.mode == "smoke" else "-1"]
|
|
|
|
|
|
|
| 111 |
plan.append({"dataset": row, "command": command, "cwd": str(args.output_dir / row["id"])})
|
| 112 |
return plan
|
| 113 |
|
|
|
|
| 241 |
"beam": args.beam,
|
| 242 |
"notes": f"RNN-T beam {args.beam}. This explicitly defined public-suite mean is not the live leaderboard default aggregate."}
|
| 243 |
if args.mode == "full":
|
| 244 |
+
default_public = [row for row in historical if row["id"] not in NONDEFAULT_PUBLIC]
|
| 245 |
if len(default_public) != 7:
|
| 246 |
raise ValueError("Expected seven default public Open ASR splits")
|
| 247 |
summary["open_asr_public"] = {
|
public/index.html
CHANGED
|
@@ -56,8 +56,10 @@
|
|
| 56 |
const {default_seven: seven, all_ten: ten} = summary.open_asr_public;
|
| 57 |
const format = ({macro_WER_percent, pooled_RTFx}) =>
|
| 58 |
`${macro_WER_percent.toFixed(2)}% mean WER · ${pooled_RTFx.toFixed(2)}× RTFx`;
|
|
|
|
|
|
|
| 59 |
document.getElementById("averages").textContent =
|
| 60 |
-
`Seven default public sets — ${format(seven)}.
|
| 61 |
document.getElementById("datasets").replaceChildren(...summary.datasets.map(dataset => {
|
| 62 |
const row = document.createElement("tr");
|
| 63 |
for (const value of [dataset.id, `${Number(dataset.WER_percent).toFixed(2)}%`,
|
|
|
|
| 56 |
const {default_seven: seven, all_ten: ten} = summary.open_asr_public;
|
| 57 |
const format = ({macro_WER_percent, pooled_RTFx}) =>
|
| 58 |
`${macro_WER_percent.toFixed(2)}% mean WER · ${pooled_RTFx.toFixed(2)}× RTFx`;
|
| 59 |
+
const entityMatch = summary.voice_code_bench?.entity_match_percent;
|
| 60 |
+
const voice = entityMatch === undefined ? "" : ` VoiceCodeBench Entity Match — ${entityMatch.toFixed(2)}%.`;
|
| 61 |
document.getElementById("averages").textContent =
|
| 62 |
+
`Seven default public sets — ${format(seven)}. Ten-set comparison — ${format(ten)}.${voice}`;
|
| 63 |
document.getElementById("datasets").replaceChildren(...summary.datasets.map(dataset => {
|
| 64 |
const row = document.createElement("tr");
|
| 65 |
for (const value of [dataset.id, `${Number(dataset.WER_percent).toFixed(2)}%`,
|
run_eval.py
CHANGED
|
@@ -204,8 +204,6 @@ def parse_args() -> Namespace:
|
|
| 204 |
default=-1,
|
| 205 |
help="Smoke-test limit after reference filtering; -1 evaluates the full split.",
|
| 206 |
)
|
| 207 |
-
parser.add_argument("--chunk-long-audio", action="store_true",
|
| 208 |
-
help="Split recordings above the export profile when running a supplemental dataset.")
|
| 209 |
parser.add_argument(
|
| 210 |
"--warmup-steps",
|
| 211 |
type=int,
|
|
@@ -242,7 +240,7 @@ def parse_args() -> Namespace:
|
|
| 242 |
def inspect_audio(
|
| 243 |
audio: dict[str, str | bytes | None],
|
| 244 |
utterance_id: str,
|
| 245 |
-
max_samples: int
|
| 246 |
model_family: str,
|
| 247 |
) -> dict[str, int | dict[str, int | np.typing.NDArray[np.float32]]]:
|
| 248 |
"""Decode, downmix, validate, and resample a clip before batching.
|
|
@@ -308,7 +306,7 @@ def inspect_audio(
|
|
| 308 |
waveform, SAMPLE_RATE // divisor, sampling_rate // divisor
|
| 309 |
).astype(np.float32)
|
| 310 |
|
| 311 |
-
if
|
| 312 |
raise ValueError(
|
| 313 |
f"{utterance_id}: {waveform.size / SAMPLE_RATE:.3f}s exceeds the export profile; "
|
| 314 |
"increase --max-audio-seconds for the whole run."
|
|
@@ -388,22 +386,21 @@ def export_bundle(
|
|
| 388 |
class ChunkedASR:
|
| 389 |
"""Return one raw transcription per original recording, preserving piece order."""
|
| 390 |
|
| 391 |
-
def __init__(self, backend, batch_size, chunk_samples
|
| 392 |
self.backend = backend
|
| 393 |
self.stream = backend.stream
|
| 394 |
self.batch_size = batch_size
|
| 395 |
self.chunk_samples = chunk_samples
|
| 396 |
-
self.split_above_samples = split_above_samples
|
| 397 |
|
| 398 |
def __call__(self, audios):
|
| 399 |
-
if all(audio.size <= self.
|
| 400 |
return self.backend(audios)
|
| 401 |
|
| 402 |
# Open ASR's Kroko VoiceCodeBench protocol uses the fewest equal,
|
| 403 |
# contiguous nonoverlapping pieces of at most 30 seconds.
|
| 404 |
pieces, owners = [], []
|
| 405 |
for owner, audio in enumerate(audios):
|
| 406 |
-
count = -(-audio.size // self.chunk_samples)
|
| 407 |
pieces.extend(np.array_split(audio, count))
|
| 408 |
owners.extend([owner] * count)
|
| 409 |
joined = [[] for _ in audios]
|
|
@@ -595,8 +592,6 @@ def main() -> None:
|
|
| 595 |
max_samples = round(args.max_audio_seconds * SAMPLE_RATE)
|
| 596 |
if is_voicecode:
|
| 597 |
max_samples = voice_code_data.MAX_RECORDING_SECONDS * SAMPLE_RATE
|
| 598 |
-
elif args.chunk_long_audio:
|
| 599 |
-
max_samples = None
|
| 600 |
dataset = dataset.map(
|
| 601 |
inspect_audio,
|
| 602 |
input_columns=["audio", "utterance_id"],
|
|
@@ -633,10 +628,9 @@ def main() -> None:
|
|
| 633 |
|
| 634 |
workers = min(args.workers, (len(dataset) + args.batch_size - 1) // args.batch_size)
|
| 635 |
backends = [ASR(bundle, device_id=args.device) for _ in range(workers)]
|
| 636 |
-
if is_voicecode
|
| 637 |
chunk_samples = round(min(args.max_audio_seconds, voice_code_data.MAX_CHUNK_SECONDS) * SAMPLE_RATE)
|
| 638 |
-
|
| 639 |
-
backends = [ChunkedASR(backend, args.batch_size, chunk_samples, split_above) for backend in backends]
|
| 640 |
|
| 641 |
results = benchmark(
|
| 642 |
dataset, backends, args.batch_size, args.warmup_steps,
|
|
@@ -684,11 +678,10 @@ def main() -> None:
|
|
| 684 |
"including text and word timestamps"
|
| 685 |
),
|
| 686 |
}
|
| 687 |
-
if is_voicecode
|
| 688 |
metadata["recording_chunking"] = {
|
| 689 |
"method": "fewest equal, contiguous nonoverlapping pieces",
|
| 690 |
"maximum_chunk_seconds": chunk_samples / SAMPLE_RATE,
|
| 691 |
-
"split_if_longer_than_seconds": split_above / SAMPLE_RATE,
|
| 692 |
}
|
| 693 |
with open(manifest.with_suffix(".metadata.json"), "w", encoding="utf-8") as destination:
|
| 694 |
json.dump(metadata, destination, indent=2, sort_keys=True)
|
|
|
|
| 204 |
default=-1,
|
| 205 |
help="Smoke-test limit after reference filtering; -1 evaluates the full split.",
|
| 206 |
)
|
|
|
|
|
|
|
| 207 |
parser.add_argument(
|
| 208 |
"--warmup-steps",
|
| 209 |
type=int,
|
|
|
|
| 240 |
def inspect_audio(
|
| 241 |
audio: dict[str, str | bytes | None],
|
| 242 |
utterance_id: str,
|
| 243 |
+
max_samples: int,
|
| 244 |
model_family: str,
|
| 245 |
) -> dict[str, int | dict[str, int | np.typing.NDArray[np.float32]]]:
|
| 246 |
"""Decode, downmix, validate, and resample a clip before batching.
|
|
|
|
| 306 |
waveform, SAMPLE_RATE // divisor, sampling_rate // divisor
|
| 307 |
).astype(np.float32)
|
| 308 |
|
| 309 |
+
if waveform.size > max_samples:
|
| 310 |
raise ValueError(
|
| 311 |
f"{utterance_id}: {waveform.size / SAMPLE_RATE:.3f}s exceeds the export profile; "
|
| 312 |
"increase --max-audio-seconds for the whole run."
|
|
|
|
| 386 |
class ChunkedASR:
|
| 387 |
"""Return one raw transcription per original recording, preserving piece order."""
|
| 388 |
|
| 389 |
+
def __init__(self, backend, batch_size, chunk_samples):
|
| 390 |
self.backend = backend
|
| 391 |
self.stream = backend.stream
|
| 392 |
self.batch_size = batch_size
|
| 393 |
self.chunk_samples = chunk_samples
|
|
|
|
| 394 |
|
| 395 |
def __call__(self, audios):
|
| 396 |
+
if all(audio.size <= self.chunk_samples for audio in audios):
|
| 397 |
return self.backend(audios)
|
| 398 |
|
| 399 |
# Open ASR's Kroko VoiceCodeBench protocol uses the fewest equal,
|
| 400 |
# contiguous nonoverlapping pieces of at most 30 seconds.
|
| 401 |
pieces, owners = [], []
|
| 402 |
for owner, audio in enumerate(audios):
|
| 403 |
+
count = -(-audio.size // self.chunk_samples)
|
| 404 |
pieces.extend(np.array_split(audio, count))
|
| 405 |
owners.extend([owner] * count)
|
| 406 |
joined = [[] for _ in audios]
|
|
|
|
| 592 |
max_samples = round(args.max_audio_seconds * SAMPLE_RATE)
|
| 593 |
if is_voicecode:
|
| 594 |
max_samples = voice_code_data.MAX_RECORDING_SECONDS * SAMPLE_RATE
|
|
|
|
|
|
|
| 595 |
dataset = dataset.map(
|
| 596 |
inspect_audio,
|
| 597 |
input_columns=["audio", "utterance_id"],
|
|
|
|
| 628 |
|
| 629 |
workers = min(args.workers, (len(dataset) + args.batch_size - 1) // args.batch_size)
|
| 630 |
backends = [ASR(bundle, device_id=args.device) for _ in range(workers)]
|
| 631 |
+
if is_voicecode:
|
| 632 |
chunk_samples = round(min(args.max_audio_seconds, voice_code_data.MAX_CHUNK_SECONDS) * SAMPLE_RATE)
|
| 633 |
+
backends = [ChunkedASR(backend, args.batch_size, chunk_samples) for backend in backends]
|
|
|
|
| 634 |
|
| 635 |
results = benchmark(
|
| 636 |
dataset, backends, args.batch_size, args.warmup_steps,
|
|
|
|
| 678 |
"including text and word timestamps"
|
| 679 |
),
|
| 680 |
}
|
| 681 |
+
if is_voicecode:
|
| 682 |
metadata["recording_chunking"] = {
|
| 683 |
"method": "fewest equal, contiguous nonoverlapping pieces",
|
| 684 |
"maximum_chunk_seconds": chunk_samples / SAMPLE_RATE,
|
|
|
|
| 685 |
}
|
| 686 |
with open(manifest.with_suffix(".metadata.json"), "w", encoding="utf-8") as destination:
|
| 687 |
json.dump(metadata, destination, indent=2, sort_keys=True)
|
suite.json
CHANGED
|
@@ -6,8 +6,7 @@
|
|
| 6 |
"ArtificialAnalysis/Earnings22-Cleaned-AA-chunked": "27f7d0056d593231974a752ce03c1e965da69b3f",
|
| 7 |
"ArtificialAnalysis/Earnings22-Cleaned-AA": "5999936ee3d8d3cde160e3c65a8cc6ff5b7c5276",
|
| 8 |
"VoiceArena/Monsoon_en_IN_test": "bc1da7b42ef6e2853123c97bf6d22067e4802d11",
|
| 9 |
-
"besimple-ai/voice-code-bench": "bef2824f83ef1c796f3e79731a3b0741708730df"
|
| 10 |
-
"huggingworld/open-asr-leaderboard": "f8354547536e59f8410d896e51fa636b4942a2d1"
|
| 11 |
},
|
| 12 |
"datasets": [
|
| 13 |
{"id": "ami", "repo": "hf-audio/open-asr-leaderboard", "config": "ami_cleaned", "split": "test"},
|
|
@@ -22,12 +21,6 @@
|
|
| 22 |
{"id": "monsoon", "repo": "VoiceArena/Monsoon_en_IN_test", "config": "", "split": "test"}
|
| 23 |
],
|
| 24 |
"optional_datasets": [
|
| 25 |
-
{"id": "voice_code_bench", "repo": "besimple-ai/voice-code-bench", "config": "default", "split": "test"}
|
| 26 |
-
{"id": "common_voice", "repo": "hf-audio/open-asr-leaderboard", "config": "common_voice", "split": "test", "chunk_long_audio": true},
|
| 27 |
-
{"id": "tedlium", "repo": "huggingworld/open-asr-leaderboard", "config": "tedlium", "split": "test", "chunk_long_audio": true},
|
| 28 |
-
{"id": "ami_original", "repo": "hf-audio/open-asr-leaderboard", "config": "ami", "split": "test"},
|
| 29 |
-
{"id": "gigaspeech_original", "repo": "hf-audio/open-asr-leaderboard", "config": "gigaspeech", "split": "test"},
|
| 30 |
-
{"id": "voxpopuli_original", "repo": "hf-audio/open-asr-leaderboard", "config": "voxpopuli", "split": "test", "chunk_long_audio": true},
|
| 31 |
-
{"id": "earnings22_original", "repo": "hf-audio/open-asr-leaderboard", "config": "earnings22", "split": "test"}
|
| 32 |
]
|
| 33 |
}
|
|
|
|
| 6 |
"ArtificialAnalysis/Earnings22-Cleaned-AA-chunked": "27f7d0056d593231974a752ce03c1e965da69b3f",
|
| 7 |
"ArtificialAnalysis/Earnings22-Cleaned-AA": "5999936ee3d8d3cde160e3c65a8cc6ff5b7c5276",
|
| 8 |
"VoiceArena/Monsoon_en_IN_test": "bc1da7b42ef6e2853123c97bf6d22067e4802d11",
|
| 9 |
+
"besimple-ai/voice-code-bench": "bef2824f83ef1c796f3e79731a3b0741708730df"
|
|
|
|
| 10 |
},
|
| 11 |
"datasets": [
|
| 12 |
{"id": "ami", "repo": "hf-audio/open-asr-leaderboard", "config": "ami_cleaned", "split": "test"},
|
|
|
|
| 21 |
{"id": "monsoon", "repo": "VoiceArena/Monsoon_en_IN_test", "config": "", "split": "test"}
|
| 22 |
],
|
| 23 |
"optional_datasets": [
|
| 24 |
+
{"id": "voice_code_bench", "repo": "besimple-ai/voice-code-bench", "config": "default", "split": "test"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
]
|
| 26 |
}
|