[Bugfix] Re-enable benchmarking of librispeech dataset. (#47033)

Signed-off-by: Anna Mayne <anna.mayne@arm.com>

almayne committed Jul 8, 2026 at 17:19 UTC d1f1d86797ad2f4cccfe441451ba320583c87cd2
2 files changed +18 -7
tests/benchmarks/test_audio_dataset.py
+9 -2
@@ -123,15 +123,22 @@ def test_asr_dataset_sample_handles_local_audio_paths(tmp_path: Path) -> None:
123 )
124
125
126 -def test_asr_dataset_sample_handles_embedded_audio_bytes(tmp_path: Path) -> None:
126 +@pytest.mark.parametrize("has_filepath", [True, False])
127 +def test_asr_dataset_sample_handles_embedded_audio_bytes(
128 + tmp_path: Path, has_filepath: bool
129 +) -> None:
130 audio_path = tmp_path / "earnings.wav"
131 _write_wav(audio_path, duration_s=0.1)
132
133 + test_path = None
134 + if has_filepath:
135 + test_path = audio_path
136 +
137 dataset = object.__new__(datasets_module.ASRDataset)
138 dataset.data = [
139 {
140 "audio": {
134 - "path": None,
141 + "path": test_path,
142 "bytes": audio_path.read_bytes(),
143 },
144 "text": "quarterly earnings call",
vllm/benchmarks/datasets/datasets.py
+9 -5
@@ -4090,9 +4090,10 @@ class ASRDataset(HuggingFaceDataset):
4090 EARNINGS22_TINY_FILTERED_DATASET = (
4091 "D4nt3/esb-datasets-earnings22-validation-tiny-filtered"
4092 )
4093 + LIBRISPEECH_DATASET = "openslr/librispeech_asr"
4094
4095 SUPPORTED_DATASET_PATHS = {
4095 - "openslr/librispeech_asr",
4096 + LIBRISPEECH_DATASET,
4097 "facebook/voxpopuli",
4098 "LIUM/tedlium",
4099 "edinburghcstr/ami",
@@ -4120,7 +4121,10 @@ class ASRDataset(HuggingFaceDataset):
4121 self.data = self.data.shuffle(seed=self.random_seed)
4122 self._materialize_local_audio_column()
4123 return
4123 - if self.hf_name == self.EARNINGS22_TINY_FILTERED_DATASET:
4124 + if self.hf_name in (
4125 + self.EARNINGS22_TINY_FILTERED_DATASET,
4126 + self.LIBRISPEECH_DATASET,
4127 + ):
4128 super().load_data()
4129 self._disable_audio_decode()
4130 return
@@ -4199,14 +4203,14 @@ class ASRDataset(HuggingFaceDataset):
4203 elif isinstance(audio, str):
4204 duration_s = sf.info(audio).duration
4205 mm_content = {"audio_path": audio}
4202 - elif isinstance(audio, dict) and audio.get("path"):
4203 - duration_s = sf.info(audio["path"]).duration
4204 - mm_content = {"audio_path": audio["path"]}
4206 elif isinstance(audio, dict) and audio.get("bytes") is not None:
4207 with BytesIO(audio["bytes"]) as audio_buffer:
4208 y, sr = sf.read(audio_buffer, dtype="float32")
4209 duration_s = get_audio_duration(y=y, sr=sr)
4210 mm_content = {"audio": (y, sr)}
4211 + elif isinstance(audio, dict) and audio.get("path"):
4212 + duration_s = sf.info(audio["path"]).duration
4213 + mm_content = {"audio_path": audio["path"]}
4214 else:
4215 raise ValueError(
4216 "ASR samples must provide decoded audio arrays, "