Skip to content

Commit 88c2753

Browse files
authored
Merge branch 'main' into features/reenable-preprocess
2 parents 9eda590 + ce0ae7b commit 88c2753

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/guidellm/extras/audio.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ def _decode_audio( # noqa: C901, PLR0912
107107
raise ValueError(
108108
f"Audio dict must contain either 'data' or 'url' keys, got {audio}"
109109
)
110+
audio_data = audio["data"] if "data" in audio else audio.get("url")
111+
if audio_data is None:
112+
raise ValueError(
113+
f"Audio dict must contain either 'data' or 'url' keys, got {audio}"
114+
)
110115
return _decode_audio(
111-
audio=audio.get("data") or audio.get("url"),
116+
audio=audio_data,
112117
sample_rate=sample_rate,
113118
max_duration=max_duration,
114119
)

0 commit comments

Comments
 (0)