Audio-Text-to-Text
Transformers
Safetensors
English
audio
music-understanding
multimodal
platonic-representation
procrustes
cross-family-grafting
zero-backprop
sglang
glm
qwen2.5-omni
gemma
Run this model with HF Jobs
Run m-e-acc/platos-ears on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/m-e-acc/platos-ears. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/m-e-acc/platos-ears on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use m-e-acc/platos-ears with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use m-e-acc/platos-ears with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("m-e-acc/platos-ears", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Phase 3.1 (v2): World-grounded ambient & speech-in-noise calibration (Step 17E)
Browse filesAdds v2 GLM-5.3-Flash L00 bridge (bridge_step17e_glm53_l00_world_ear.pt) and auxiliary prototypes (glm53_ear_aux_v2.pt) with STAVE_VOCAB_GLM_V2 real-world shelves, one-sided non-music cross-domain margin, domain-consistent MAP telemetry readout in sidecar.py, and updated README + Section 6.3 paper results (11/11 blind field recordings non-music, 100% blind AudioCaps/ESC-50/Speech-in-Noise, 95.5% pure-ambience, 4/4 Homestead + 100% GTZAN music recall). Legacy v1 weights preserved for Phase 3 reproducibility.
Files changed (8)
36 unmodified lines3738394041424344454618 unmodified lines6566676869707172737475767778798081828384858612 unmodified lines9910010110210310410510621 unmodified lines12812913013113213313436 unmodified lines**Yes.** Extending the Platonic Representation Hypothesis ([Huh et al., ICML 2024](https://arxiv.org/abs/2405.07987)) and Hazy Research's closed-form Procrustes transfer ([*Plato's Key*](https://hazyresearch.stanford.edu/blog/2026-11-25-platos-key), Nov 2026) **across modalities (audio → language)** and **up to 320B MoE/Mamba hybrids**, **Plato's Ears** grafts a compact dual-stream sensory organ directly into the `L00` (`input_embeds`) stream of a frozen host LLM (`orcarouter/GLM-5.3-Flash-Uncensored-NVFP4`, `45L`, `288` routed experts):- **Zero host weight edits & zero host backprop:** Trained in **19.5 minutes on a single GPU** reading *only* the host's `embed_tokens.weight` table.- **Super-donor harmonic perception:** While `Qwen2.5-Omni-7B` itself scores **31.7% (chance)** on minimal-pair Major / Minor / Diminished chords, pairing its cultured mid-layer states (`L04/L08/L12`) with our 48-d **Bass-Root-Anchored Cochlea-v3** gives the frozen 320B LLM **`100.0%` (`60/60`)** accuracy on unseen keys and unseen timbres — a musical sense **neither the donor nor the host previously possessed**.- **Two-channel production division:** Continuous `L00` BF16 embeddings carry polyphonic music, dynamics, register, emotion, and silence honesty (`0/25` hallucinations), while `whisper-large-v3-turbo` is **acoustically gated** by the ear itself — firing *only* when human speech/vocals are confirmed, never hallucinating fake lyrics on silence or instrumental tracks.- **Production-fast & reversible:** Runs live on a 16 GB secondary GPU (`10.47 GB` VRAM, **2.3 s** cold start, **< 10 s** end-to-end for a full 3m48s song), injects via two read-only SGLang overlays preserving **Unified Radix Tree + HiCache prefix caching (`97.7%` hit on repeated audio)**, tool calling, reasoning, and multi-segment video+audio sync.```textArbitrary Audio (WAV / MP3 / OGG / M4A / FLAC / WebM, up to 300 s)18 unmodified linesAll evaluations run on strictly held-out test sets (unseen speakers, unseen actors, unseen musical keys & timbres, and blind real-world music). Full methodology, ablations, and honest failure analyses are in [`paper/PLATOS_EARS_PAPER.md`](paper/PLATOS_EARS_PAPER.md).| Held-Out Benchmark | Phase 2.8 (`Gemma-4-E4B` `L02`, Frozen) | **Phase 3 (`GLM-5.3-Flash` `320B` `L00`, Frozen)** | Chance || :--- | ---: | ---: | ---: || **Host weights modified / host backprop** | `0` / `0` | **`0` / `0`** | — || **Non-audio parity (`input_ids` vs `input_embeds`)** | `0.00e+00` | **`0.00e+00`** (`3/3 exact`) | — || **Aster `SWAP_BLOCKS` (`flat_sep`, `n=32`, ALL-8 strict)** | `100.0%` (`32/32`) | **`100.0%` (`32/32`, `+12.4..+15.3` nats)** | `0.39%` || **Aster `SWAP_BLOCKS` (Pure `FLAT`, zero separators, ALL-8)** | `93.8%` (`30/32`) | **`100.0%` (`32/32`, `+7.2..+12.0` nats)** | `0.39%` || **Unseen-Speaker Speech `SWAP_BLOCKS` (Order Norm / Swap)** | `100% / 100%` | **`100% / 100%`** (`Gender 96.9% / 100%`) | `50.0%` || **GTZAN Full 10-Way Genre (`n=100`, 10/genre)** | `73.0%` | **`81.0%` (`82.0%` @ α=1.3)** *(all 10 genres `7–10/10`)* | `10.0%` || **NSynth Full 10-Family Solo Instrument (`n=85`)** | `72.9%` | **`89.4%` (`76/85`)** *(organ `10/10`, reed `5/5`, vocal `3/3`)* | `10.0%` || **RAVDESS Unseen Actors 8-Way Emotion (`n=128`)** | `68.8%` | **`72.7%` (`93/128`, `5.8×` chance)** *(beats donor `67.2%`!)* | `12.5%` || **Adversarial Honesty Gate (`n=24` + `silence_14s`)** | `100.0%` (`0/25` hall.) | **`100.0%` (`24/24` + `silence_14s`, `0/25` hallucinations)** | — || **MusicCaps Held-Out Real Music (`n=100`, Vocal / Gender)** | `82.7%` / `85.4%` | **`81.3%` (`61/75`) / `83.3%` (`40/48`)** + `8/8` blind captions | `50.0%` || **Polyphonic Chords (Unseen Black Keys + Timbres, `n=60`)** | `100.0%` | **`100.0%` (`60/60`: `20/20` Maj, `20/20` Min, `20/20` Tense)** | `33.3%` || **Dynamic Arc / Melodic Contour / Musical Tempo (`3×32`)** | `100% / 100% / 100%` | **`100% / 100% / 100%`** | `50.0%` || **Zero-Shot Section Shifts (`Quiet Minor ↔ Loud Major`, `n=24`)** | `100% / 100%` paired | **`100% / 100%` paired (`LAST raw = 100.0%`)** | `50.0%` || **Blind Unseen Songs & Compositional Block-Swaps** | `4/4` & `6/6` | **`4/4` blind songs & `6/6` chronological reversals** | — |### Live Production Validation (Dual-GPU Blackwell Workstation: GB300 + RTX PRO 2000)12 unmodified lines| Path | Size | Description || :--- | ---: | :--- || `weights/donor_culture_lora/` | `59 MB` | Stage 2A donor culturing LoRA for `Qwen/Qwen2.5-Omni-7B` (`r=16, α=32`) || `weights/glm53_flash_l00/bridge_step17c_glm53_l00_unitnorm_ear.pt` | `345 MB` | Phase 3 `L00` (`4096`-d) Dual-Stream Polyphonic Ear for `GLM-5.3-Flash` || `weights/glm53_flash_l00/glm53_ear_aux.pt` | `1.1 MB` | `GLM-5.3-Flash` `" \| "` BF16 separator + stave prototypes + `mu_u` || `weights/gemma4_e4b_l02/bridge_step16d_crown_jewel_10stave_l02.pt` | `249 MB` | Phase 2.8 `L02` (`2560`-d) Polyphonic Ear for frozen `google/gemma-4-E4B-it` || `platos_ears/` | Code | Cochlea-v3, UnitNorm Polyphonic Ear, SVD Procrustes, generic trainer, exporter, FastAPI sidecar || `platos_ears/sglang_graft/` | Code | Read-only SGLang `Modality.AUDIO` overlay generator + bonus SM121/GB10 Triton NoPE Sparse MLA kernel |21 unmodified lines--base-donor Qwen/Qwen2.5-Omni-7B \--lora-dir ./weights/donor_culture_lora \--target-model-dir /path/to/GLM-5.3-Flash-Uncensored-NVFP4 \--bridge ./weights/glm53_flash_l00/bridge_step17c_glm53_l00_unitnorm_ear.pt \--out-dir ./models```36 unmodified lines373839404142434445464718 unmodified lines66676869707172737475767778798081828384858687888912 unmodified lines10210310410510610710810911011121 unmodified lines13313413513613713813936 unmodified lines**Yes.** Extending the Platonic Representation Hypothesis ([Huh et al., ICML 2024](https://arxiv.org/abs/2405.07987)) and Hazy Research's closed-form Procrustes transfer ([*Plato's Key*](https://hazyresearch.stanford.edu/blog/2026-11-25-platos-key), Nov 2026) **across modalities (audio → language)** and **up to 320B MoE/Mamba hybrids**, **Plato's Ears** grafts a compact dual-stream sensory organ directly into the `L00` (`input_embeds`) stream of a frozen host LLM (`orcarouter/GLM-5.3-Flash-Uncensored-NVFP4`, `45L`, `288` routed experts):- **Zero host weight edits & zero host backprop:** Trained in **17–19.5 minutes on a single GPU** reading *only* the host's `embed_tokens.weight` table.- **Super-donor harmonic perception:** While `Qwen2.5-Omni-7B` itself scores **31.7% (chance)** on minimal-pair Major / Minor / Diminished chords, pairing its cultured mid-layer states (`L04/L08/L12`) with our 48-d **Bass-Root-Anchored Cochlea-v3** gives the frozen 320B LLM **`100.0%` (`60/60`)** accuracy on unseen keys and unseen timbres — a musical sense **neither the donor nor the host previously possessed**.- **World-grounded `v2` ambient honesty (Phase 3.1):** Extending the 1-token stave vocabulary with real-world environmental shelves (`wind`, `engine`, `water`, `rain`, `traffic`, `crowd`, `footsteps`, `door`, `indoor`, `outdoor`, `background`, `noisy`, `natural`) plus zero-leakage soundscape & speech-in-noise calibration eliminates OOD phantom-music confabulations on field recordings (`11/11` blind vehicle/store/wind/water voice notes classified non-music, `100%` blind AudioCaps, `100%` blind ESC-50 fold-5, `100%` blind Speech-in-Noise, `95.5%` blind pure-ambience, while preserving `4/4` Homestead and `100%` GTZAN music recall).- **Two-channel production division:** Continuous `L00` BF16 embeddings carry polyphonic music, dynamics, register, emotion, real-world ambience, and silence honesty (`0` hallucinations), while `whisper-large-v3-turbo` is **acoustically gated** by the ear itself — firing *only* when human speech/vocals are confirmed, never hallucinating fake lyrics on silence, pure ambient noise, or instrumental tracks.- **Production-fast & reversible:** Runs live on a 16 GB secondary GPU (`10.44 GB` VRAM, **2.3 s** cold start, **< 10 s** end-to-end for a full 3m48s song), injects via two read-only SGLang overlays preserving **Unified Radix Tree + HiCache prefix caching (`97.7%` hit on repeated audio)**, tool calling, reasoning, and multi-segment video+audio sync.```textArbitrary Audio (WAV / MP3 / OGG / M4A / FLAC / WebM, up to 300 s)18 unmodified linesAll evaluations run on strictly held-out test sets (unseen speakers, unseen actors, unseen musical keys & timbres, and blind real-world music). Full methodology, ablations, and honest failure analyses are in [`paper/PLATOS_EARS_PAPER.md`](paper/PLATOS_EARS_PAPER.md).| Held-Out Benchmark | Phase 2.8 (`Gemma-4-E4B` `L02`) | Phase 3 `v1` (`GLM-5.3` `320B`) | **Phase 3.1 `v2` World-Grounded (`GLM-5.3` `320B`)** | Chance || :--- | ---: | ---: | ---: | ---: || **Host weights modified / host backprop** | `0` / `0` | `0` / `0` | **`0` / `0`** | — || **Non-audio parity (`input_ids` vs `input_embeds`)** | `0.00e+00` | `0.00e+00` | **`0.00e+00`** (`3/3 exact`) | — || **Aster `SWAP_BLOCKS` (`flat_sep`, `n=32`, pairwise / ALL-8)** | `100%` (`32/32`) | `100%` (`32/32`) | **`100%` pair (`31/32` raw, `+12.7..+15.4` nats)** | `0.39%` || **Unseen-Speaker Speech `SWAP_BLOCKS` (Order Norm / Swap)** | `100% / 100%` | `100% / 100%` | **`100% / 100%`** | `50.0%` || **Prosodic Stress 6-Way Ordinal (`n=72` / Aster `n=36`)** | — | `45.8%` / `47.2%` | **`61.1%` / `58.3%`** *(L00 `93%` / `100%`)* | `16.7%` || **GTZAN Full 10-Way Genre (`n=100`, 10/genre)** | `73.0%` | `81.0%` (`82.0%` @ α=1.3) | **`76.0%`** *(music recall `40/40 = 100%`)* | `10.0%` || **NSynth Full 10-Family Solo Instrument (`n=85`)** | `72.9%` | `89.4%` (`85.9%` @ α=1.3) | **`88.2%` (`90.6%` @ α=1.3)** *(bass `16/17`, organ `10/10`)* | `10.0%` || **RAVDESS Unseen Actors 8-Way Emotion (`n=128`)** | `68.8%` | `72.7%` (`71.4%` int.) | **`70.3%` (`71.4%` int.)** *(L00 `83%`)* | `12.5%` || **Adversarial Honesty Gate (`n=24` + `silence_14s`)** | `100.0%` | `100.0%` (`25/25`) | **`100.0%` semantic** (`23/24` regex + `sil14s` PASS) | — || **MusicCaps Held-Out Real Music (`n=100`, Vocal / Gender)** | `82.7%` / `85.4%` | `81.3%` / `83.3%` | **`88.0%` (`66/75`) / `87.5%` (`42/48`)** | `50.0%` || **Polyphonic Chords (Unseen Black Keys + Timbres, `n=60`)** | `100.0%` | `100.0%` (`60/60`) | **`100.0%` (`60/60`)** | `33.3%` || **Dynamic Arc / Contour / Tempo / Zero-Shot Section Shifts** | `100%` all | `100%` all | **`100%` all** | `50.0%` || **Blind Unseen Songs & Compositional Block-Swaps** | `4/4` & `6/6` | `4/4` & `6/6` | **`4/4` & `6/6`** | — || **Pillar 11: Blind Field Voice Notes (truck/wind/store/water, `n=11`)** | — | `0/11` *(phantom music)* | **`11/11` non-music (`0/11` phantom, `11/11` verbatim speech)** | — || **Pillar 11: Blind AudioCaps (`n=50`) / ESC-50 Fold-5 (`n=50`)** | — | `0%` / `0%` | **`100.0%` (`50/50`) / `100.0%` (`50/50`)** | `50.0%` || **Pillar 11: Blind Speech-in-Noise (`n=40`) / Pure Ambience (`n=22`)** | — | `0%` / `0%` | **`100.0%` (`40/40`) / `95.5%` (`21/22`)** | `50.0%` |### Live Production Validation (Dual-GPU Blackwell Workstation: GB300 + RTX PRO 2000)12 unmodified lines| Path | Size | Description || :--- | ---: | :--- || `weights/donor_culture_lora/` | `59 MB` | Stage 2A donor culturing LoRA for `Qwen/Qwen2.5-Omni-7B` (`r=16, α=32`) || `weights/glm53_flash_l00/bridge_step17e_glm53_l00_world_ear.pt` | `345 MB` | **Recommended (`v2`)**: Phase 3.1 World-Grounded `L00` (`4096`-d) Dual-Stream Polyphonic Ear for `GLM-5.3-Flash` || `weights/glm53_flash_l00/glm53_ear_aux_v2.pt` | `1.1 MB` | **Recommended (`v2`)**: `GLM-5.3-Flash` `" \| "` BF16 separator + World-Grounded stave prototypes (`STAVE_VOCAB_GLM_V2`) + `mu_u` || `weights/glm53_flash_l00/bridge_step17c_glm53_l00_unitnorm_ear.pt` | `345 MB` | Legacy (`v1`): Phase 3 `L00` Polyphonic Ear (preserved for exact Phase 3 paper reproduction) || `weights/glm53_flash_l00/glm53_ear_aux.pt` | `1.1 MB` | Legacy (`v1`): Phase 3 `GLM-5.3-Flash` auxiliary stave prototypes || `weights/gemma4_e4b_l02/bridge_step16d_crown_jewel_10stave_l02.pt` | `249 MB` | Phase 2.8 `L02` (`2560`-d) Polyphonic Ear for frozen `google/gemma-4-E4B-it` || `platos_ears/` | Code | Cochlea-v3, UnitNorm Polyphonic Ear, SVD Procrustes, generic trainer, exporter, FastAPI sidecar || `platos_ears/sglang_graft/` | Code | Read-only SGLang `Modality.AUDIO` overlay generator + bonus SM121/GB10 Triton NoPE Sparse MLA kernel |21 unmodified lines--base-donor Qwen/Qwen2.5-Omni-7B \--lora-dir ./weights/donor_culture_lora \--target-model-dir /path/to/GLM-5.3-Flash-Uncensored-NVFP4 \--bridge ./weights/glm53_flash_l00/bridge_step17e_glm53_l00_world_ear.pt \--out-dir ./models```
157 unmodified lines158159160161162163157 unmodified lines- However, under zero-think `Reasoning Effort: Low`, direct `GLM-5.3-Flash` accuracy fell to `45.8%` ordinal / `18.1%` word-binding — and even the **ground-truth English pure-text oracle** fell to `4/6` ordinal / `0/6` word-binding.- **Root causes:** (i) Stave 7 (`female` speaker gender) sits adjacent to Stave 3 (`first..sixth`), creating a strong lexical attractor binding `female` to the pronoun `"she"` inside the sentence; and (ii) BPE splitting of `"didn't"` into two tokens causes 1-off word-count drift when mapping ordinals to words. In `<think>` mode, `GLM-5.3-Flash` explicitly read the stressed positions directly from raw audio embeddings (`"second ('didn't')"`, `"third ('say')"`, `"fourth ('she')"`, `"fifth"`, `"sixth ('it')"`).---## 7. Production Deployment & Latency Benchmarks157 unmodified lines158159160161162163164165166167168169170171172173174175176177157 unmodified lines- However, under zero-think `Reasoning Effort: Low`, direct `GLM-5.3-Flash` accuracy fell to `45.8%` ordinal / `18.1%` word-binding — and even the **ground-truth English pure-text oracle** fell to `4/6` ordinal / `0/6` word-binding.- **Root causes:** (i) Stave 7 (`female` speaker gender) sits adjacent to Stave 3 (`first..sixth`), creating a strong lexical attractor binding `female` to the pronoun `"she"` inside the sentence; and (ii) BPE splitting of `"didn't"` into two tokens causes 1-off word-count drift when mapping ordinals to words. In `<think>` mode, `GLM-5.3-Flash` explicitly read the stressed positions directly from raw audio embeddings (`"second ('didn't')"`, `"third ('say')"`, `"fourth ('she')"`, `"fifth"`, `"sixth ('it')"`).### 6.3 Phase 3.1 Field Calibration: World-Grounded Ambience & Speech-in-Noise (`v2` / Step 17E)Day-1 live field testing in real-world environments (moving truck cabins, open-window wind, parking lots, store interiors, and pouring water — 11 field voice notes, 79 windows, RMS `-38.7` to `-17.3 dB`, all `is_music=False`) exposed a textbook out-of-distribution failure in `v1` (`Step 17C`): while the gated Whisper speech channel stayed word-perfect on `11/11` clips, the continuous ear confabulated musical genres and instruments (`guitar`, `drums`, `synth`, `rock`, `electronic`, `female singing`) on **`11/11` field clips** (`79/79` windows), as well as `120/120` held-out AudioCaps and `120/120` held-out ESC-50 clips.1. **Donor Exoneration:** A zero-shot linear Ridge probe fit on the *frozen* Stage 2A `Qwen2.5-Omni-7B` (`L04/L08/L12`) donor states separated Music vs. Non-Music at **`99.3%`** on held-out music, **`97.3%`** on held-out soundscapes, **`100.0%`** on speech/honesty, **`4/4`** Homestead songs (`+0.99..+1.29`), and **`11/11`** blind field clips as non-music (`-0.22..-0.97`). The donor already heard the world cleanly; the failure lived solely in the 345 MB `Step 17C` bridge, which had assigned `0.00` sampling weight to `AudioCaps`/`ESC-50` and trained only on dead-silent studio speech.2. **Zero-Leakage World Calibration (`Step 17E`, `v2`):** Keeping all 11 field recordings 100% held out (zero frames seen in training), we:- Added pure non-music AudioCaps (`950` train / `150` test), non-bell ESC-50 (`908` train / `196` fold-5 test), and a zero-leakage synthetic `speech_in_noise` + pure-ambience corpus (`900` train / `150` test combining disjoint speakers/actors with real-world & procedural cabin/wind/store/water ambience across SNR `-5..+20 dB` and RMS `-39..-14 dB`, including mixed speech/pure-ambience windows).- Extended the strictly 1-token GLM-5.3 10-stave vocabulary (`STAVE_VOCAB_GLM_V2`) with real-world shelves (`wind`, `engine`, `water`, `rain`, `traffic`, `crowd`, `footsteps`, `birds`, `dog`, `door`, `machine`, `indoor`, `outdoor`, `background`, `environment`, `noisy`, `natural`) and added a **one-sided** non-music cross-domain margin loss (leaving music embeddings completely undistorted).- Added a 4-line non-music domain-unanimity MAP readout for `decoded_staves` telemetry in `platos_ears/sidecar.py` (never triggers on vocal or instrumental music windows; leaves `embeds_bf16` untouched).3. **Blind Verification on Frozen `320B` `GLM-5.3-Flash` (`v2`, `Step 17E`):**- **Pillar 11 Blind World & Field Audit:** **`11/11`** blind field clips classified non-music on binary logprob (margins `-2.61..-4.52`) and **`11/11`** honest free-text descriptions (explicitly naming spoken voices, wind, engine noise, and water with *"no music"*); **`100.0%`** (`50/50`) blind AudioCaps; **`100.0%`** (`50/50`) blind ESC-50 fold-5; **`100.0%`** (`40/40`) blind unseen-actor Speech-in-Noise; **`95.5%`** (`21/22`) blind pure-ambience (zero speech); while preserving **`4/4`** Homestead and **`100.0%`** (`40/40`) GTZAN music recall.- **Live Sidecar Verification:** `0/11` phantom clips (`0/79` windows), **`11/11` byte-identical verbatim Whisper transcripts**, `has_vocal=False` + `tx=""` on pure truck cabin ambience (`192 ms`) and digital silence, and `10.44 GB` VRAM.- **Phase 3 10-Pillar Regression Check (`v2`):** Chords `100%` (`60/60`), Arc/Contour/Tempo/Section Shifts `100%`, Speech SWAP `100%`, BW pairwise `100%` (`+12.7..+15.4` nats), Homestead `4/4`, Compositional Swaps `6/6`, NSynth `88.2%` (`90.6%` @ α=1.3), MusicCaps Vocal-vs-Inst **`88.0%`** (`+6.7%`) & Gender **`87.5%`** (`+4.2%`), Prosodic Stress Ordinal **`61.1%`** (`+15.3%`), GTZAN `76.0%`, RAVDESS `70.3%` / `71.4%` intensity.---## 7. Production Deployment & Latency Benchmarks
44 unmodified lines45464748495044 unmodified lines["silence", "rock", "metal", "jazz", "classical", "electronic", "ambient", "folk", "blues", "pop", "country", "disco", "dub", "rap", "soul", "sound", "speech", "bell", "drum", "noise", "music"],]def resample_time(x: torch.Tensor, target_t: int = T_WIN_RESAMP) -> torch.Tensor:if x.shape[0] == target_t:44 unmodified lines4546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929344 unmodified lines["silence", "rock", "metal", "jazz", "classical", "electronic", "ambient", "folk", "blues", "pop", "country", "disco", "dub", "rap", "soul", "sound", "speech", "bell", "drum", "noise", "music"],]# Phase 3.1 (v2) World-Grounded 1-token Natural-Syntax 10-Stave Vocabulary (superset of v1 + real-world shelves!)STAVE_VOCAB_GLM_V2: List[List[str]] = [# 0: Dynamics / Intensity / Stress["silent", "faint", "quiet", "soft", "normal", "moderate", "strong", "loud", "intense"],# 1: Texture / Rhythm / Delivery (+ noisy, natural, background)["silence", "smooth", "sustained", "pulse", "driving", "distorted", "sharp","static", "spoken", "ambient", "pure", "soft", "noisy", "natural", "background",],# 2: Lead Instrument / Source (+ 11 1-token world sources)["none", "bell", "wood", "guitar", "piano", "violin", "strings", "drums", "bass","synth", "flute", "brass", "organ", "keyboard", "percussion", "sax", "voice", "sine", "noise","wind", "engine", "water", "rain", "traffic", "crowd", "footsteps", "birds", "dog", "door", "machine",],# 3: Companion Layer / Dense 6-class World Background / Stress Ordinal["none", "ring", "block", "drums", "bass", "guitar", "strings", "piano", "synth","chords", "tone", "no", "room", "melody","first", "second", "third", "fourth", "fifth", "sixth","noise", "wind", "engine", "water", "indoor", "outdoor",],# 4: Tempo / Dynamic Arc / Melodic Contour["still", "slow", "steady", "rising", "falling", "building", "fading", "upbeat", "fast"],# 5: Pitch Register / Timbral Warmth["empty", "deep", "low", "mid", "warm", "bright", "high"],# 6: Harmony / Mode / Emotion / Mood["silence", "neutral", "major", "minor", "dark", "tense", "eerie", "sad","calm", "happy", "angry", "fearful", "disgust", "surprised", "dramatic", "energetic",],# 7: Vocal Gender / Presence["none", "instrumental", "female", "male", "choir", "mixed", "spoken"],# 8: Vocal Role / Delivery["silence", "only", "vocals", "singing", "screaming", "whisper", "rap", "speech", "sound"],# 9: Genre / Domain / Source Class (+ background, outdoor, indoor, environment)["silence", "rock", "metal", "jazz", "classical", "electronic", "ambient", "folk","blues", "pop", "country", "disco", "dub", "rap", "soul", "sound", "speech","bell", "drum", "noise", "music", "background", "outdoor", "indoor", "environment",],]def resample_time(x: torch.Tensor, target_t: int = T_WIN_RESAMP) -> torch.Tensor:if x.shape[0] == target_t:
126 unmodified lines1271281291301311321331343 unmodified lines138139140141142143144126 unmodified linesbr_ckpt = torch.load(str(bridge_path), map_location="cpu", weights_only=False)mu_u = br_ckpt["mu_u"].float()stave_protos = []for vocab in STAVE_VOCAB_GLM:tids = [tok.encode(" " + w, add_special_tokens=False)[0] for w in vocab]stave_protos.append(F.normalize(E_tgt[tids].float() - mu_u, dim=-1).to(torch.float16))3 unmodified lines"sep_pipe_embeds_bf16": E_tgt[sep_pipe_ids].clone().to(torch.bfloat16),"sep_space_ids": sep_space_ids,"sep_space_embeds_bf16": E_tgt[sep_space_ids].clone().to(torch.bfloat16),"stave_vocab": STAVE_VOCAB_GLM,"stave_protos_fp16": stave_protos,"mu_u": mu_u,"sem_norm": float(br_ckpt["sem_norm"]),126 unmodified lines1271281291301311321331341353 unmodified lines139140141142143144145126 unmodified linesbr_ckpt = torch.load(str(bridge_path), map_location="cpu", weights_only=False)mu_u = br_ckpt["mu_u"].float()stave_vocab = br_ckpt.get("stave_vocab", STAVE_VOCAB_GLM)stave_protos = []for vocab in stave_vocab:tids = [tok.encode(" " + w, add_special_tokens=False)[0] for w in vocab]stave_protos.append(F.normalize(E_tgt[tids].float() - mu_u, dim=-1).to(torch.float16))3 unmodified lines"sep_pipe_embeds_bf16": E_tgt[sep_pipe_ids].clone().to(torch.bfloat16),"sep_space_ids": sep_space_ids,"sep_space_embeds_bf16": E_tgt[sep_space_ids].clone().to(torch.bfloat16),"stave_vocab": stave_vocab,"stave_protos_fp16": stave_protos,"mu_u": mu_u,"sem_norm": float(br_ckpt["sem_norm"]),
59 unmodified lines6061626364656667686999 unmodified lines16917017117217317458 unmodified lines233234235236237238107 unmodified lines34634734834935035135235335435535635757 unmodified lines41541641741841942042159 unmodified linesMODELS_DIR = Path(os.environ.get("PLATOS_EARS_MODELS_DIR", "./models"))OMNI_DIR = Path(os.environ.get("PLATOS_EARS_OMNI_DIR", str(MODELS_DIR / "qwen25_omni_cultured_L00_L12")))BRIDGE_PATH = Path(os.environ.get("PLATOS_EARS_BRIDGE_PATH", str(MODELS_DIR / "bridge_step17c_glm53_l00_unitnorm_ear.pt")))AUX_PATH = Path(os.environ.get("PLATOS_EARS_AUX_PATH", str(MODELS_DIR / "glm53_ear_aux.pt")))WHISPER_DIR = Path(os.environ.get("PLATOS_EARS_WHISPER_DIR", str(MODELS_DIR / "whisper-large-v3-turbo")))ENABLE_WHISPER = os.environ.get("PLATOS_EARS_ENABLE_WHISPER", "1").strip() != "0"99 unmodified linesself.stave_vocab: List[List[str]] = aux["stave_vocab"]self.stave_protos: List[torch.Tensor] = [p.float().to(self.device) for p in aux["stave_protos_fp16"]]self.mu_u_dev: torch.Tensor = aux["mu_u"].float().to(self.device)self.whisper_model = Noneself.whisper_proc = None58 unmodified linesh.remove()return capdef _window_has_vocal_or_speech(self, staves: List[str]) -> bool:vocal_markers = {"spoken", "voice", "speech", "vocals", "singing", "screaming", "rap"}for s in staves:107 unmodified linesif len(all_win_embeds) >= MAX_WINDOWS:breakall_win_embeds.append(zw[wi].to(dtype=torch.bfloat16).cpu())decoded_staves.append(" ".join(self.stave_vocab[s][int((yu[wi, s] @ self.stave_protos[s].T).argmax().item())]for s in range(N_STAVES)))parts: List[torch.Tensor] = []for idx, we in enumerate(all_win_embeds):57 unmodified linesvram_gb = round(torch.cuda.memory_allocated() / 1e9, 2) if torch.cuda.is_available() else 0.0return {"status": "ok","model": "platos-ears-l00-v1","whisper_enabled": ENGINE.whisper_model is not None,"vram_allocated_gb": vram_gb,}59 unmodified lines606162636465666768697071727374757677787980818283848599 unmodified lines18518618718818919019119219319419519619719858 unmodified lines257258259260261262263264265266267268269270271272273274275276277278279280281282283284107 unmodified lines39239339439539639739857 unmodified lines45645745845946046146259 unmodified linesMODELS_DIR = Path(os.environ.get("PLATOS_EARS_MODELS_DIR", "./models"))OMNI_DIR = Path(os.environ.get("PLATOS_EARS_OMNI_DIR", str(MODELS_DIR / "qwen25_omni_cultured_L00_L12")))def _default_model_file(primary: str, fallback: str) -> str:p = MODELS_DIR / primaryreturn str(p if p.exists() else (MODELS_DIR / fallback))BRIDGE_PATH = Path(os.environ.get("PLATOS_EARS_BRIDGE_PATH",_default_model_file("bridge_step17e_glm53_l00_world_ear.pt","bridge_step17c_glm53_l00_unitnorm_ear.pt",),))AUX_PATH = Path(os.environ.get("PLATOS_EARS_AUX_PATH",_default_model_file("glm53_ear_aux_v2.pt", "glm53_ear_aux.pt"),))WHISPER_DIR = Path(os.environ.get("PLATOS_EARS_WHISPER_DIR", str(MODELS_DIR / "whisper-large-v3-turbo")))ENABLE_WHISPER = os.environ.get("PLATOS_EARS_ENABLE_WHISPER", "1").strip() != "0"99 unmodified linesself.stave_vocab: List[List[str]] = aux["stave_vocab"]self.stave_protos: List[torch.Tensor] = [p.float().to(self.device) for p in aux["stave_protos_fp16"]]self.mu_u_dev: torch.Tensor = aux["mu_u"].float().to(self.device)self.model_version: str = os.environ.get("PLATOS_EARS_MODEL_VERSION","platos-ears-l00-v2" if len(self.stave_vocab[2]) > 20 else "platos-ears-l00-v1",)_music_s3 = {"drums", "bass", "guitar", "strings", "piano", "synth", "chords", "melody"}self._nonmusic_s3_idx: List[int] = [j for j, w in enumerate(self.stave_vocab[3]) if w not in _music_s3]self.whisper_model = Noneself.whisper_proc = None58 unmodified linesh.remove()return capdef _decode_window_stave(self, yu_win: torch.Tensor) -> str:"""Decode 10-stave telemetry with domain-consistent MAP readout on unanimous non-music windows."""sims = [yu_win[s] @ self.stave_protos[s].T for s in range(N_STAVES)]toks = [self.stave_vocab[s][int(sims[s].argmax().item())] for s in range(N_STAVES)]_nm_s1 = {"spoken", "noisy", "natural", "static", "silence", "background", "pure"}_nm_s2 = {"voice", "noise", "wind", "engine", "water", "rain", "traffic", "crowd","footsteps", "birds", "dog", "door", "machine", "none", "sine",}_nm_s8 = {"speech", "sound", "silence"}_nm_s9 = {"speech", "background", "noise", "outdoor", "indoor", "environment", "sound", "silence"}if (self._nonmusic_s3_idxand toks[1] in _nm_s1and toks[2] in _nm_s2and toks[8] in _nm_s8and toks[9] in _nm_s9):best_j = max(self._nonmusic_s3_idx, key=lambda j: float(sims[3][j].item()))toks[3] = self.stave_vocab[3][best_j]return " ".join(toks)def _window_has_vocal_or_speech(self, staves: List[str]) -> bool:vocal_markers = {"spoken", "voice", "speech", "vocals", "singing", "screaming", "rap"}for s in staves:107 unmodified linesif len(all_win_embeds) >= MAX_WINDOWS:breakall_win_embeds.append(zw[wi].to(dtype=torch.bfloat16).cpu())decoded_staves.append(self._decode_window_stave(yu[wi]))parts: List[torch.Tensor] = []for idx, we in enumerate(all_win_embeds):57 unmodified linesvram_gb = round(torch.cuda.memory_allocated() / 1e9, 2) if torch.cuda.is_available() else 0.0return {"status": "ok","model": ENGINE.model_version,"whisper_enabled": ENGINE.whisper_model is not None,"vram_allocated_gb": vram_gb,}
2 unmodified lines3452 unmodified lines4537ac739507b5dd972572261cd146de3586674be8dd29eaa72de180bc4ffc8a glm53_flash_l00/bridge_step17c_glm53_l00_unitnorm_ear.ptc5abb358a5ce78548ba18b6abde7fbdb7ec949eb56b56949e8cf17b863b28c83 glm53_flash_l00/glm53_ear_aux.ptda23e3f19f6c19ea8e5a78500c8ebddb5710f1ab1b91633439d09ff0c432cd3a gemma4_e4b_l02/bridge_step16d_crown_jewel_10stave_l02.pt2 unmodified lines345672 unmodified lines4537ac739507b5dd972572261cd146de3586674be8dd29eaa72de180bc4ffc8a glm53_flash_l00/bridge_step17c_glm53_l00_unitnorm_ear.ptc5abb358a5ce78548ba18b6abde7fbdb7ec949eb56b56949e8cf17b863b28c83 glm53_flash_l00/glm53_ear_aux.ptda23e3f19f6c19ea8e5a78500c8ebddb5710f1ab1b91633439d09ff0c432cd3a gemma4_e4b_l02/bridge_step16d_crown_jewel_10stave_l02.pte16e55f22c9a60cf419a7ec17a009278a5bd4bbd1510681897aa2d3f70291f3f glm53_flash_l00/bridge_step17e_glm53_l00_world_ear.pt1a92deaf4483d676208d63068678b4cf8b7ab735d1482260a04b0af068f39341 glm53_flash_l00/glm53_ear_aux_v2.pt
123version https://git-lfs.github.com/spec/v1oid sha256:e16e55f22c9a60cf419a7ec17a009278a5bd4bbd1510681897aa2d3f70291f3fsize 361858747123version https://git-lfs.github.com/spec/v1oid sha256:1a92deaf4483d676208d63068678b4cf8b7ab735d1482260a04b0af068f39341size 1300967README.md+27-22
paper/PLATOS_EARS_PAPER.md+14
platos_ears/architecture.py+43
platos_ears/export_ear.py+3-2
platos_ears/sidecar.py+50-9
weights/SHA256SUMS.txt+2
weights/glm53_flash_l00/bridge_step17e_glm53_l00_world_ear.ptAdded+3
weights/glm53_flash_l00/glm53_ear_aux_v2.ptAdded+3