Commit e07cc52
committed
Add LibriBrain100 — unified loader for LibriBrain + LibriBrain2
LibriBrain100 is the user-facing dataset for the full LibriBrain
release: a virtual union of pnpl/LibriBrain (sub-0 × Sherlock1..7) and
pnpl/LibriBrain2 (sub-0 × Sherlock8/Sherlock9/TIMIT/MOCHATIMIT/
Podcasts, plus sub-1..32 × Sherlock1 ses-11/ses-12). Manifest-driven,
keeps the existing task-based API, adds two selectors:
- subjects= "all"|"deep"|"new"|0|"sub-0"|[1,2,3]|range(1, 33)
- corpus= "all"|"sherlock"|"timit"|"mocha"|"podcasts"|[...]
Implementation notes:
- manifest.py declares one RunRecord per (subject, session, task,
run) tuple expected by the paper, tagging each with corpus, repo,
and partition. Records the upload hasn't reached yet are tolerated
at runtime — the loader skips missing H5s with a single grouped
warning, so the API is usable while LibriBrain2 fills in.
- selectors.py validates obvious dead-end combinations up front
(e.g. subjects='new' has only Sherlock data and only val/test by
design — the paper assigns no train partition to broad subjects).
- base.py overrides _schedule_download to pick the per-record
primary HF repo, so most fetches hit on the first try; the
inherited HFDownloadMixin retry chain falls back to the other
repo. Catches huggingface_hub.errors.{Entry,Repository}NotFound
in addition to FileNotFoundError so missing-but-coming records
don't crash through the download stack.
- LibriBrain100 + LibriBrain100Speech/Phoneme/Word wrappers are
exposed at pnpl.datasets; existing LibriBrain* classes
are unchanged.
Tests:
- 25 rudimentary tests in tests/test_libribrain100.py (selector
normalization + manifest invariants + validation rules + the
download-disabled error path).
- A comprehensive on-VM suite at /workspace/libribrain100-tests/
(60 tests, including live HF tree fingerprints, multi-repo
download, full-DataLoader walks) — not in this repo.
Verified end-to-end on the validation VM: Sherlock1 ses-11 download +
sample materialization, MOCHATIMIT ses-1 download (different repo),
graceful skip when a corpus is not yet uploaded.1 parent 4d4f650 commit e07cc52
10 files changed
Lines changed: 2019 additions & 1 deletion
File tree
- pnpl/datasets
- libribrain100
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
0 commit comments