diff --git a/README.md b/README.md index b476977..8fa6ccb 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ seeded and reproducible from a single command. [nyra forced aligner](https://huggingface.co/nyralabs/nyra_forced_aligner_en) · [PocketSphinx](https://github.com/cmusphinx/pocketsphinx) · [Qwen3-ForcedAligner](https://huggingface.co/Qwen/Qwen3-ForcedAligner-0.6B) · + [rumblex](https://github.com/EdwardGlockner/rumblex) · [stable-ts](https://github.com/jianfch/stable-ts) · [TorchAudio-FA](https://github.com/pytorch/audio) · [UnitY2](https://github.com/facebookresearch/seamless_communication) · diff --git a/evals/README.md b/evals/README.md index d158c3e..1b631b3 100644 --- a/evals/README.md +++ b/evals/README.md @@ -73,7 +73,7 @@ mismatch, since a `.so` is loaded once per process. |---|---| | bfa, charsiu, maps | `/repo/env` | | mfa | `/repo/mamba` (micromamba) | -| crisperwhisper, falcon, fusealign_hub, granite_speech_plus, nemo_fa, neufa, nyra_fa, parakeet_tdt, pocketsphinx, qwen3_asr, qwen3_fa, stable_ts, torchaudio_fa, unity2, whisper3, whisper_ts, whisperx | `/venv` | +| crisperwhisper, falcon, fusealign_hub, granite_speech_plus, nemo_fa, neufa, nyra_fa, parakeet_tdt, pocketsphinx, qwen3_asr, qwen3_fa, rumblex, stable_ts, torchaudio_fa, unity2, whisper3, whisper_ts, whisperx | `/venv` | | crisperwhisper_fa | shares `timestamp_asrs/crisperwhisper/venv`, the same package | | mms_fa, torchaudio_asr | share `aligners/torchaudio_fa/venv`, the same package | | whisperx_asr | shares `aligners/whisperx/venv` | @@ -305,6 +305,7 @@ pass on an environment you built. | `nyra_fa` | nyra-forced-aligner, MIT | nyralabs/nyra_forced_aligner_en, nyra health Non-Commercial Research License | noncommercial weights | | `pocketsphinx` | cmusphinx/pocketsphinx, BSD-style | the bundled en-us model and CMUdict, BSD-style | none | | `qwen3_fa` | qwen-asr, Apache-2.0 | Qwen/Qwen3-ForcedAligner-0.6B, Apache-2.0 | none | +| `rumblex` | rumblex, Apache-2.0 | Reson8/Rumble-2-Flash, Apache-2.0 | none | | `stable_ts` | jianfch/stable-ts, MIT | Whisper base, MIT | none | | `torchaudio_fa` | torchaudio, BSD-2-Clause | WAV2VEC2_ASR_BASE_960H, MIT | mode B uses phonemizer and espeak-ng, GPL-3.0 or later | | `unity2` | seamless_communication, MIT | unity2_aligner, MIT, with a tokenizer from facebook/seamless-streaming, CC BY-NC 4.0 | noncommercial tokenizer, and the unit extractor's licence is not stated | diff --git a/evals/aligners/rumblex/config.yaml b/evals/aligners/rumblex/config.yaml new file mode 100644 index 0000000..936a1c6 --- /dev/null +++ b/evals/aligners/rumblex/config.yaml @@ -0,0 +1,17 @@ +# rumblex -- WORD-LEVEL ONLY. It aligns the reference transcript to the CTC +# head of an ASR checkpoint (Reson8/Rumble-2-Flash), which has no phone tier, +# so it appears in the word tables and is absent from every phone table by +# construction, not by omission. +# +# Installed in its OWN venv (evals/aligners/rumblex/venv), like every tool +# here. rumblex needs transformers >= 5.21. +name: rumblex +adapter: rumblex +enabled: true +modes: [A] # from text; no gold-phone mode +granularity: [word] +emits_confidence: true +params: + venv: venv + model: Reson8/Rumble-2-Flash + device: cuda diff --git a/evals/aligners/rumblex/download_and_install.sh b/evals/aligners/rumblex/download_and_install.sh new file mode 100755 index 0000000..a2a948a --- /dev/null +++ b/evals/aligners/rumblex/download_and_install.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# Copyright 2026 Olewave, LLC +# SPDX-License-Identifier: Apache-2.0 + +# rumblex for FA-Bench -- in a PRIVATE venv. +# +# https://github.com/EdwardGlockner/rumblex +# https://huggingface.co/Reson8/Rumble-2-Flash +# +# A FORCED ALIGNER here, not an ASR: `rumblex.align` takes audio and a reference +# transcript and places the words with the checkpoint's CTC head. That is why +# it lives in evals/aligners/ and not evals/timestamp_asrs/. +# +# Own venv, not the shared .venv: rumblex needs transformers >= 5.21 for the +# Rumble-2-Flash model class. +# +# TORCH BUILD: the same pin as the other recipes (see qwen3_fa's for why cu128). +# rumblex itself only asks for torch >= 2.6. These pins were checked on CPU +# only, with the +cpu wheel; the cu128 build has not been run with rumblex. +set -euo pipefail +HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +MODEL=${MODEL:-Reson8/Rumble-2-Flash} + +# Re-runnable: reuse a venv that already has an interpreter. +[ -x "$HERE/venv/bin/python" ] || uv venv "$HERE/venv" --python 3.12 +uv pip install --python "$HERE/venv/bin/python" \ + torch==2.8.0 torchaudio==2.8.0 \ + --index-url https://download.pytorch.org/whl/cu128 \ + --extra-index-url https://pypi.org/simple +# rumblex VERSION PINNED. Not below 0.5.0: earlier releases put word ends too +# early when the transcript has no punctuation, as Buckeye's has not. 0.6.0 +# adds the learned start and end correction, which moves every word time. +# Bump deliberately + re-run the sweep. +uv pip install --python "$HERE/venv/bin/python" rumblex==0.6.0 + +# uv venvs have no pip of their own; ask uv, not the venv. +uv pip freeze --python "$HERE/venv/bin/python" > "$HERE/requirements.lock" + +"$HERE/venv/bin/python" - < tuple[np.ndarray, int]: + """Mono float32 at the file's own rate. rumblex resamples to 16 kHz itself.""" + x, sr = sf.read(path, dtype="float32", always_2d=False) + if x.ndim > 1: + x = x.mean(axis=1) + return np.ascontiguousarray(x, dtype=np.float32), int(sr) + + +def main(argv: list[str]) -> int: + jobs_path, model_id = argv[0], argv[1] + device = argv[2] if len(argv) > 2 else "cuda" + + import rumblex + import torch + + # startswith, as in the other workers: the cell runners pass "cuda:0". + device = device if (device.startswith("cuda") + and torch.cuda.is_available()) else "cpu" + model = rumblex.load_model(model_id, device=device) + + with open(jobs_path) as f: + for line in f: + line = line.strip() + if not line: + continue + job = json.loads(line) + rec = {"item_id": job["item_id"]} + try: + x, sr = load_audio(job["audio_path"]) + result = rumblex.align(x, job.get("transcript", ""), model, sr=sr) + rec["words"] = [[w.word, w.start, w.end, w.score] + for seg in result.segments for w in seg.words] + except Exception as e: + rec["error"] = f"{type(e).__name__}: {e}" + print(json.dumps(rec), flush=True) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main(sys.argv[1:])) diff --git a/evals/config.yaml b/evals/config.yaml index 6a4c0b6..599bcea 100644 --- a/evals/config.yaml +++ b/evals/config.yaml @@ -32,4 +32,5 @@ aligners: - { name: charsiu, enabled: false } # frame-classification, own venv - { name: bfa, enabled: false } # Bayesian FA, own venv - { name: whisperx, enabled: false } # wav2vec2 alignment head, own venv + - { name: rumblex, enabled: false } # Rumble-2-Flash CTC head, own venv - { name: olign, enabled: false } # hosted API, needs a service token from Olewave diff --git a/evals/systems.py b/evals/systems.py index 00accdb..71461d9 100644 --- a/evals/systems.py +++ b/evals/systems.py @@ -165,6 +165,8 @@ def __getitem__(self, key: str) -> str: "stable_ts": "stable-ts", "torchaudio_fa": "TorchAudio", "whisperx": "WhisperX", + # The package writes its name in lower case. + "rumblex": "rumblex", } @@ -212,6 +214,9 @@ def __getitem__(self, key: str) -> str: "nemo_fa": "ctc", "nemo_fa_conformer": "ctc", "whisperx": "ctc", # wav2vec2 phoneme CTC for the ALIGNMENT stage + # Viterbi over the auxiliary CTC head of Rumble-2-Flash. The ASR decoder + # never runs here; what places the boundary is the CTC path. + "rumblex": "ctc", # NOT attention, despite the upstream naming. The whole aligner is four # nn.Conv1d layers with ReLU and dropout over text and unit embeddings, # then a negative L2 distance between every frame and every token, diff --git a/fabench/aligners/__init__.py b/fabench/aligners/__init__.py index 87714d5..f77df29 100644 --- a/fabench/aligners/__init__.py +++ b/fabench/aligners/__init__.py @@ -12,6 +12,8 @@ "torchaudio_fa": "fabench.aligners.torchaudio_fa:TorchaudioFA", "charsiu": "fabench.aligners.charsiu:Charsiu", "whisperx": "fabench.aligners.whisperx:WhisperX", + # An ASR checkpoint's own CTC head (Reson8/Rumble-2-Flash), word level only. + "rumblex": "fabench.aligners.rumblex:Rumblex", "mfa": "fabench.aligners.mfa:MFA", "bfa": "fabench.aligners.bfa:BFA", "maps": "fabench.aligners.maps:MAPS", diff --git a/fabench/aligners/rumblex/README.md b/fabench/aligners/rumblex/README.md new file mode 100644 index 0000000..22af0a5 --- /dev/null +++ b/fabench/aligners/rumblex/README.md @@ -0,0 +1,33 @@ +# rumblex aligner + +[rumblex](https://github.com/EdwardGlockner/rumblex) word alignment. The +encoder of `Reson8/Rumble-2-Flash` and the CTC head that ships with that +checkpoint, driven on the reference transcript (`rumblex.align`). **Word +only**, with no phones, so it appears only in the word-level tables and never +in the phone tables. + +The head shares the ASR decoder's subword vocabulary and the encoder emits 13 +frames a second, so the raw CTC path is on an 80 ms grid. rumblex then places +each word's start and end inside its frame with a small linear map on the +encoder states around it, fitted on LibriSpeech against Montreal Forced +Aligner times (43 KB, shipped in the package). The confidence is the lowest +CTC probability among a word's tokens. + +- **Modes.** A. **Granularity.** Word. **Confidence.** Yes. + +## Install + +```bash +evals/aligners/rumblex/download_and_install.sh # its own venv, pinned +``` + +## Config + +```yaml +- name: rumblex + adapter: rumblex + enabled: true + modes: [A] + granularity: [word] + params: { model: Reson8/Rumble-2-Flash, device: cuda } +``` diff --git a/fabench/aligners/rumblex/__init__.py b/fabench/aligners/rumblex/__init__.py new file mode 100644 index 0000000..5b08172 --- /dev/null +++ b/fabench/aligners/rumblex/__init__.py @@ -0,0 +1,7 @@ +# Copyright 2026 Olewave, LLC +# SPDX-License-Identifier: Apache-2.0 + +"""rumblex aligner subpackage — adapter in adapter.py, docs in README.md.""" +from fabench.aligners.rumblex.adapter import Rumblex + +__all__ = ["Rumblex"] diff --git a/fabench/aligners/rumblex/adapter.py b/fabench/aligners/rumblex/adapter.py new file mode 100644 index 0000000..e6d3a27 --- /dev/null +++ b/fabench/aligners/rumblex/adapter.py @@ -0,0 +1,31 @@ +# Copyright 2026 Olewave, LLC +# SPDX-License-Identifier: Apache-2.0 + +"""rumblex forced alignment -- an ASR model's own CTC head, word level only. + +rumblex (https://github.com/EdwardGlockner/rumblex) runs the encoder of +Reson8/Rumble-2-Flash and force-aligns the reference transcript to the +auxiliary CTC head that ships with the checkpoint (`rumblex.align`). There is +no second alignment model. The head shares the decoder's subword vocabulary and +the encoder emits 13 frames a second, so boundaries sit on an 80 ms grid that +rumblex then refines with a small linear map on the encoder states. + +Runs in its OWN interpreter (fabench/aligners/subprocess_aligner.py). + +Word level only: the head has no phone tier, so rumblex appears in the WBE +tables and never in the phone ones. +""" +from __future__ import annotations + +from fabench.aligners.subprocess_aligner import SubprocessAligner + + +class Rumblex(SubprocessAligner): + name = "rumblex" + source = "orthographic" + granularity = ("word",) + default_model = "Reson8/Rumble-2-Flash" + + def _extra_argv(self) -> list[str]: + """worker.py .""" + return [str(self.params.get("device", "cuda"))] diff --git a/fabench/aligners/test/test_aligners.py b/fabench/aligners/test/test_aligners.py index da5b085..84a1b63 100644 --- a/fabench/aligners/test/test_aligners.py +++ b/fabench/aligners/test/test_aligners.py @@ -44,9 +44,12 @@ def test_supports_mode_granularity(): wx = get_adapter(_spec("whisperx", "whisperx", granularity=["word"])) assert wx.supports("A", "word") assert not wx.supports("B", "phone") # word-only + rx = get_adapter(_spec("rumblex", "rumblex", granularity=["word"])) + assert rx.name == "rumblex" and rx.supports("A", "word") + assert not rx.supports("A", "phone") # word-only -@pytest.mark.parametrize("adapter", ["whisperx"]) +@pytest.mark.parametrize("adapter", ["whisperx", "rumblex"]) def test_gated_adapters_fail_with_actionable_error(adapter): # deps absent in a clean env -> actionable AlignerError on load. a = get_adapter(_spec(adapter, adapter))