diff --git a/docs/models/koyal-120m.md b/docs/models/koyal-120m.md new file mode 100644 index 000000000..c81c2b08d --- /dev/null +++ b/docs/models/koyal-120m.md @@ -0,0 +1,94 @@ +# Koyal 120M + +[Adalat AI](https://www.adalat.ai/)'s Koyal 120M: four small offline +speech-to-text models, one per language, built for document-ready dictation. +The output has punctuation and numerals (`20ನೇ`, not `ಇಪ್ಪತ್ತನೇ`), so it can go +straight into a document. + +| Variant | Language | Upstream | +| --- | --- | --- | +| `koyal-hi-120m-1.0` | Hindi (`hi`) | [`adalat-ai/koyal-hi-120m-1.0`](https://huggingface.co/adalat-ai/koyal-hi-120m-1.0) at [`7f2cb57`](https://huggingface.co/adalat-ai/koyal-hi-120m-1.0/commit/7f2cb57) | +| `koyal-kn-120m-1.0` | Kannada (`kn`) | [`adalat-ai/koyal-kn-120m-1.0`](https://huggingface.co/adalat-ai/koyal-kn-120m-1.0) at [`a169f0b`](https://huggingface.co/adalat-ai/koyal-kn-120m-1.0/commit/a169f0b) | +| `koyal-ml-120m-1.0` | Malayalam (`ml`) | [`adalat-ai/koyal-ml-120m-1.0`](https://huggingface.co/adalat-ai/koyal-ml-120m-1.0) at [`8135bc8`](https://huggingface.co/adalat-ai/koyal-ml-120m-1.0/commit/8135bc8) | +| `koyal-te-120m-1.0` | Telugu (`te`) | [`adalat-ai/koyal-te-120m-1.0`](https://huggingface.co/adalat-ai/koyal-te-120m-1.0) at [`1f301af`](https://huggingface.co/adalat-ai/koyal-te-120m-1.0/commit/1f301af) | + +Weights are CC-BY-4.0. + +## What it is + +A classic NeMo Conformer hybrid TDT+CTC model (17 layers, d_model 512, about +120M parameters). The encoder is warm-started from AI4Bharat's MahaDhwani and +fine-tuned per language. transcribe.cpp ships the TDT head, like +`parakeet-tdt_ctc-110m`. + +It is not a FastConformer, unlike the rest of the +[Parakeet family](parakeet.md). It runs on the parakeet path because only the +subsampling block differs: NeMo `striding` (two full convs, 4x) in place of +`dw_striding` (8x). The Conformer blocks, the TDT decoder and the tokenizer +are the same code. Frames are 40 ms, not 80 ms. Long audio uses a 512-frame +local attention window, which covers the same 20.5 s as the 256-frame window +at 8x. + +One language per model. The model does not need a language hint. If one is +given it is only checked: the model's own code (`-l ml` for the Malayalam +model) is accepted, and anything else is an error. No streaming, translation +or language detection. + +| Quantization | Size | +| --- | ---: | +| F32 | 479 MB | +| Q8_0 | 149 MB | +| Q5_K_M | 113 MB | +| Q4_K_M | 101 MB | + +## Accuracy + +WER on the full FLEURS test split (hi 418, kn 838, ml 958, te 472 +utterances), transcribe.cpp on an NVIDIA A100 (CUDA), batch size 1, +timestamps none, scored with `scripts/wer/score.py` like the other Indic +language rows in this repo. + +| Quantization | hi | kn | ml | te | +| --- | ---: | ---: | ---: | ---: | +| F32 | 5.38% | 5.85% | 5.57% | 7.34% | +| Q8_0 | 5.35% | 5.86% | 5.58% | 7.35% | +| Q5_K_M | 5.21% | 5.92% | 5.55% | 7.17% | +| Q4_K_M | 5.27% | 5.94% | 5.59% | 7.18% | + +## Quick start + +```bash +cmake -B build +cmake --build build + +uv run --project scripts/envs/parakeet \ + scripts/convert-parakeet.py adalat-ai/koyal-ml-120m-1.0 + +build/bin/transcribe-quantize \ + models/koyal-ml-120m-1.0/koyal-ml-120m-1.0-F32.gguf \ + models/koyal-ml-120m-1.0/koyal-ml-120m-1.0-Q8_0.gguf \ + --quant Q8_0 + +build/bin/transcribe-cli \ + -m models/koyal-ml-120m-1.0/koyal-ml-120m-1.0-Q8_0.gguf \ + -l ml samples/ml-short.wav +``` + +The converter writes `models//-F32.gguf`; the folder name +sets the variant. Repeat the quantize step with `Q5_K_M` or `Q4_K_M` for the +smaller files. + +## Numerical validation + +Each variant is validated tensor by tensor against NeMo on its +`samples/-short.wav`, with the shared parakeet tolerances: + +```bash +uv run scripts/validate.py all --family parakeet --variant koyal-ml-120m-1.0 +``` + +## Attribution + +Weights: Adalat AI, CC-BY-4.0. The encoder is warm-started from AI4Bharat's +MahaDhwani. Conversion drops the auxiliary CTC head and renames tensors; it +does not retrain the model. diff --git a/docs/models/parakeet.md b/docs/models/parakeet.md index 8599c232f..5cc28d61a 100644 --- a/docs/models/parakeet.md +++ b/docs/models/parakeet.md @@ -35,6 +35,10 @@ Most users want one of three: five-value-quantized repack of v3, expanded back to dense weights here. English only, accuracy on par with `parakeet-tdt-0.6b-v2`. CC-BY-4.0 weights. See [phonon-2.md](phonon-2.md). +- **Hindi, Kannada, Malayalam or Telugu → Koyal 120M.** Adalat AI's small + per-language dictation models; output keeps punctuation and numerals. + Classic Conformer (4x subsampling) rather than FastConformer. + See [koyal-120m.md](koyal-120m.md). - **Streaming / real-time → Nemotron streaming.** Most Parakeet variants here are offline-only. For low-latency streaming use the FastConformer-lineage [`nemotron-3.5-asr-streaming-0.6b`](nemotron-3.5-asr-streaming-0.6b.md) diff --git a/docs/porting/families/parakeet.md b/docs/porting/families/parakeet.md index 9623b6db0..8f678abb0 100644 --- a/docs/porting/families/parakeet.md +++ b/docs/porting/families/parakeet.md @@ -666,3 +666,36 @@ strict CPU-reference tensor tolerances. Packed compute, deployment quantization and publication readiness are not claimed. Detailed evidence is recorded in `reports/porting/parakeet/phonon-2/_porting-log.md`. + +## Koyal 120M classic-Conformer variants + +Source `adalat-ai/koyal-{hi,kn,ml,te}-120m-1.0`; NeMo reference, the shared +`scripts/envs/parakeet` environment and +`scripts/dump_reference_parakeet_nemo.py`. See +[the variant documentation](../../models/koyal-120m.md) for reproduction and +scope. + +These are the only variants in the family that are not FastConformer. The +encoder is a classic NeMo Conformer (17 layers, d_model=512, kernel 31, 80 +mels) whose `pre_encode` is `striding`: conv0, then one more full 3x3 +stride-2 conv, 4x in time. FastConformer's `dw_striding` is conv0 plus two +depthwise-separable pairs, 8x. Everything after `pre_encode` (the Conformer +blocks, relative-position attention, the TDT decoder and joint, the BPE +tokenizer) is the existing parakeet code, so they run on the parakeet path +rather than as a new family. + +KV `stt.parakeet.encoder.subsampling=striding` selects the stack. The key is +written only for striding; an absent key means `dw_striding`, so existing +GGUFs load and convert unchanged. Frames are 40 ms instead of 80 ms, so the +long-form local-attention window is 512 frames to keep the same 20.5 s. +Striding with `chunked_limited` attention is rejected: causal striding is not +implemented. + +The upstream checkpoints are hybrid TDT+CTC. The auxiliary CTC head is +dropped at convert time, as for `tdt_ctc-110m`, through the profile flag +`drop_aux_ctc`. Each model takes one language; a language hint is optional +and any other language is an error. + +Each variant has its own golden manifest on an 11 s FLEURS clip in its +language and passes with the shared `tests/tolerances/parakeet.json` +(16/16 tensors, transcript exact). diff --git a/reports/porting/parakeet/forward-map.md b/reports/porting/parakeet/forward-map.md index 5ab261fa3..5c63ebcbb 100644 --- a/reports/porting/parakeet/forward-map.md +++ b/reports/porting/parakeet/forward-map.md @@ -145,3 +145,14 @@ Subsampler pointwise bias is masked on padded frames via Global TDT budget uses the existing implementation. Gate tensors cover mel, subsampler, positional encoding, blocks 0/12/23, block-0 residual stages, encoder final, blank embedding, LSTM states and first joint logits. + +### Koyal 120M / striding variant + +Classic NeMo Conformer, not FastConformer: 17 layers, d_model=512, n_mels=80, +`use_bias=true`, TDT head, pred_n_layers=1, BPE 512. Same forward structure +as `tdt_ctc-110m` except `pre_encode`, which is NeMo `striding` +(`ConvSubsampling` with `subsampling="striding"`): conv0 -> ReLU -> full 3x3 +stride-2 conv -> ReLU -> flatten -> linear, 4x in time, selected by +`stt.parakeet.encoder.subsampling=striding`. Valid lengths use two stride-2 +stages instead of three. Oracle: NeMo, the same dumper as the other NeMo +variants. Gate tensors and tolerances are the shared family set. diff --git a/reports/porting/parakeet/koyal-hi-120m-1.0/intake.json b/reports/porting/parakeet/koyal-hi-120m-1.0/intake.json new file mode 100644 index 000000000..8193e4874 --- /dev/null +++ b/reports/porting/parakeet/koyal-hi-120m-1.0/intake.json @@ -0,0 +1,198 @@ +{ + "schema_version": "transcribe-intake-v1", + "family": "parakeet", + "hf_repo": "adalat-ai/koyal-hi-120m-1.0", + "hf_revision": "7f2cb579598ba607b7ebb78a1b523fbcb83f4cf9", + "sources": { + "config": { + "kind": "hf_file", + "path": "config.json", + "status": "missing", + "detail": "NeMo .nemo archive only; model_config.yaml inside it is the config." + }, + "preprocessor": { + "kind": "hf_file", + "path": "preprocessor_config.json", + "status": "missing", + "detail": "Inside .nemo as model.cfg.preprocessor: AudioToMelSpectrogramPreprocessor, 80 mels." + }, + "tokenizer_config": { + "kind": "hf_file", + "path": "tokenizer_config.json", + "status": "missing", + "detail": "SentencePiece BPE inside .nemo, vocab_size=512, punctuation and digits in vocab." + }, + "tokenizer_json": { + "kind": "hf_file", + "path": "tokenizer.json", + "status": "missing" + }, + "generation_config": { + "kind": "hf_file", + "path": "generation_config.json", + "status": "missing" + }, + "safetensors_metadata": { + "kind": "hf_api", + "path": "HfApi.get_safetensors_metadata", + "status": "missing", + "detail": "PyTorch state_dict inside .nemo" + }, + "model_card": { + "kind": "hf_api", + "path": "https://huggingface.co/adalat-ai/koyal-hi-120m-1.0", + "status": "found", + "detail": "Monolingual Hindi dictation model; rich-orthography output (punctuation, numerals); CC-BY-4.0; encoder warm-started from ai4bharat/MahaDhwani_pretrained_conformer." + }, + "reference_modeling_code": { + "kind": "reference_code", + "path": "scripts/convert-parakeet.py, src/arch/parakeet/, src/conformer/", + "status": "found", + "detail": "Existing TDT path applies after pre_encode; pre_encode is NeMo ConvSubsampling with subsampling=striding." + } + }, + "variants": [ + { + "name": "koyal-hi-120m-1.0", + "memory_gb": 0.5, + "files": [ + "koyal-hi-120m-1.0.nemo" + ] + } + ], + "config": { + "architecture_candidates": [ + "encoder-transducer" + ], + "key_fields": { + "architectures": [ + "EncDecHybridRNNTCTCBPEModel" + ], + "model_type": "conformer_tdt_ctc", + "encoder.type": "ConformerEncoder (classic Conformer, not FastConformer)", + "encoder.n_layers": 17, + "encoder.d_model": 512, + "encoder.n_heads": 8, + "encoder.ff_expansion_factor": 4, + "encoder.conv_kernel_size": 31, + "encoder.subsampling": "striding", + "encoder.subsampling_factor": 4, + "encoder.self_attention_model": "rel_pos", + "encoder.att_context_size": [ + -1, + -1 + ], + "decoder.type": "RNNTDecoder (predictor)", + "decoder.pred_hidden": 640, + "decoder.pred_rnn_layers": 1, + "joint.type": "RNNTJoint (TDT)", + "joint.joint_hidden": 640, + "joint.durations": [ + 0, + 1, + 2, + 3, + 4 + ], + "joint.num_extra_outputs": 5, + "ctc_decoder.type": "ConvASRDecoder", + "tokenizer.vocab_size": 512, + "tokenizer.has_punctuation_capitalization": true + }, + "varying_across_variants": [ + "tokenizer vocabulary (one language per variant)" + ] + }, + "dtype": { + "expected": "float32", + "source": "config", + "evidence": "NeMo .nemo, PyTorch state_dict at float32; model_config.yaml declares no other precision.", + "details": { + "config_declared": null, + "header_distribution": {} + }, + "expected_f32_tensors": [] + }, + "frontend": { + "sample_rate": 16000, + "n_mels": 80, + "hop_length": 160, + "fft_size": 512, + "window": "hann_periodic", + "normalization": "per_feature", + "preemphasis": 0.97, + "dither": 1e-05, + "center": true, + "padding_mode": "reflect", + "mel_filterbank_norm": "slaney" + }, + "tokenizer": { + "type": "sentencepiece", + "vocab_size": 512, + "special_tokens": { + "blank": 512 + }, + "has_language_tokens": false, + "vocab_sha256": null + }, + "capabilities": { + "languages": [ + "hi" + ], + "language_detection": false, + "translation": false, + "timestamps": [ + "token", + "word", + "segment" + ], + "streaming": false, + "speaker_diarization": false + }, + "upstream_benchmarks": [ + { + "dataset": "FLEURS-RO test", + "language": "hi", + "metric": "other", + "score": 9.03, + "score_unit": "percent", + "source": "https://huggingface.co/adalat-ai/koyal-hi-120m-1.0", + "notes": "WER_SCRIBE from the model card, 418 clips: scribe-eval alignment over all tokens, no text normalization, against rich-orthography references (adalat-ai/fleurs-ro)." + }, + { + "dataset": "FLEURS-RO test", + "language": "hi", + "metric": "wer", + "score": 10.63, + "score_unit": "percent", + "source": "https://huggingface.co/adalat-ai/koyal-hi-120m-1.0", + "notes": "jiwer WER on the same unnormalized text, from the model card." + }, + { + "dataset": "FLEURS-RO test", + "language": "hi", + "metric": "cer", + "score": 3.79, + "score_unit": "percent", + "source": "https://huggingface.co/adalat-ai/koyal-hi-120m-1.0", + "notes": "jiwer CER on the same unnormalized text, from the model card." + } + ], + "reference_framework": "nemo", + "reference_rationale": "Standard NeMo checkpoint with no custom code; same NeMo reference and dumper as the rest of the family.", + "architecture_pattern": "encoder-transducer", + "known_risks": [ + "Classic Conformer, not FastConformer: pre_encode is NeMo `striding` (conv0 plus one full 3x3 stride-2 conv, 4x), not `dw_striding` (8x). Needs its own subsampling path; frames are 40 ms.", + "Long-form local-attention window is sized in frames; at 4x it must be 512 frames to cover the same 20.5 s as 256 frames at 8x.", + "Hybrid TDT + CTC head sharing the encoder; ship TDT only, as for tdt_ctc-110m. The variant name has no `tdt_ctc`, so the converter needs an explicit flag to drop the aux CTC head.", + "NeMo keeps a masked padding frame when the frame count is a multiple of 4, so the reference encoder dump is one frame longer there; pick golden clips that avoid it.", + "Punctuation and digits in vocab: WER depends on how the reference and normalizer treat them.", + "Standard parakeet TDT risks (joint duration, rel_pos shift, preemph ordering, per-feature norm, blank id)." + ], + "intake_gaps": [ + { + "field": "tokenizer.vocab_sha256", + "reason": "Computed at convert time." + } + ] +} diff --git a/reports/porting/parakeet/koyal-kn-120m-1.0/intake.json b/reports/porting/parakeet/koyal-kn-120m-1.0/intake.json new file mode 100644 index 000000000..f5a9c342f --- /dev/null +++ b/reports/porting/parakeet/koyal-kn-120m-1.0/intake.json @@ -0,0 +1,198 @@ +{ + "schema_version": "transcribe-intake-v1", + "family": "parakeet", + "hf_repo": "adalat-ai/koyal-kn-120m-1.0", + "hf_revision": "a169f0b9514dbc30ef8cca274430d160bf435341", + "sources": { + "config": { + "kind": "hf_file", + "path": "config.json", + "status": "missing", + "detail": "NeMo .nemo archive only; model_config.yaml inside it is the config." + }, + "preprocessor": { + "kind": "hf_file", + "path": "preprocessor_config.json", + "status": "missing", + "detail": "Inside .nemo as model.cfg.preprocessor: AudioToMelSpectrogramPreprocessor, 80 mels." + }, + "tokenizer_config": { + "kind": "hf_file", + "path": "tokenizer_config.json", + "status": "missing", + "detail": "SentencePiece BPE inside .nemo, vocab_size=512, punctuation and digits in vocab." + }, + "tokenizer_json": { + "kind": "hf_file", + "path": "tokenizer.json", + "status": "missing" + }, + "generation_config": { + "kind": "hf_file", + "path": "generation_config.json", + "status": "missing" + }, + "safetensors_metadata": { + "kind": "hf_api", + "path": "HfApi.get_safetensors_metadata", + "status": "missing", + "detail": "PyTorch state_dict inside .nemo" + }, + "model_card": { + "kind": "hf_api", + "path": "https://huggingface.co/adalat-ai/koyal-kn-120m-1.0", + "status": "found", + "detail": "Monolingual Kannada dictation model; rich-orthography output (punctuation, numerals); CC-BY-4.0; encoder warm-started from ai4bharat/MahaDhwani_pretrained_conformer." + }, + "reference_modeling_code": { + "kind": "reference_code", + "path": "scripts/convert-parakeet.py, src/arch/parakeet/, src/conformer/", + "status": "found", + "detail": "Existing TDT path applies after pre_encode; pre_encode is NeMo ConvSubsampling with subsampling=striding." + } + }, + "variants": [ + { + "name": "koyal-kn-120m-1.0", + "memory_gb": 0.5, + "files": [ + "koyal-kn-120m-1.0.nemo" + ] + } + ], + "config": { + "architecture_candidates": [ + "encoder-transducer" + ], + "key_fields": { + "architectures": [ + "EncDecHybridRNNTCTCBPEModel" + ], + "model_type": "conformer_tdt_ctc", + "encoder.type": "ConformerEncoder (classic Conformer, not FastConformer)", + "encoder.n_layers": 17, + "encoder.d_model": 512, + "encoder.n_heads": 8, + "encoder.ff_expansion_factor": 4, + "encoder.conv_kernel_size": 31, + "encoder.subsampling": "striding", + "encoder.subsampling_factor": 4, + "encoder.self_attention_model": "rel_pos", + "encoder.att_context_size": [ + -1, + -1 + ], + "decoder.type": "RNNTDecoder (predictor)", + "decoder.pred_hidden": 640, + "decoder.pred_rnn_layers": 1, + "joint.type": "RNNTJoint (TDT)", + "joint.joint_hidden": 640, + "joint.durations": [ + 0, + 1, + 2, + 3, + 4 + ], + "joint.num_extra_outputs": 5, + "ctc_decoder.type": "ConvASRDecoder", + "tokenizer.vocab_size": 512, + "tokenizer.has_punctuation_capitalization": true + }, + "varying_across_variants": [ + "tokenizer vocabulary (one language per variant)" + ] + }, + "dtype": { + "expected": "float32", + "source": "config", + "evidence": "NeMo .nemo, PyTorch state_dict at float32; model_config.yaml declares no other precision.", + "details": { + "config_declared": null, + "header_distribution": {} + }, + "expected_f32_tensors": [] + }, + "frontend": { + "sample_rate": 16000, + "n_mels": 80, + "hop_length": 160, + "fft_size": 512, + "window": "hann_periodic", + "normalization": "per_feature", + "preemphasis": 0.97, + "dither": 1e-05, + "center": true, + "padding_mode": "reflect", + "mel_filterbank_norm": "slaney" + }, + "tokenizer": { + "type": "sentencepiece", + "vocab_size": 512, + "special_tokens": { + "blank": 512 + }, + "has_language_tokens": false, + "vocab_sha256": null + }, + "capabilities": { + "languages": [ + "kn" + ], + "language_detection": false, + "translation": false, + "timestamps": [ + "token", + "word", + "segment" + ], + "streaming": false, + "speaker_diarization": false + }, + "upstream_benchmarks": [ + { + "dataset": "FLEURS-RO test", + "language": "kn", + "metric": "other", + "score": 11.3, + "score_unit": "percent", + "source": "https://huggingface.co/adalat-ai/koyal-kn-120m-1.0", + "notes": "WER_SCRIBE from the model card, 838 clips: scribe-eval alignment over all tokens, no text normalization, against rich-orthography references (adalat-ai/fleurs-ro)." + }, + { + "dataset": "FLEURS-RO test", + "language": "kn", + "metric": "wer", + "score": 18.44, + "score_unit": "percent", + "source": "https://huggingface.co/adalat-ai/koyal-kn-120m-1.0", + "notes": "jiwer WER on the same unnormalized text, from the model card." + }, + { + "dataset": "FLEURS-RO test", + "language": "kn", + "metric": "cer", + "score": 3.58, + "score_unit": "percent", + "source": "https://huggingface.co/adalat-ai/koyal-kn-120m-1.0", + "notes": "jiwer CER on the same unnormalized text, from the model card." + } + ], + "reference_framework": "nemo", + "reference_rationale": "Standard NeMo checkpoint with no custom code; same NeMo reference and dumper as the rest of the family.", + "architecture_pattern": "encoder-transducer", + "known_risks": [ + "Classic Conformer, not FastConformer: pre_encode is NeMo `striding` (conv0 plus one full 3x3 stride-2 conv, 4x), not `dw_striding` (8x). Needs its own subsampling path; frames are 40 ms.", + "Long-form local-attention window is sized in frames; at 4x it must be 512 frames to cover the same 20.5 s as 256 frames at 8x.", + "Hybrid TDT + CTC head sharing the encoder; ship TDT only, as for tdt_ctc-110m. The variant name has no `tdt_ctc`, so the converter needs an explicit flag to drop the aux CTC head.", + "NeMo keeps a masked padding frame when the frame count is a multiple of 4, so the reference encoder dump is one frame longer there; pick golden clips that avoid it.", + "Punctuation and digits in vocab: WER depends on how the reference and normalizer treat them.", + "Standard parakeet TDT risks (joint duration, rel_pos shift, preemph ordering, per-feature norm, blank id)." + ], + "intake_gaps": [ + { + "field": "tokenizer.vocab_sha256", + "reason": "Computed at convert time." + } + ] +} diff --git a/reports/porting/parakeet/koyal-ml-120m-1.0/intake.json b/reports/porting/parakeet/koyal-ml-120m-1.0/intake.json new file mode 100644 index 000000000..9ee4309d3 --- /dev/null +++ b/reports/porting/parakeet/koyal-ml-120m-1.0/intake.json @@ -0,0 +1,198 @@ +{ + "schema_version": "transcribe-intake-v1", + "family": "parakeet", + "hf_repo": "adalat-ai/koyal-ml-120m-1.0", + "hf_revision": "8135bc822466bf70d75c238041c585040b56e9f8", + "sources": { + "config": { + "kind": "hf_file", + "path": "config.json", + "status": "missing", + "detail": "NeMo .nemo archive only; model_config.yaml inside it is the config." + }, + "preprocessor": { + "kind": "hf_file", + "path": "preprocessor_config.json", + "status": "missing", + "detail": "Inside .nemo as model.cfg.preprocessor: AudioToMelSpectrogramPreprocessor, 80 mels." + }, + "tokenizer_config": { + "kind": "hf_file", + "path": "tokenizer_config.json", + "status": "missing", + "detail": "SentencePiece BPE inside .nemo, vocab_size=512, punctuation and digits in vocab." + }, + "tokenizer_json": { + "kind": "hf_file", + "path": "tokenizer.json", + "status": "missing" + }, + "generation_config": { + "kind": "hf_file", + "path": "generation_config.json", + "status": "missing" + }, + "safetensors_metadata": { + "kind": "hf_api", + "path": "HfApi.get_safetensors_metadata", + "status": "missing", + "detail": "PyTorch state_dict inside .nemo" + }, + "model_card": { + "kind": "hf_api", + "path": "https://huggingface.co/adalat-ai/koyal-ml-120m-1.0", + "status": "found", + "detail": "Monolingual Malayalam dictation model; rich-orthography output (punctuation, numerals); CC-BY-4.0; encoder warm-started from ai4bharat/MahaDhwani_pretrained_conformer." + }, + "reference_modeling_code": { + "kind": "reference_code", + "path": "scripts/convert-parakeet.py, src/arch/parakeet/, src/conformer/", + "status": "found", + "detail": "Existing TDT path applies after pre_encode; pre_encode is NeMo ConvSubsampling with subsampling=striding." + } + }, + "variants": [ + { + "name": "koyal-ml-120m-1.0", + "memory_gb": 0.5, + "files": [ + "koyal-ml-120m-1.0.nemo" + ] + } + ], + "config": { + "architecture_candidates": [ + "encoder-transducer" + ], + "key_fields": { + "architectures": [ + "EncDecHybridRNNTCTCBPEModel" + ], + "model_type": "conformer_tdt_ctc", + "encoder.type": "ConformerEncoder (classic Conformer, not FastConformer)", + "encoder.n_layers": 17, + "encoder.d_model": 512, + "encoder.n_heads": 8, + "encoder.ff_expansion_factor": 4, + "encoder.conv_kernel_size": 31, + "encoder.subsampling": "striding", + "encoder.subsampling_factor": 4, + "encoder.self_attention_model": "rel_pos", + "encoder.att_context_size": [ + -1, + -1 + ], + "decoder.type": "RNNTDecoder (predictor)", + "decoder.pred_hidden": 640, + "decoder.pred_rnn_layers": 1, + "joint.type": "RNNTJoint (TDT)", + "joint.joint_hidden": 640, + "joint.durations": [ + 0, + 1, + 2, + 3, + 4 + ], + "joint.num_extra_outputs": 5, + "ctc_decoder.type": "ConvASRDecoder", + "tokenizer.vocab_size": 512, + "tokenizer.has_punctuation_capitalization": true + }, + "varying_across_variants": [ + "tokenizer vocabulary (one language per variant)" + ] + }, + "dtype": { + "expected": "float32", + "source": "config", + "evidence": "NeMo .nemo, PyTorch state_dict at float32; model_config.yaml declares no other precision.", + "details": { + "config_declared": null, + "header_distribution": {} + }, + "expected_f32_tensors": [] + }, + "frontend": { + "sample_rate": 16000, + "n_mels": 80, + "hop_length": 160, + "fft_size": 512, + "window": "hann_periodic", + "normalization": "per_feature", + "preemphasis": 0.97, + "dither": 1e-05, + "center": true, + "padding_mode": "reflect", + "mel_filterbank_norm": "slaney" + }, + "tokenizer": { + "type": "sentencepiece", + "vocab_size": 512, + "special_tokens": { + "blank": 512 + }, + "has_language_tokens": false, + "vocab_sha256": null + }, + "capabilities": { + "languages": [ + "ml" + ], + "language_detection": false, + "translation": false, + "timestamps": [ + "token", + "word", + "segment" + ], + "streaming": false, + "speaker_diarization": false + }, + "upstream_benchmarks": [ + { + "dataset": "FLEURS-RO test", + "language": "ml", + "metric": "other", + "score": 14.74, + "score_unit": "percent", + "source": "https://huggingface.co/adalat-ai/koyal-ml-120m-1.0", + "notes": "WER_SCRIBE from the model card, 957 clips: scribe-eval alignment over all tokens, no text normalization, against rich-orthography references (adalat-ai/fleurs-ro)." + }, + { + "dataset": "FLEURS-RO test", + "language": "ml", + "metric": "wer", + "score": 22.69, + "score_unit": "percent", + "source": "https://huggingface.co/adalat-ai/koyal-ml-120m-1.0", + "notes": "jiwer WER on the same unnormalized text, from the model card." + }, + { + "dataset": "FLEURS-RO test", + "language": "ml", + "metric": "cer", + "score": 3.47, + "score_unit": "percent", + "source": "https://huggingface.co/adalat-ai/koyal-ml-120m-1.0", + "notes": "jiwer CER on the same unnormalized text, from the model card." + } + ], + "reference_framework": "nemo", + "reference_rationale": "Standard NeMo checkpoint with no custom code; same NeMo reference and dumper as the rest of the family.", + "architecture_pattern": "encoder-transducer", + "known_risks": [ + "Classic Conformer, not FastConformer: pre_encode is NeMo `striding` (conv0 plus one full 3x3 stride-2 conv, 4x), not `dw_striding` (8x). Needs its own subsampling path; frames are 40 ms.", + "Long-form local-attention window is sized in frames; at 4x it must be 512 frames to cover the same 20.5 s as 256 frames at 8x.", + "Hybrid TDT + CTC head sharing the encoder; ship TDT only, as for tdt_ctc-110m. The variant name has no `tdt_ctc`, so the converter needs an explicit flag to drop the aux CTC head.", + "NeMo keeps a masked padding frame when the frame count is a multiple of 4, so the reference encoder dump is one frame longer there; pick golden clips that avoid it.", + "Punctuation and digits in vocab: WER depends on how the reference and normalizer treat them.", + "Standard parakeet TDT risks (joint duration, rel_pos shift, preemph ordering, per-feature norm, blank id)." + ], + "intake_gaps": [ + { + "field": "tokenizer.vocab_sha256", + "reason": "Computed at convert time." + } + ] +} diff --git a/reports/porting/parakeet/koyal-te-120m-1.0/intake.json b/reports/porting/parakeet/koyal-te-120m-1.0/intake.json new file mode 100644 index 000000000..a241d25fc --- /dev/null +++ b/reports/porting/parakeet/koyal-te-120m-1.0/intake.json @@ -0,0 +1,198 @@ +{ + "schema_version": "transcribe-intake-v1", + "family": "parakeet", + "hf_repo": "adalat-ai/koyal-te-120m-1.0", + "hf_revision": "1f301af81e7865326e204c6ad90772b4b50c0c03", + "sources": { + "config": { + "kind": "hf_file", + "path": "config.json", + "status": "missing", + "detail": "NeMo .nemo archive only; model_config.yaml inside it is the config." + }, + "preprocessor": { + "kind": "hf_file", + "path": "preprocessor_config.json", + "status": "missing", + "detail": "Inside .nemo as model.cfg.preprocessor: AudioToMelSpectrogramPreprocessor, 80 mels." + }, + "tokenizer_config": { + "kind": "hf_file", + "path": "tokenizer_config.json", + "status": "missing", + "detail": "SentencePiece BPE inside .nemo, vocab_size=512, punctuation and digits in vocab." + }, + "tokenizer_json": { + "kind": "hf_file", + "path": "tokenizer.json", + "status": "missing" + }, + "generation_config": { + "kind": "hf_file", + "path": "generation_config.json", + "status": "missing" + }, + "safetensors_metadata": { + "kind": "hf_api", + "path": "HfApi.get_safetensors_metadata", + "status": "missing", + "detail": "PyTorch state_dict inside .nemo" + }, + "model_card": { + "kind": "hf_api", + "path": "https://huggingface.co/adalat-ai/koyal-te-120m-1.0", + "status": "found", + "detail": "Monolingual Telugu dictation model; rich-orthography output (punctuation, numerals); CC-BY-4.0; encoder warm-started from ai4bharat/MahaDhwani_pretrained_conformer." + }, + "reference_modeling_code": { + "kind": "reference_code", + "path": "scripts/convert-parakeet.py, src/arch/parakeet/, src/conformer/", + "status": "found", + "detail": "Existing TDT path applies after pre_encode; pre_encode is NeMo ConvSubsampling with subsampling=striding." + } + }, + "variants": [ + { + "name": "koyal-te-120m-1.0", + "memory_gb": 0.5, + "files": [ + "koyal-te-120m-1.0.nemo" + ] + } + ], + "config": { + "architecture_candidates": [ + "encoder-transducer" + ], + "key_fields": { + "architectures": [ + "EncDecHybridRNNTCTCBPEModel" + ], + "model_type": "conformer_tdt_ctc", + "encoder.type": "ConformerEncoder (classic Conformer, not FastConformer)", + "encoder.n_layers": 17, + "encoder.d_model": 512, + "encoder.n_heads": 8, + "encoder.ff_expansion_factor": 4, + "encoder.conv_kernel_size": 31, + "encoder.subsampling": "striding", + "encoder.subsampling_factor": 4, + "encoder.self_attention_model": "rel_pos", + "encoder.att_context_size": [ + -1, + -1 + ], + "decoder.type": "RNNTDecoder (predictor)", + "decoder.pred_hidden": 640, + "decoder.pred_rnn_layers": 1, + "joint.type": "RNNTJoint (TDT)", + "joint.joint_hidden": 640, + "joint.durations": [ + 0, + 1, + 2, + 3, + 4 + ], + "joint.num_extra_outputs": 5, + "ctc_decoder.type": "ConvASRDecoder", + "tokenizer.vocab_size": 512, + "tokenizer.has_punctuation_capitalization": true + }, + "varying_across_variants": [ + "tokenizer vocabulary (one language per variant)" + ] + }, + "dtype": { + "expected": "float32", + "source": "config", + "evidence": "NeMo .nemo, PyTorch state_dict at float32; model_config.yaml declares no other precision.", + "details": { + "config_declared": null, + "header_distribution": {} + }, + "expected_f32_tensors": [] + }, + "frontend": { + "sample_rate": 16000, + "n_mels": 80, + "hop_length": 160, + "fft_size": 512, + "window": "hann_periodic", + "normalization": "per_feature", + "preemphasis": 0.97, + "dither": 1e-05, + "center": true, + "padding_mode": "reflect", + "mel_filterbank_norm": "slaney" + }, + "tokenizer": { + "type": "sentencepiece", + "vocab_size": 512, + "special_tokens": { + "blank": 512 + }, + "has_language_tokens": false, + "vocab_sha256": null + }, + "capabilities": { + "languages": [ + "te" + ], + "language_detection": false, + "translation": false, + "timestamps": [ + "token", + "word", + "segment" + ], + "streaming": false, + "speaker_diarization": false + }, + "upstream_benchmarks": [ + { + "dataset": "FLEURS-RO test", + "language": "te", + "metric": "other", + "score": 17.81, + "score_unit": "percent", + "source": "https://huggingface.co/adalat-ai/koyal-te-120m-1.0", + "notes": "WER_SCRIBE from the model card, 466 clips: scribe-eval alignment over all tokens, no text normalization, against rich-orthography references (adalat-ai/fleurs-ro)." + }, + { + "dataset": "FLEURS-RO test", + "language": "te", + "metric": "wer", + "score": 24.49, + "score_unit": "percent", + "source": "https://huggingface.co/adalat-ai/koyal-te-120m-1.0", + "notes": "jiwer WER on the same unnormalized text, from the model card." + }, + { + "dataset": "FLEURS-RO test", + "language": "te", + "metric": "cer", + "score": 5.12, + "score_unit": "percent", + "source": "https://huggingface.co/adalat-ai/koyal-te-120m-1.0", + "notes": "jiwer CER on the same unnormalized text, from the model card." + } + ], + "reference_framework": "nemo", + "reference_rationale": "Standard NeMo checkpoint with no custom code; same NeMo reference and dumper as the rest of the family.", + "architecture_pattern": "encoder-transducer", + "known_risks": [ + "Classic Conformer, not FastConformer: pre_encode is NeMo `striding` (conv0 plus one full 3x3 stride-2 conv, 4x), not `dw_striding` (8x). Needs its own subsampling path; frames are 40 ms.", + "Long-form local-attention window is sized in frames; at 4x it must be 512 frames to cover the same 20.5 s as 256 frames at 8x.", + "Hybrid TDT + CTC head sharing the encoder; ship TDT only, as for tdt_ctc-110m. The variant name has no `tdt_ctc`, so the converter needs an explicit flag to drop the aux CTC head.", + "NeMo keeps a masked padding frame when the frame count is a multiple of 4, so the reference encoder dump is one frame longer there; pick golden clips that avoid it.", + "Punctuation and digits in vocab: WER depends on how the reference and normalizer treat them.", + "Standard parakeet TDT risks (joint duration, rel_pos shift, preemph ordering, per-feature norm, blank id)." + ], + "intake_gaps": [ + { + "field": "tokenizer.vocab_sha256", + "reason": "Computed at convert time." + } + ] +} diff --git a/samples/README.md b/samples/README.md index 29a263c70..836469e8b 100644 --- a/samples/README.md +++ b/samples/README.md @@ -24,12 +24,20 @@ and is recorded here so each clip can be traced back. | --- | ---: | --- | --- | | `ar-short.wav` | 11.00 s | `ar_eg` | 13811922940508003061 | | `ar-long.wav` | 25.74 s | `ar_eg` | 12943222207631713208 | +| `hi-short.wav` | 11.10 s | `hi_in` | 6841351942797213585 | +| `hi-long.wav` | 31.44 s | `hi_in` | 13003185437122223029 | | `ja-short.wav` | 10.98 s | `ja_jp` | 8296538110626558656 | | `ja-long.wav` | 28.20 s | `ja_jp` | 9518252661993015549 | +| `kn-short.wav` | 10.98 s | `kn_in` | 11745767637797294409 | +| `kn-long.wav` | 39.60 s | `kn_in` | 14995331220904255321 | | `ko-short.wav` | 10.98 s | `ko_kr` | 11859537746411417197 | | `ko-long.wav` | 25.80 s | `ko_kr` | 15152963524414515048 | +| `ml-short.wav` | 10.98 s | `ml_in` | 10988344509843990269 | +| `ml-long.wav` | 48.00 s | `ml_in` | 9536318041481180667 | | `ru-short.wav` | 10.98 s | `ru_ru` | 2668014690611039917 | | `ru-long.wav` | 33.84 s | `ru_ru` | 10388523902227354213 | +| `te-short.wav` | 10.98 s | `te_in` | 14166349555090119249 | +| `te-long.wav` | 30.48 s | `te_in` | 13517516457085833867 | | `uk-short.wav` | 10.98 s | `uk_ua` | 7177130321767122387 | | `uk-long.wav` | 28.92 s | `uk_ua` | 12340201221281017924 | | `vi-short.wav` | 10.98 s | `vi_vn` | 9897090359729012443 | diff --git a/samples/hi-long.wav b/samples/hi-long.wav new file mode 100644 index 000000000..67c2edcbd Binary files /dev/null and b/samples/hi-long.wav differ diff --git a/samples/hi-short.wav b/samples/hi-short.wav new file mode 100644 index 000000000..eef0aa173 Binary files /dev/null and b/samples/hi-short.wav differ diff --git a/samples/kn-long.wav b/samples/kn-long.wav new file mode 100644 index 000000000..49c1244ac Binary files /dev/null and b/samples/kn-long.wav differ diff --git a/samples/kn-short.wav b/samples/kn-short.wav new file mode 100644 index 000000000..44cf67783 Binary files /dev/null and b/samples/kn-short.wav differ diff --git a/samples/ml-long.wav b/samples/ml-long.wav new file mode 100644 index 000000000..5fbfa237d Binary files /dev/null and b/samples/ml-long.wav differ diff --git a/samples/ml-short.wav b/samples/ml-short.wav new file mode 100644 index 000000000..9b8d62b66 Binary files /dev/null and b/samples/ml-short.wav differ diff --git a/samples/te-long.wav b/samples/te-long.wav new file mode 100644 index 000000000..13023d2c5 Binary files /dev/null and b/samples/te-long.wav differ diff --git a/samples/te-short.wav b/samples/te-short.wav new file mode 100644 index 000000000..54713b6c4 Binary files /dev/null and b/samples/te-short.wav differ diff --git a/scripts/convert-parakeet.py b/scripts/convert-parakeet.py index 13faba26e..36884ab6a 100644 --- a/scripts/convert-parakeet.py +++ b/scripts/convert-parakeet.py @@ -339,6 +339,68 @@ "license_name": "Creative Commons Attribution 4.0", "license_link": "https://creativecommons.org/licenses/by/4.0/", }, + # Adalat AI Koyal 120M monolingual models (hi / kn / ml / te): hybrid + # TDT+CTC on a classic Conformer encoder (17L / d_model=512 / kernel=31), + # warm-started from AI4Bharat MahaDhwani; the four cfgs differ only in + # language. Their pre_encode is NeMo `striding` (two full k=3 s=2 convs, + # 4x), not FastConformer `dw_striding`. Shipped TDT-only, dropping the aux + # CTC head, like parakeet-tdt_ctc-110m / -1.1b. + "koyal-hi-120m-1.0": { + "variant": "koyal-hi-120m-1.0", + "display_name": "Koyal Hindi 120M", + "version": "v1", + "size_label": "120M", + "head_kind": "tdt", + "drop_aux_ctc": True, + "expected_vocab_size": 512, + "languages": ["hi"], + "lang_detect": False, + "license": "cc-by-4.0", + "license_name": "Creative Commons Attribution 4.0", + "license_link": "https://creativecommons.org/licenses/by/4.0/", + }, + "koyal-kn-120m-1.0": { + "variant": "koyal-kn-120m-1.0", + "display_name": "Koyal Kannada 120M", + "version": "v1", + "size_label": "120M", + "head_kind": "tdt", + "drop_aux_ctc": True, + "expected_vocab_size": 512, + "languages": ["kn"], + "lang_detect": False, + "license": "cc-by-4.0", + "license_name": "Creative Commons Attribution 4.0", + "license_link": "https://creativecommons.org/licenses/by/4.0/", + }, + "koyal-ml-120m-1.0": { + "variant": "koyal-ml-120m-1.0", + "display_name": "Koyal Malayalam 120M", + "version": "v1", + "size_label": "120M", + "head_kind": "tdt", + "drop_aux_ctc": True, + "expected_vocab_size": 512, + "languages": ["ml"], + "lang_detect": False, + "license": "cc-by-4.0", + "license_name": "Creative Commons Attribution 4.0", + "license_link": "https://creativecommons.org/licenses/by/4.0/", + }, + "koyal-te-120m-1.0": { + "variant": "koyal-te-120m-1.0", + "display_name": "Koyal Telugu 120M", + "version": "v1", + "size_label": "120M", + "head_kind": "tdt", + "drop_aux_ctc": True, + "expected_vocab_size": 512, + "languages": ["te"], + "lang_detect": False, + "license": "cc-by-4.0", + "license_name": "Creative Commons Attribution 4.0", + "license_link": "https://creativecommons.org/licenses/by/4.0/", + }, # 1.1B English hybrid TDT+CTC. Same TDT-only shipping decision. # Marked `prefer_direct_load=True` so the converter bypasses # NeMo's restore_from() extraction (~4.4 GB transient disk) and @@ -1145,14 +1207,25 @@ def read_hparams(config: dict) -> dict: f"converter only handles AudioToMelSpectrogramPreprocessor" ) + # pre_encode kind: dw_striding (FastConformer) or striding (classic + # Conformer). Absent = dw_striding: the HF-safetensors path + # (parakeet-ultra) builds its cfg without the key. The runtime checks + # the kind against subsampling_factor. + subsampling = str(enc.get("subsampling", "dw_striding")) + # NeMo resolves subsampling_conv_channels=-1 to d_model. + subsampling_channels = int(enc["subsampling_conv_channels"]) + if subsampling_channels == -1: + subsampling_channels = int(enc["d_model"]) + return { "enc_n_layers": int(enc["n_layers"]), "enc_d_model": int(enc["d_model"]), "enc_n_heads": int(enc["n_heads"]), "enc_d_ff": int(enc["d_model"]) * int(enc["ff_expansion_factor"]), "enc_conv_kernel": int(enc["conv_kernel_size"]), + "enc_subsampling": subsampling, "enc_subsampling_factor": int(enc["subsampling_factor"]), - "enc_subsampling_channels": int(enc["subsampling_conv_channels"]), + "enc_subsampling_channels": subsampling_channels, "enc_pos_emb_max_len": int(enc["pos_emb_max_len"]), # xscaling: NeMo's RelPositionalEncoding multiplies x by # sqrt(d_model) before generating pos_emb when this flag is @@ -1642,7 +1715,9 @@ def convert(model_spec: str, out_path: Path, repo_id: str | None = None, profile = VARIANT_PROFILES[slug] head_kind = profile["head_kind"] prefer_direct = bool(profile.get("prefer_direct_load", False)) - drop_aux_ctc = "tdt_ctc" in slug # hybrid checkpoints carry an aux CTC head we drop + # Hybrid checkpoints carry an aux CTC head we drop: the tdt_ctc-* slugs, + # or a profile that sets drop_aux_ctc (koyal-*-120m-1.0). + drop_aux_ctc = "tdt_ctc" in slug or bool(profile.get("drop_aux_ctc", False)) has_prompt = bool(profile.get("has_prompt", False)) # The profile opts the variant into speaker-kernel conversion. spk_kernel_layers = [int(l) for l in (profile.get("spk_kernel_layers") or [])] @@ -1855,6 +1930,10 @@ def convert(model_spec: str, out_path: Path, repo_id: str | None = None, writer.add_uint32("stt.parakeet.encoder.n_heads", hp["enc_n_heads"]) writer.add_uint32("stt.parakeet.encoder.d_ff", hp["enc_d_ff"]) writer.add_uint32("stt.parakeet.encoder.conv_kernel", hp["enc_conv_kernel"]) + # Written only for the non-default kind, so dw_striding GGUFs stay + # byte-identical; the loader treats an absent key as dw_striding. + if hp.get("enc_subsampling", "dw_striding") != "dw_striding": + writer.add_string("stt.parakeet.encoder.subsampling", hp["enc_subsampling"]) writer.add_uint32("stt.parakeet.encoder.subsampling_factor", hp["enc_subsampling_factor"]) writer.add_uint32("stt.parakeet.encoder.subsampling_channels", hp["enc_subsampling_channels"]) writer.add_uint32("stt.parakeet.encoder.pos_emb_max_len", hp["enc_pos_emb_max_len"]) @@ -2092,8 +2171,14 @@ def add_combined(nemo_a: str, nemo_b: str, gguf_name: str) -> None: bytes_out += int(arr.nbytes) n_added += 1 - # pre_encode + # pre_encode. striding has only conv.0 and conv.2 (both full convs); + # conv.3 / .5 / .6 are dw_striding's depthwise-separable pairs. + striding = hp.get("enc_subsampling", "dw_striding") == "striding" for nemo_name, gguf_name in PRE_ENCODE_TABLE: + if striding and nemo_name.startswith(("encoder.pre_encode.conv.3.", + "encoder.pre_encode.conv.5.", + "encoder.pre_encode.conv.6.")): + continue add(nemo_name, gguf_name) # encoder layers @@ -2190,8 +2275,10 @@ def add_combined(nemo_a: str, nemo_b: str, gguf_name: str) -> None: else: spk_tensors = 0 vad_tensors = len(VAD_HEAD_TABLE) if has_vad_head else 0 + # striding skips conv.3 / .5 / .6 (weight + bias each). + pre_encode_tensors = len(PRE_ENCODE_TABLE) - (6 if striding else 0) expected = ( - len(PRE_ENCODE_TABLE) + pre_encode_tensors + hp["enc_n_layers"] * per_layer_tensors + head_tensors + prompt_tensors diff --git a/src/arch/parakeet/encoder.cpp b/src/arch/parakeet/encoder.cpp index ba0e62539..4fd5c6cfb 100644 --- a/src/arch/parakeet/encoder.cpp +++ b/src/arch/parakeet/encoder.cpp @@ -339,7 +339,8 @@ EncoderBuild build_encoder_graph(ggml_context * ctx, // CausalConv2D for the pre-encode subsample (left=k-1, right=stride-1). // Inferred from the attention style — only ChunkedLimited is causal. // Independent of the conformer conv-module's conv_context. - policy.causal_pre_encode = (hp.enc_att_context_style == ParakeetHParams::AttContextStyle::ChunkedLimited); + policy.causal_pre_encode = (hp.enc_att_context_style == ParakeetHParams::AttContextStyle::ChunkedLimited); + policy.striding_pre_encode = (hp.enc_pre_encode_kind == ParakeetHParams::PreEncodeKind::Striding); EncoderBuild eb{}; @@ -351,13 +352,15 @@ EncoderBuild build_encoder_graph(ggml_context * ctx, return eb; } - // Only subsampling_factor=8 (every published variant) is implemented; - // a different factor would need a build_pre_encode rework. - if (hp.enc_subsampling_factor != 8) { + // build_pre_encode implements two pre_encode kinds, each at one factor: + // dw_striding at 8x (causal or not) and striding at 4x (non-causal only; + // a chunked_limited striding model is rejected). Any other kind or + // factor, or causal striding, needs a build_pre_encode rework. + const int want_factor = policy.striding_pre_encode ? 4 : 8; + if (hp.enc_subsampling_factor != want_factor || (policy.striding_pre_encode && policy.causal_pre_encode)) { log_msg(TRANSCRIBE_LOG_LEVEL_ERROR, - "parakeet encoder: unsupported subsampling_factor=%d " - "(only 8 implemented)", - hp.enc_subsampling_factor); + "parakeet encoder: unsupported pre_encode (subsampling_factor=%d, striding=%d, causal=%d)", + hp.enc_subsampling_factor, policy.striding_pre_encode ? 1 : 0, policy.causal_pre_encode ? 1 : 0); return eb; } if (hp.fe_num_mels <= 0 || (hp.fe_num_mels % hp.enc_subsampling_factor) != 0) { diff --git a/src/arch/parakeet/model.cpp b/src/arch/parakeet/model.cpp index 8ade1bb15..557689dab 100644 --- a/src/arch/parakeet/model.cpp +++ b/src/arch/parakeet/model.cpp @@ -713,13 +713,15 @@ static void normalize_transcript_whitespace(std::string & s) { } // Valid length of each pre_encode stage: [0] = mel frames (n_samples / hop -// under kestrel masking), [1..3] = after each stride-2 conv. +// under kestrel masking), [1..3] = after each stride-2 conv. striding (4x) +// has two stages; its [3] repeats [2], so [3] is the encoder length either way. static std::array pre_encode_stage_lengths(const ParakeetHParams & hp, int n_samples, int mel_frames) { const bool causal = (hp.enc_att_context_style == ParakeetHParams::AttContextStyle::ChunkedLimited); std::array len{}; len[0] = hp.kestrel_length_masking ? n_samples / hp.fe_hop_length : mel_frames; for (int d = 1; d < 4; ++d) { - len[static_cast(d)] = pre_encode_time_out(len[static_cast(d - 1)], causal); + const int prev = len[static_cast(d - 1)]; + len[static_cast(d)] = d <= hp.pre_encode_stages() ? pre_encode_time_out(prev, causal) : prev; } return len; } diff --git a/src/arch/parakeet/weights.cpp b/src/arch/parakeet/weights.cpp index 4247ec7cf..0a31965fc 100644 --- a/src/arch/parakeet/weights.cpp +++ b/src/arch/parakeet/weights.cpp @@ -67,6 +67,26 @@ transcribe_status read_parakeet_hparams(const gguf_context * gguf, ParakeetHPara st != TRANSCRIBE_OK) { return st; } + // pre_encode kind. Optional KV, default "dw_striding" for every GGUF + // written before striding support. The encoder checks the kind against + // subsampling_factor at graph build. + { + std::string kind; + if (auto st = + read_optional_string_kv(gguf, "stt.parakeet.encoder.subsampling", kFamilyTag, "dw_striding", kind); + st != TRANSCRIBE_OK) { + return st; + } + if (kind == "dw_striding") { + hp.enc_pre_encode_kind = ParakeetHParams::PreEncodeKind::DwStriding; + } else if (kind == "striding") { + hp.enc_pre_encode_kind = ParakeetHParams::PreEncodeKind::Striding; + } else { + log_msg(TRANSCRIBE_LOG_LEVEL_ERROR, + "parakeet: unsupported encoder.subsampling \"%s\" (allowed: dw_striding, striding)", kind.c_str()); + return TRANSCRIBE_ERR_GGUF; + } + } if (auto st = read_required_u32_kv(gguf, "stt.parakeet.encoder.pos_emb_max_len", kFamilyTag, hp.enc_pos_emb_max_len); st != TRANSCRIBE_OK) { @@ -539,7 +559,9 @@ transcribe_status read_parakeet_hparams(const gguf_context * gguf, ParakeetHPara // ships with. kestrel-masked checkpoints (parakeet-ultra) keep full // attention: they cut long audio at pauses and their contract is // kestrel's output. The streaming styles keep their trained menus. - constexpr int kLongformAttContext = 256; + // The window is 256 frames at 8x subsampling; a 4x encoder (striding, + // 40 ms frames) gets 512 so it still covers 20.5 s exactly. + const int kLongformAttContext = hp.enc_pre_encode_kind == ParakeetHParams::PreEncodeKind::Striding ? 512 : 256; if (hp.enc_att_context_style == ParakeetHParams::AttContextStyle::Regular && hp.enc_att_context_left < 0 && hp.enc_att_context_right < 0 && !hp.kestrel_length_masking) { hp.enc_att_context_left = kLongformAttContext; @@ -880,8 +902,9 @@ transcribe_status build_parakeet_weights(ggml_context * ctx_meta, const int64_t joint_n = hp.joint_n_classes(); // meaningless for CTC; we read CTC head shape instead // The flattened "freq" axis into pre_encode.out is - // (subsampling_channels * F'), where F' is the freq dim after three - // k=3 s=2 convs. Padding tracks NeMo's causal_downsampling (inferred + // (subsampling_channels * F'), where F' is the freq dim after the + // k=3 s=2 convs (three for dw_striding, two for striding: 80→40→20; + // 512*20=10240 on koyal-ml-120m-1.0). Padding tracks NeMo's causal_downsampling (inferred // from the attention style — only ChunkedLimited is causal), NOT the // conformer conv_context_size: // non-causal: symmetric (k-1)/2 both sides. 128→64→32→16; 256*16=4096. @@ -893,7 +916,7 @@ transcribe_status build_parakeet_weights(ggml_context * ctx_meta, // (k-1) + (s-1) = 3 for causal. const int total_pad = causal ? ((k - 1) + (s - 1)) : ((k - 1) / 2 + (k - 1) / 2); int dim = hp.fe_num_mels; - for (int i = 0; i < 3; ++i) { + for (int i = 0; i < hp.pre_encode_stages(); ++i) { dim = ((dim + total_pad - k) / s) + 1; } return static_cast(dim); @@ -907,14 +930,19 @@ transcribe_status build_parakeet_weights(ggml_context * ctx_meta, // 1×1 pointwise convs collapse to [1, 1, in, out]. GET_CONV(weights.pre_encode.conv0_w, "enc.pre_encode.conv.0.weight", 3, 3, 1, channels); GET_F32(weights.pre_encode.conv0_b, "enc.pre_encode.conv.0.bias", channels); - GET_CONV(weights.pre_encode.conv2_w, "enc.pre_encode.conv.2.weight", 3, 3, 1, channels); - GET_F32(weights.pre_encode.conv2_b, "enc.pre_encode.conv.2.bias", channels); - GET_CONV(weights.pre_encode.conv3_w, "enc.pre_encode.conv.3.weight", 1, 1, channels, channels); - GET_F32(weights.pre_encode.conv3_b, "enc.pre_encode.conv.3.bias", channels); - GET_CONV(weights.pre_encode.conv5_w, "enc.pre_encode.conv.5.weight", 3, 3, 1, channels); - GET_F32(weights.pre_encode.conv5_b, "enc.pre_encode.conv.5.bias", channels); - GET_CONV(weights.pre_encode.conv6_w, "enc.pre_encode.conv.6.weight", 1, 1, channels, channels); - GET_F32(weights.pre_encode.conv6_b, "enc.pre_encode.conv.6.bias", channels); + if (hp.enc_pre_encode_kind == ParakeetHParams::PreEncodeKind::Striding) { + GET_CONV(weights.pre_encode.conv2_w, "enc.pre_encode.conv.2.weight", 3, 3, channels, channels); + GET_F32(weights.pre_encode.conv2_b, "enc.pre_encode.conv.2.bias", channels); + } else { + GET_CONV(weights.pre_encode.conv2_w, "enc.pre_encode.conv.2.weight", 3, 3, 1, channels); + GET_F32(weights.pre_encode.conv2_b, "enc.pre_encode.conv.2.bias", channels); + GET_CONV(weights.pre_encode.conv3_w, "enc.pre_encode.conv.3.weight", 1, 1, channels, channels); + GET_F32(weights.pre_encode.conv3_b, "enc.pre_encode.conv.3.bias", channels); + GET_CONV(weights.pre_encode.conv5_w, "enc.pre_encode.conv.5.weight", 3, 3, 1, channels); + GET_F32(weights.pre_encode.conv5_b, "enc.pre_encode.conv.5.bias", channels); + GET_CONV(weights.pre_encode.conv6_w, "enc.pre_encode.conv.6.weight", 1, 1, channels, channels); + GET_F32(weights.pre_encode.conv6_b, "enc.pre_encode.conv.6.bias", channels); + } GET_LIN(weights.pre_encode.out_w, "enc.pre_encode.out.weight", pre_encode_in, d_model); GET_F32(weights.pre_encode.out_b, "enc.pre_encode.out.bias", d_model); diff --git a/src/arch/parakeet/weights.h b/src/arch/parakeet/weights.h index 885dfea53..35125962d 100644 --- a/src/arch/parakeet/weights.h +++ b/src/arch/parakeet/weights.h @@ -76,6 +76,17 @@ struct ParakeetHParams { int32_t enc_att_context_left = -1; int32_t enc_att_context_right = -1; + // pre_encode kind (stt.parakeet.encoder.subsampling string KV; absent = + // dw_striding). The encoder checks each kind's factor at graph build: + // DwStriding — FastConformer: conv0 + 2 depthwise-separable pairs, 8x. + // Striding — classic Conformer: conv0 + one full conv (conv2), 4x + // (koyal-*-120m-1.0). + enum class PreEncodeKind { DwStriding, Striding }; + PreEncodeKind enc_pre_encode_kind = PreEncodeKind::DwStriding; + + // Number of stride-2 conv stages in pre_encode (3 or 2). + int pre_encode_stages() const { return enc_pre_encode_kind == PreEncodeKind::Striding ? 2 : 3; } + // Multi-lookahead training menu for cache-aware streaming models. A // flat GGUF int32 array [L0,R0,L1,R1,...]; index 0 is the default // (max-context) setting and always equals (enc_att_context_left, @@ -265,9 +276,11 @@ struct ParakeetPreEncode { // dw_striding subsampling: 1 standard conv + 2 depthwise-separable // conv pairs = 8x time downsampling. Indices follow NeMo's // torch.nn.Sequential (1 and 4 are activation modules, skipped). + // striding subsampling (PreEncodeKind::Striding): conv0 and conv2 only, + // both full convs (conv2 in=channels); conv3/5/6 stay null. ggml_tensor * conv0_w = nullptr; // [out=channels, in=1, kh=3, kw=3] ggml_tensor * conv0_b = nullptr; // [channels] - ggml_tensor * conv2_w = nullptr; // [out=channels, in=1 (dw), kh=3, kw=3] + ggml_tensor * conv2_w = nullptr; // [out=channels, in=1 (dw) or channels (striding), kh=3, kw=3] ggml_tensor * conv2_b = nullptr; // [channels] ggml_tensor * conv3_w = nullptr; // [out=channels, in=channels, kh=1, kw=1] ggml_tensor * conv3_b = nullptr; // [channels] diff --git a/src/conformer/conformer.cpp b/src/conformer/conformer.cpp index 9b6c2ded0..0f36b5a0c 100644 --- a/src/conformer/conformer.cpp +++ b/src/conformer/conformer.cpp @@ -1134,6 +1134,61 @@ ggml_tensor * name_prefixed(ggml_tensor * t, const char * prefix, const char * s return t; } +// Final pre_encode step shared by both subsampling kinds: flatten the conv +// stack's [F', T_enc, C, B] output into [F'*C, T_enc, B] and project it to +// d_model. Returns nullptr on a pre_encode_in / out_w shape mismatch. +ggml_tensor * pre_encode_flatten_project(ggml_context * ctx, + ggml_tensor * x, + const PreEncodeView & pe, + const char * name_prefix, + const char * error_tag) { + // At this point ne = [F', T_enc, channels, B] (dw_striding: F'=16, + // channels=256, T_enc = floor(T_mel / 8)). Flatten (F', C) into one + // feature axis matching pre_encode_in = channels * F'. + // The reference uses flat index = c*F' + f' (C slow, F' fast), which in + // ggml ne is: permute F' to axis 0, C to axis 1, then collapse 0 and 1: + // permute (0, 2, 1, 3): [F', T, C, 1] -> [F', C, T, 1] + // ggml_cont; reshape -> [F'*C, T] = [pre_encode_in, T_enc] + const int64_t F_prime = x->ne[0]; + const int64_t T_enc = x->ne[1]; + const int64_t C = x->ne[2]; + // Utterance batch rides the conv "N" axis (ne[3]) through the stem; the + // flatten + linear below land it on ne[2] == B for the conformer blocks. + const int64_t B = x->ne[3]; + const int64_t pre_encode_in = F_prime * C; + + // Sanity check: the linear layer expects exactly pre_encode_in features. + if (pe.out_w != nullptr && pre_encode_in != pe.out_w->ne[0]) { + log_msg(TRANSCRIBE_LOG_LEVEL_ERROR, + "%s encoder: pre_encode_in mismatch: " + "F'*C=%lld but out_w expects %lld", + error_tag != nullptr ? error_tag : "conformer", static_cast(pre_encode_in), + static_cast(pe.out_w->ne[0])); + return nullptr; + } + + x = ggml_permute(ctx, x, /*axis0=*/0, /*axis1=*/2, + /*axis2=*/1, /*axis3=*/3); + x = name_prefixed(x, name_prefix, "permuted"); + x = ggml_cont(ctx, x); + x = name_prefixed(x, name_prefix, "flat_pre"); + // [F', C, T_enc, B] -> [F'*C, T_enc, B]. B at ne[2] after the collapse. + x = ggml_reshape_3d(ctx, x, pre_encode_in, T_enc, B); + x = name_prefixed(x, name_prefix, "flat"); + + // Linear projection to d_model (out_w ne=[pre_encode_in, d_model]). + x = ggml_mul_mat(ctx, pe.out_w, x); + x = name_prefixed(x, name_prefix, "linear"); + + // Add bias [d_model], broadcast to [d_model, T_enc, 1, 1]. + if (pe.out_b != nullptr) { + const int64_t d_model = pe.out_b->ne[0]; + ggml_tensor * bias_4d = ggml_reshape_4d(ctx, pe.out_b, d_model, 1, 1, 1); + x = ggml_add(ctx, x, bias_4d); + } + return name_prefixed(x, name_prefix, "out"); +} + } // namespace // Pre-encode subsampling stack. Op order matches NeMo's @@ -1146,6 +1201,12 @@ ggml_tensor * name_prefixed(ggml_tensor * t, const char * prefix, const char * s // feature axis matching `pre_encode_in = channels * (n_mels / 8)` // linear (out_w, out_b) -> [d_model, T_enc, 1, 1] // +// With policy.striding_pre_encode (NeMo `striding`, classic Conformer) the +// stack after conv0 is one full conv instead of the two separable pairs: +// +// conv2 (standard, C->C, k=3 s=2 p=1) -> bias -> ReLU +// flatten (pre_encode_in = channels * (n_mels / 4)) -> linear +// // Each conv's fused bias is an explicit ggml_add (no-op when null). The 2-D // depthwise convs (conv2, conv5) honor policy.direct_dw_in_pre_encode. ggml_tensor * build_pre_encode(ggml_context * ctx, @@ -1244,6 +1305,22 @@ ggml_tensor * build_pre_encode(ggml_context * ctx, x = apply_valid_mask(x, valid_masks ? &valid_masks->mask_s1 : nullptr, "pre_encode.valid_mask.s1"); x = zero_causal_tail(x); + if (policy.striding_pre_encode) { + // conv2 (standard 2D conv: channels -> channels, k=3 s=2). Direct + // conv, as conv0: im2col would materialize C*9 values per output + // position. Offline only (the caller rejects causal pre_encode). + x = ggml_conv_2d_direct(ctx, pe.conv2_w, x, + /*s0=*/2, /*s1=*/2, + /*p0=*/pe_p_op, /*p1=*/pe_p_op, + /*d0=*/1, /*d1=*/1); + x = add_conv_bias(ctx, x, pe.conv2_b); + x = name_prefixed(x, name_prefix, "conv2"); + x = ggml_relu(ctx, x); + x = name_prefixed(x, name_prefix, "relu2"); + x = apply_valid_mask(x, valid_masks ? &valid_masks->mask_s2 : nullptr, "pre_encode.valid_mask.s2"); + return pre_encode_flatten_project(ctx, x, pe, name_prefix, error_tag); + } + // conv2 (depthwise: channels -> channels, groups=channels, k=3 s=2). // im2col path (conv_2d_dw_f32) when direct_dw_in_pre_encode is false. if (policy.direct_dw_in_pre_encode) { @@ -1326,53 +1403,7 @@ ggml_tensor * build_pre_encode(ggml_context * ctx, } } - // At this point ne = [F'=16, T_enc, channels=256, 1] where - // T_enc = floor(T_mel / 8). Flatten (F', C) into one feature axis - // matching pre_encode_in = channels * (n_mels / subsampling_factor). - // The reference uses flat index = c*F' + f' (C slow, F' fast), which in - // ggml ne is: permute F' to axis 0, C to axis 1, then collapse 0 and 1: - // permute (0, 2, 1, 3): [F', T, C, 1] -> [F', C, T, 1] - // ggml_cont; reshape -> [F'*C, T] = [pre_encode_in, T_enc] - const int64_t F_prime = x->ne[0]; - const int64_t T_enc = x->ne[1]; - const int64_t C = x->ne[2]; - // Utterance batch rides the conv "N" axis (ne[3]) through the stem; the - // flatten + linear below land it on ne[2] == B for the conformer blocks. - const int64_t B = x->ne[3]; - const int64_t pre_encode_in = F_prime * C; - - // Sanity check: the linear layer expects exactly pre_encode_in features. - if (pe.out_w != nullptr && pre_encode_in != pe.out_w->ne[0]) { - log_msg(TRANSCRIBE_LOG_LEVEL_ERROR, - "%s encoder: pre_encode_in mismatch: " - "F'*C=%lld but out_w expects %lld", - error_tag != nullptr ? error_tag : "conformer", static_cast(pre_encode_in), - static_cast(pe.out_w->ne[0])); - return nullptr; - } - - x = ggml_permute(ctx, x, /*axis0=*/0, /*axis1=*/2, - /*axis2=*/1, /*axis3=*/3); - x = name_prefixed(x, name_prefix, "permuted"); - x = ggml_cont(ctx, x); - x = name_prefixed(x, name_prefix, "flat_pre"); - // [F', C, T_enc, B] -> [F'*C, T_enc, B]. B at ne[2] after the collapse. - x = ggml_reshape_3d(ctx, x, pre_encode_in, T_enc, B); - x = name_prefixed(x, name_prefix, "flat"); - - // Linear projection to d_model (out_w ne=[pre_encode_in, d_model]). - x = ggml_mul_mat(ctx, pe.out_w, x); - x = name_prefixed(x, name_prefix, "linear"); - - // Add bias [d_model], broadcast to [d_model, T_enc, 1, 1]. - if (pe.out_b != nullptr) { - const int64_t d_model = pe.out_b->ne[0]; - ggml_tensor * bias_4d = ggml_reshape_4d(ctx, pe.out_b, d_model, 1, 1, 1); - x = ggml_add(ctx, x, bias_4d); - } - x = name_prefixed(x, name_prefix, "out"); - - return x; + return pre_encode_flatten_project(ctx, x, pe, name_prefix, error_tag); } } // namespace transcribe::conformer diff --git a/src/conformer/conformer.h b/src/conformer/conformer.h index 745416343..a1dfea7df 100644 --- a/src/conformer/conformer.h +++ b/src/conformer/conformer.h @@ -129,6 +129,11 @@ struct ConvPolicy { // Run the pre_encode pointwise convs (conv3, conv6) via conv_2d_f32. // Other variants were validated on the F16 im2col and keep it. bool pre_encode_f32_pointwise = false; + + // NeMo `striding` subsampling (classic Conformer, 4x): conv0 then one + // full k=3 s=2 conv (conv2, C->C); conv3/5/6 are unused. Offline only. + // false = DwStridingSubsampling (8x). + bool striding_pre_encode = false; }; // Resolve a conv-dispatch toggle from its env overrides. The DIRECT var forces @@ -464,7 +469,8 @@ struct PreEncodeValidMasks { ggml_tensor * mask_s3_extent = nullptr; }; -// DwStridingSubsampling pre_encode stack. Returns the final +// DwStridingSubsampling pre_encode stack (or StridingSubsampling with +// policy.striding_pre_encode; then mask_s3 stays null). Returns the final // [d_model, T_enc, 1, 1] tensor or nullptr on a shape-sanity failure. // `name_prefix` (if non-null) names every intermediate ".conv0" // etc. Uses pe.out_w->ne[0] as a d_model sanity check; `error_tag` names the diff --git a/tests/golden/parakeet/koyal-hi-120m-1.0.manifest.json b/tests/golden/parakeet/koyal-hi-120m-1.0.manifest.json new file mode 100644 index 000000000..91c4ad5b3 --- /dev/null +++ b/tests/golden/parakeet/koyal-hi-120m-1.0.manifest.json @@ -0,0 +1,56 @@ +{ + "schema": "transcribe-golden-manifest-v1", + "family": "parakeet", + "variant": "koyal-hi-120m-1.0", + "source_model": { + "hf_repo": "adalat-ai/koyal-hi-120m-1.0", + "hf_revision": "7f2cb579598ba607b7ebb78a1b523fbcb83f4cf9" + }, + "reference": { + "kind": "nemo", + "source": "https://github.com/NVIDIA-NeMo/NeMo", + "revision": "v2.7.2", + "entrypoint": "scripts/dump_reference_parakeet_nemo.py" + }, + "expected_dtype": "float32", + "dtype_source": "config", + "frontend": { + "sample_rate": 16000, + "n_mels": 80, + "hop_length": 160, + "fft_size": 512, + "win_length": 400, + "window": "hann_periodic", + "normalization": "per_feature", + "preemphasis": 0.97, + "dither": 1e-05 + }, + "tokenizer_summary": { + "type": "bpe", + "vocab_size": 512, + "special_tokens": { + "blank": 512 + } + }, + "capabilities": { + "languages": [ + "hi" + ], + "language_detection": false, + "translation": false, + "timestamps": [ + "token", + "word", + "segment" + ], + "streaming": false, + "speaker_diarization": false + }, + "tolerance_file": "tests/tolerances/parakeet.json", + "cases": [ + { + "audio": "hi-short", + "language": "hi" + } + ] +} diff --git a/tests/golden/parakeet/koyal-kn-120m-1.0.manifest.json b/tests/golden/parakeet/koyal-kn-120m-1.0.manifest.json new file mode 100644 index 000000000..60cbca22c --- /dev/null +++ b/tests/golden/parakeet/koyal-kn-120m-1.0.manifest.json @@ -0,0 +1,56 @@ +{ + "schema": "transcribe-golden-manifest-v1", + "family": "parakeet", + "variant": "koyal-kn-120m-1.0", + "source_model": { + "hf_repo": "adalat-ai/koyal-kn-120m-1.0", + "hf_revision": "a169f0b9514dbc30ef8cca274430d160bf435341" + }, + "reference": { + "kind": "nemo", + "source": "https://github.com/NVIDIA-NeMo/NeMo", + "revision": "v2.7.2", + "entrypoint": "scripts/dump_reference_parakeet_nemo.py" + }, + "expected_dtype": "float32", + "dtype_source": "config", + "frontend": { + "sample_rate": 16000, + "n_mels": 80, + "hop_length": 160, + "fft_size": 512, + "win_length": 400, + "window": "hann_periodic", + "normalization": "per_feature", + "preemphasis": 0.97, + "dither": 1e-05 + }, + "tokenizer_summary": { + "type": "bpe", + "vocab_size": 512, + "special_tokens": { + "blank": 512 + } + }, + "capabilities": { + "languages": [ + "kn" + ], + "language_detection": false, + "translation": false, + "timestamps": [ + "token", + "word", + "segment" + ], + "streaming": false, + "speaker_diarization": false + }, + "tolerance_file": "tests/tolerances/parakeet.json", + "cases": [ + { + "audio": "kn-short", + "language": "kn" + } + ] +} diff --git a/tests/golden/parakeet/koyal-ml-120m-1.0.manifest.json b/tests/golden/parakeet/koyal-ml-120m-1.0.manifest.json new file mode 100644 index 000000000..9e3dcbb46 --- /dev/null +++ b/tests/golden/parakeet/koyal-ml-120m-1.0.manifest.json @@ -0,0 +1,56 @@ +{ + "schema": "transcribe-golden-manifest-v1", + "family": "parakeet", + "variant": "koyal-ml-120m-1.0", + "source_model": { + "hf_repo": "adalat-ai/koyal-ml-120m-1.0", + "hf_revision": "8135bc822466bf70d75c238041c585040b56e9f8" + }, + "reference": { + "kind": "nemo", + "source": "https://github.com/NVIDIA-NeMo/NeMo", + "revision": "v2.7.2", + "entrypoint": "scripts/dump_reference_parakeet_nemo.py" + }, + "expected_dtype": "float32", + "dtype_source": "config", + "frontend": { + "sample_rate": 16000, + "n_mels": 80, + "hop_length": 160, + "fft_size": 512, + "win_length": 400, + "window": "hann_periodic", + "normalization": "per_feature", + "preemphasis": 0.97, + "dither": 1e-05 + }, + "tokenizer_summary": { + "type": "bpe", + "vocab_size": 512, + "special_tokens": { + "blank": 512 + } + }, + "capabilities": { + "languages": [ + "ml" + ], + "language_detection": false, + "translation": false, + "timestamps": [ + "token", + "word", + "segment" + ], + "streaming": false, + "speaker_diarization": false + }, + "tolerance_file": "tests/tolerances/parakeet.json", + "cases": [ + { + "audio": "ml-short", + "language": "ml" + } + ] +} diff --git a/tests/golden/parakeet/koyal-te-120m-1.0.manifest.json b/tests/golden/parakeet/koyal-te-120m-1.0.manifest.json new file mode 100644 index 000000000..7fe2531cc --- /dev/null +++ b/tests/golden/parakeet/koyal-te-120m-1.0.manifest.json @@ -0,0 +1,56 @@ +{ + "schema": "transcribe-golden-manifest-v1", + "family": "parakeet", + "variant": "koyal-te-120m-1.0", + "source_model": { + "hf_repo": "adalat-ai/koyal-te-120m-1.0", + "hf_revision": "1f301af81e7865326e204c6ad90772b4b50c0c03" + }, + "reference": { + "kind": "nemo", + "source": "https://github.com/NVIDIA-NeMo/NeMo", + "revision": "v2.7.2", + "entrypoint": "scripts/dump_reference_parakeet_nemo.py" + }, + "expected_dtype": "float32", + "dtype_source": "config", + "frontend": { + "sample_rate": 16000, + "n_mels": 80, + "hop_length": 160, + "fft_size": 512, + "win_length": 400, + "window": "hann_periodic", + "normalization": "per_feature", + "preemphasis": 0.97, + "dither": 1e-05 + }, + "tokenizer_summary": { + "type": "bpe", + "vocab_size": 512, + "special_tokens": { + "blank": 512 + } + }, + "capabilities": { + "languages": [ + "te" + ], + "language_detection": false, + "translation": false, + "timestamps": [ + "token", + "word", + "segment" + ], + "streaming": false, + "speaker_diarization": false + }, + "tolerance_file": "tests/tolerances/parakeet.json", + "cases": [ + { + "audio": "te-short", + "language": "te" + } + ] +}