Romanized Nyishi CTC ASR adapter for
facebook/mms-1b-all.
This is a per-language CTC adapter for the MMS-1B model. The base model is frozen;
only the language adapter (about 2.19 M parameters, roughly 8.8 MB on disk) and the
CTC head are trained. Input is 16 kHz mono audio (up to 30 seconds). Output is a
Romanized (Latin-script) transcript, lower-cased and NFC-normalized.
Reference processing: NFC + strip + lower. Hypothesis decoded with greedy CTC,
no language model.
This is an early experimental adapter for an extreme-low-resource language. WER is high and the model is provided as a starting point rather than a production system.
1from huggingface_hub import hf_hub_download
2from transformers import Wav2Vec2CTCTokenizer, Wav2Vec2FeatureExtractor, Wav2Vec2Processor, Wav2Vec2ForCTC
3from safetensors.torch import load_file
4import torch, torchaudio
5
6REPO = "sulabhkatiyar/ne-asr-njz"
7BASE = "facebook/mms-1b-all"
8
9# Tokenizer and processor come from the adapter repo
10_ = hf_hub_download(REPO, "tokenizer_config.json")
11_ = hf_hub_download(REPO, "vocab.json")
12tokenizer = Wav2Vec2CTCTokenizer.from_pretrained(REPO, do_lower_case=False)
13feat_ext = Wav2Vec2FeatureExtractor.from_pretrained(BASE)
14processor = Wav2Vec2Processor(feature_extractor=feat_ext, tokenizer=tokenizer)
15
16# Load the base model and attach the adapter weights
17model = Wav2Vec2ForCTC.from_pretrained(
18 BASE,
19 vocab_size=len(tokenizer),
20 pad_token_id=tokenizer.pad_token_id,
21 ignore_mismatched_sizes=True,
22)
23model.init_adapter_layers()
24adapter_path = hf_hub_download(REPO, "adapter.njz.safetensors")
25missing, unexpected = model.load_state_dict(load_file(adapter_path), strict=False)
26model.eval()
27
28# Inference (expects 16 kHz mono float32)
29wav, sr = torchaudio.load("your_audio.wav")
30if sr != 16000:
31 wav = torchaudio.functional.resample(wav, sr, 16000)
32inputs = processor(wav.squeeze(0).numpy(), sampling_rate=16000, return_tensors="pt")
33with torch.no_grad():
34 logits = model(inputs.input_values).logits
35pred_ids = logits.argmax(dim=-1)
36transcription = processor.batch_decode(pred_ids)[0]
37print(transcription)
1@article{pratap2023scaling,
2 title = {Scaling Speech Technology to 1,000+ Languages},
3 author = {Pratap, Vineel and Tjandra, Andros and Shi, Bowen and Tomasello, Paden and Babu, Arun and Kundu, Sayani and Elkahky, Ali and Ni, Zhaoheng and Vyas, Apoorv and Fazel-Zarandi, Maryam and Baevski, Alexei and Adi, Yossi and Zhang, Xiaohui and Hsu, Wei-Ning and Conneau, Alexis and Auli, Michael},
4 journal = {arXiv preprint arXiv:2305.13516},
5 year = {2023}
6}
And the NE-ASR adapter release (placeholder; replace when the canonical publication is available):
1@misc{katiyar2026neasr,
2 author = {Katiyar, Sulabh},
3 title = {NE-ASR: MMS-1B Adapters for Northeast Indian Languages},
4 year = {2026},
5 howpublished = {\url{https://huggingface.co/sulabhkatiyar/ne-asr-njz}},
6 note = {Placeholder citation; replace with the canonical publication when available.}
7}
CC-BY-NC 4.0. This adapter is derived from
facebook/mms-1b-all, which is released under CC-BY-NC 4.0. When you use this adapter, you must comply with the MMS license terms.