From 3ca3fed561c20f60d3e4594ccc874c3af87dc4e8 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Thu, 8 Oct 2026 15:58:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20WO09=20stage=200=20=E2=80=94=20FLEURS?= =?UTF-8?q?=20he=5Fil=20audio=20sample=20fetch=20(CC-BY-4.0)=20to=20unbloc?= =?UTF-8?q?k=20the=20parked=20probe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fetch_hebrew_audio_hf.py | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 fetch_hebrew_audio_hf.py diff --git a/fetch_hebrew_audio_hf.py b/fetch_hebrew_audio_hf.py new file mode 100644 index 0000000..1c6e22d --- /dev/null +++ b/fetch_hebrew_audio_hf.py @@ -0,0 +1,47 @@ +# /// script +# requires-python = ">=3.11" +# dependencies = [ +# "datasets>=3.0", +# "soundfile>=0.12", +# "numpy<2", +# ] +# /// +"""WO09 un-park, stage 0: fetch a small Hebrew audio sample. + +FLEURS he_il (CC-BY-4.0, Google/CMU/Microsoft), train split, streamed — +20 clips saved as wav into the bucket for the WO09 probe. The probe +itself still fetches nothing (WO09 contract). +""" + +from __future__ import annotations + +from pathlib import Path + +import soundfile as sf + +OUT = Path("/ckpt/audio-sample") +N = 20 + + +def main() -> None: + OUT.mkdir(parents=True, exist_ok=True) + from datasets import load_dataset + + ds = load_dataset("google/fleurs", "he_il", split="train", streaming=True) + saved = 0 + for row in ds: + if saved >= N: + break + audio = row["audio"] + if len(audio["array"]) < 16000: # skip <1s clips + continue + p = OUT / f"fleurs-he-{saved:03d}.wav" + sf.write(str(p), audio["array"], audio["sampling_rate"]) + saved += 1 + if saved % 5 == 0: + print(f"[fetch] {saved}/{N}", flush=True) + print(f"[done] {saved} clips -> {OUT}", flush=True) + + +if __name__ == "__main__": + main()