--- license: apache-2.0 library_name: transformers pipeline_tag: automatic-speech-recognition language: - aae - aal - abb - abi - abk - abn - abp - abr - abs - aca - acd - ace - acf - ach - acm - acn - acr - acu - acw - ade - adh - adj - adx - ady - aeb - aec - aeu - afb - afo - afr - agd - agg - agn - agr - agu - agx - aha - ahk - ahl - ahs - aia - ajg - aka - akb - ake - akp - ala - alj - aln - alo - alp - als - alt - alz - ame - amf - amh - ami - amk - amu - anc - ank - ann - anp - anw - any - aom - aoz - apb - apc - apd - apr - arb - arg - arl - arq - ars - ary - arz - asa - asg - asm - ast - ata - atb - atg - ati - atq - ava - avn - avu - awa - awb - awo - ayl - ayo - ayp - ayr - ayz - aze - azg - azz - bag - bak - bam - ban - bao - bas - bav - bax - bba - bbb - bbc - bbj - bbl - bbo - bbu - bcc - bce - bci - bcl - bcs - bcw - bcy - bcz - bda - bde - bdg - bdh - bdm - bdq - bdu - beb - beh - bel - bem - ben - bep - bew - bex - bfa - bfd - bfo - bft - bfy - bfz - bgc - bgp - bgq - bgr - bgt - bgw - bha - bhb - bhh - bho - bhp - bht - bhz - bib - bim - bis - biv - bjj - bjk - bjn - bjr - bjt - bjv - bjw - bjz - bkd - bkh - bkm - bkv - bky - ble - blh - blt - blx - blz - bmm - bmq - bmr - bmu - bmv - bng - bnm - bnn - bno - bnp - bns - boa - bod - boj - bom - bor - bos - bou - bov - box - bpr - bps - bqc - bqg - bqi - bqj - bqp - bra - bre - brh - bri - bru - brx - bsc - bsh - bsj - bsk - bsq - bss - bsy - btd - btm - bts - btt - btv - btx - bud - bug - bul - bum - buo - bus - bux - bvb - bvc - bvz - bwq - bwr - bwu - bxf - bxk - byc - byr - bys - byv - byx - bzh - bzi - bzj - bzw - caa - cab - cac - cak - cap - car - cas - cat - cax - cbc - cbi - cbr - cbs - cbt - cbu - cbv - cce - ccg - cco - cdj - cdo - ceb - ceg - cek - cen - ces - cfa - cfm - cgc - cgg - che - chf - chq - chv - chz - cjk - cjo - cjp - cjs - ckb - ckl - cko - ckr - ckt - cky - cla - cle - cly - cme - cmn - cmo - cmr - cnh - cni - cnl - cnt - coe - cof - cok - con - cor - cot - cou - cpa - cpb - cpu - cpx - cpy - crh - crk - crn - crq - crs - crt - csk - cso - ctd - cte - ctg - ctl - cto - ctu - cuc - cui - cuk - cul - cut - cux - cwa - cwe - cwt - cya - cym - daa - dag - dah - dan - dar - dav - dbd - dbj - dbq - dcc - ddn - ded - deg - des - deu - dga - dgh - dgi - dgk - dgo - dgr - dhi - did - dig - dik - dip - div - dje - djk - dmk - dml - dnj - dnt - dnw - dop - dos - dru - dsb - dsh - dtp - dts - dty - dua - dug - dwr - dyi - dyo - dyu - dzg - dzo - ebu - ego - eip - eiv - eka - ekk - eko - ekr - ell - emp - enb - eng - enx - epo - ese - ess - esu - eto - ets - etu - eus - evn - ewe - ewo - eyo - eza - fal - fan - fao - far - fas - fat - fia - fij - fil - fin - fip - fkk - flr - fmp - fmu - fon - fra - frd - fry - fub - fuc - fue - ful - fuq - fuv - gag - gai - gam - gau - gbi - gbk - gbm - gbo - gbr - gby - gcc - gde - gdf - geb - gej - ges - ggg - gid - gig - gil - giz - gjk - gjn - gju - gkn - gld - gle - glg - glk - glv - glw - gmv - gna - gnd - gng - gof - gog - gol - gom - gor - gqr - grc - gri - grn - grt - gsl - gso - gub - guc - gud - gug - guh - gui - guj - guk - gum - guo - guq - gur - guu - gux - guz - gvc - gvl - gwc - gwe - gwi - gwr - gwt - gym - gyr - gyz - had - hag - hah - hak - hao - hap - hat - hau - haw - hay - hbb - hch - heb - heh - her - hia - hif - hig - hil - hin - hkk - hla - hlb - hlt - hne - hnn - hno - hns - hoc - hrv - hsb - hto - hub - hue - hui - hul - hun - hus - huu - huv - hux - hvn - hwc - hwo - hye - hyw - iba - ibb - ibo - icr - ida - idd - idu - ifa - ifb - ife - ifk - ifu - ify - igl - ign - ijc - ijn - ikk - ikw - ilb - ilo - imo - ina - inb - ind - iou - ipi - ipk - iqw - iri - irk - ish - isl - iso - ita - itl - its - itv - itw - itz - ixl - izr - izz - jac - jal - jam - jav - jbu - jen - jic - jiv - jmc - jmd - jmx - jpn - jqr - juk - jun - juo - jvn - kaa - kab - kac - kai - kaj - kak - kam - kan - kao - kaq - kas - kat - kay - kaz - kbd - kbl - kbo - kbp - kbq - kbr - kbt - kby - kca - kcg - kcn - kcq - kdc - kde - kdh - kdi - kdj - kdl - kdn - kdt - kea - kek - ken - keo - ker - keu - key - kez - kfb - kff - kfk - kfq - kfr - kfw - kfx - kha - khg - khk - khm - khq - khw - kia - kij - kik - kin - kir - kix - kjb - kjc - kje - kjg - kjh - kjk - kki - kkj - kle - kln - kls - klu - klv - klw - kma - kmd - kml - kmr - kmu - kmy - kna - knb - knc - kne - knf - knj - knk - knn - kno - kog - kol - koo - kor - kpo - kpq - kps - kpv - kpy - kpz - kqe - kqo - kqp - kqr - kqy - krc - kri - krj - krl - krr - krs - kru - krx - ksb - ksd - ksf - ksr - kss - ksz - ktb - ktj - kto - kua - kub - kue - kuh - kum - kur - kus - kvn - kvw - kvx - kwd - kwf - kwi - kwm - kxc - kxf - kxm - kxp - kyb - kyc - kyf - kyg - kyo - kyq - kyu - kyx - kyz - kzf - kzi - lac - lag - laj - lam - lao - las - lat - lav - law - lbj - lbw - lcm - lcp - ldb - led - lee - lef - lem - lew - lex - lgg - lgl - lhu - lia - lid - lif - lij - lin - lip - lir - lis - lit - lje - ljp - lkb - lke - lla - lld - llg - lln - lme - lnd - lns - lnu - loa - lob - lok - lom - lon - loq - lrk - lsi - lsm - lss - ltg - lth - lto - ltz - lua - luc - lug - luo - lus - lwg - lwo - lww - lzz - maa - mab - mad - maf - mag - mah - mai - maj - mak - mal - mam - maq - mar - mau - maw - max - maz - mbb - mbc - mbh - mbj - mbt - mbu - mca - mcb - mcd - mcf - mco - mcp - mcq - mcu - mcx - mda - mdd - mdv - mdy - med - mee - meh - mej - mek - mel - men - meq - mer - met - meu - mev - mfe - mfh - mfi - mfk - mfm - mfn - mfo - mfq - mfv - mfy - mfz - mgd - mge - mgg - mgh - mgi - mgo - mhi - mhk - mhr - mhu - mhx - mhy - mib - mie - mif - mig - mih - mil - mim - min - mio - mip - miq - mit - miu - miy - miz - mjl - mjv - mkd - mkf - mki - mkl - mkn - mlg - mlq - mlt - mmc - mmg - mnb - mne - mnf - mni - mnk - mnw - mnx - moa - mog - mon - mop - mor - mos - mox - moz - mpg - mpm - mpp - mpx - mqb - mqf - mqj - mqn - mqy - mri - mrj - mrr - mrt - mrw - msh - msi - msw - msy - mtd - mtj - mto - mtr - mtu - mtx - mua - mug - muh - mui - mup - mur - muv - muy - mve - mvp - mvy - mwq - mwv - mxb - mxq - mxs - mxt - mxu - mxv - mxy - mya - myb - myk - myv - myx - myy - mza - mzi - mzj - mzk - mzl - mzm - mzw - nab - nag - nal - nan - nap - nas - naw - nbh - nca - ncf - nch - ncj - ncl - nco - ncu - ncx - ndi - ndj - ndo - ndp - ndv - ndy - ndz - neb - nep - new - nfa - nfr - nga - ngi - ngl - ngp - ngu - nhe - nhg - nhi - nhn - nhq - nhu - nhw - nhx - nhy - nia - nij - nim - nin - nja - nko - nla - nlc - nld - nlg - nlk - nlv - nmg - nmz - nnb - nnh - nnq - nnw - noa - nob - nod - noe - nog - not - npl - npy - nso - nst - nsu - ntm - ntr - nuj - nup - nus - nuz - nwb - nxq - nya - nyf - nyn - nyo - nyu - nyy - nzi - obo - oci - odk - odu - ogo - ojb - oku - old - omw - onb - ood - orc - orm - oru - ory - oss - ote - otq - ozm - pab - pad - pag - pam - pan - pao - pap - pau - pbb - pbc - pbi - pbs - pbt - pbu - pce - pcm - pex - pez - phl - phr - pib - pil - pip - pir - pis - piy - pjt - pkb - pko - plk - pls - plt - plw - pmf - pmq - pms - pmy - pnb - pne - pny - poc - poe - poh - poi - pol - por - pov - pow - poy - ppk - pps - prf - prk - prq - prt - pse - pss - pst - ptu - pua - pui - pus - pwg - pwn - pww - pxm - qub - quc - quf - qug - quh - qul - qum - qup - qur - qus - quv - quw - qux - quy - quz - qva - qvc - qve - qvh - qvi - qvj - qvl - qvm - qvn - qvo - qvs - qvw - qvz - qwa - qwh - qws - qxa - qxh - qxl - qxn - qxo - qxp - qxr - qxt - qxu - qxw - rag - rah - rai - rap - rav - raw - rej - rel - rgu - rhg - rif - rim - rjs - rkt - rmc - rmo - rmy - rng - rnl - rob - rof - roh - rol - ron - roo - rop - rro - rth - rub - ruc - ruf - rug - run - rus - rwm - rwr - sab - sag - sah - saj - saq - sas - sau - say - sba - sbd - sbl - sbn - sbp - sch - sck - scl - scn - sco - sda - sdo - sea - seh - sei - ses - sey - sgb - sgj - sgw - shi - shk - shn - sho - shp - sid - sig - sil - sin - sip - siw - sja - sjm - sjp - sjr - skg - skr - sld - slk - slu - slv - sml - smo - sna - snc - snd - sne - snk - snn - snp - snv - snw - sol - som - soy - spa - spp - sps - spy - src - srd - sri - srm - srn - sro - srp - srr - srx - ssi - ste - stn - stp - sua - suc - suk - sun - sur - sus - suv - suz - sva - swe - swh - swv - sxb - sxn - sya - syl - sza - szy - tac - taj - tam - tan - tao - tap - taq - tar - tat - tav - tay - tbc - tbf - tbg - tbk - tbl - tby - tbz - tca - tcc - tcf - tcy - tcz - tdj - tdn - tdx - ted - tee - tel - tem - teo - ter - tew - tex - tfr - tgc - tgj - tgk - tgl - tgo - tgp - tha - the - thk - thl - thq - thr - thv - tig - tih - tik - tio - tir - tkg - tkr - tkt - tlb - tli - tlj - tlp - tly - tmc - tmf - tna - tng - tnk - tnn - tnp - tnr - tnt - tob - toc - toh - tok - tom - top - tos - tpi - tpl - tpm - tpp - tpt - tpz - tqp - trc - tri - trn - trp - trq - trs - trv - trw - tsn - tso - tsz - ttc - tte - ttj - ttq - ttr - ttu - tue - tuf - tui - tuk - tul - tuo - tuq - tur - tuv - tuy - tvo - tvu - tvw - twb - twe - twu - txa - txq - txs - txu - txy - tye - tzh - tzj - tzo - ubl - ubu - udl - udm - udu - uig - uki - ukr - ukv - umb - upv - ura - urb - urd - urh - urk - urt - ury - ush - usp - uzb - uzn - vag - vah - vai - var - ver - vid - vie - vif - vmc - vmj - vmm - vmp - vmw - vmy - vmz - vro - vun - vut - wal - wap - war - waw - way - wba - wbl - wbr - wci - weo - wes - wja - wji - wlo - wlx - wmw - wob - wof - wol - wsg - wwa - xal - xdy - xed - xer - xhe - xho - xka - xkl - xmf - xmm - xmv - xnj - xnr - xog - xon - xpe - xrb - xsb - xsm - xsr - xsu - xta - xtd - xte - xti - xtm - xtn - xtu - xua - xuo - yaa - yad - yal - yam - yao - yaq - yas - yat - yav - yay - yaz - yba - ybb - ycl - ycn - ydd - ydg - yea - yer - yes - yka - yli - yor - yre - yua - yue - yuz - yva - zaa - zab - zac - zad - zae - zai - zam - zao - zaq - zar - zas - zav - zaw - zca - zga - zim - ziw - zmz - zne - zoc - zoh - zor - zos - zpc - zpg - zpi - zpl - zpm - zpo - zpt - zpu - zpv - zpy - zpz - zsm - ztg - ztn - ztp - ztq - zts - ztu - zty - zul - zyb - zyp - zza datasets: - facebook/omnilingual-asr-corpus tags: - omniasr - omnilingual-asr - multilingual --- # Omnilingual ASR: Open-Source Multilingual Speech Recognition for 1600+ Languages
## Model Description This is a 🤗 Transformers-compatible conversion of [`omniASR_CTC_3B_v2`](https://github.com/facebookresearch/omnilingual-asr#model-architectures), part of the **Omnilingual ASR** family released by Meta AI, which covers more than 1,600 languages — including hundreds never previously supported by any ASR system. This checkpoint is a **CTC** variant: a Wav2Vec2-style encoder (convolutional layers that downsample the 16 kHz waveform ~320× to a 50 Hz frame rate, followed by a pre-norm Transformer encoder) with a single linear projection to the vocabulary, decoded non-autoregressively with greedy CTC. It is the fastest variant, transcribes in lowercase without punctuation, and does not take a language hint. The Transformers-compatible checkpoints are: | Model | Features | Parameters | |-------|----------|-----------:| | [`omniasr-ctc-300m-v2`](https://huggingface.co/hf-audio/omniasr-ctc-300m-v2) | ASR | 325_494_996 | | [`omniasr-ctc-1b-v2`](https://huggingface.co/hf-audio/omniasr-ctc-1b-v2) | ASR | 975_065_300 | | **[`omniasr-ctc-3b-v2`](https://huggingface.co/hf-audio/omniasr-ctc-3b-v2)** (this model) | ASR | 3_080_423_636 | | [`omniasr-ctc-7b-v2`](https://huggingface.co/hf-audio/omniasr-ctc-7b-v2) | ASR | 6_504_786_132 | | [`omniasr-llm-300m-v2`](https://huggingface.co/hf-audio/omniasr-llm-300m-v2) | ASR with optional language conditioning | 1_627_603_584 | | [`omniasr-llm-1b-v2`](https://huggingface.co/hf-audio/omniasr-llm-1b-v2) | ASR with optional language conditioning | 2_275_710_592 | | [`omniasr-llm-3b-v2`](https://huggingface.co/hf-audio/omniasr-llm-3b-v2) | ASR with optional language conditioning | 4_376_679_040 | | [`omniasr-llm-7b-v2`](https://huggingface.co/hf-audio/omniasr-llm-7b-v2) | ASR with optional language conditioning | 7_801_041_536 | * **Developed by:** Meta AI / Omnilingual ASR Team ([GitHub](https://github.com/facebookresearch/omnilingual-asr)) * **Converted to Transformers by:** [Eric Bezzam](https://huggingface.co/bezzam) * **Model type:** Wav2Vec2-style speech encoder with a CTC head, non-autoregressive decoding. * **Language(s):** 1,600+ languages (see [Supported languages](#supported-languages)). * **License:** Apache-2.0 (for the model and code), CC-BY-4.0 for the [`facebook/omnilingual-asr-corpus`](https://huggingface.co/datasets/facebook/omnilingual-asr-corpus) dataset. --- ## Installation OmniASR is not yet part of a Transformers release, so install Transformers from source: ```bash pip install git+https://github.com/huggingface/transformers ``` ## Usage The CTC variant transcribes in lowercase without punctuation, and does not take a language hint. ### Simple transcription ```python from datasets import Audio, load_dataset from transformers import AutoModelForCTC, AutoProcessor model_id = "hf-audio/omniasr-ctc-3b-v2" processor = AutoProcessor.from_pretrained(model_id) model = AutoModelForCTC.from_pretrained(model_id, device_map="auto") ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation") ds = ds.cast_column("audio", Audio(sampling_rate=processor.feature_extractor.sampling_rate)) inputs = processor(ds[0]["audio"]["array"], sampling_rate=processor.feature_extractor.sampling_rate) inputs.to(model.device, dtype=model.dtype) outputs = model.generate(**inputs) print(processor.decode(outputs, skip_special_tokens=True)[0]) ``` ### Batch inference Batch inference is possible by passing a list of audios, which the processor pads to the longest one. ```python from datasets import Audio, load_dataset from transformers import AutoModelForCTC, AutoProcessor model_id = "hf-audio/omniasr-ctc-3b-v2" NUM_SAMPLES = 5 processor = AutoProcessor.from_pretrained(model_id) model = AutoModelForCTC.from_pretrained(model_id, device_map="auto") ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation") ds = ds.cast_column("audio", Audio(sampling_rate=processor.feature_extractor.sampling_rate)) speech_samples = [el["array"] for el in ds["audio"][:NUM_SAMPLES]] inputs = processor(speech_samples, sampling_rate=processor.feature_extractor.sampling_rate) inputs.to(model.device, dtype=model.dtype) outputs = model.generate(**inputs) for i, text in enumerate(processor.decode(outputs, skip_special_tokens=True)): print(f"Audio {i + 1}: {text}") ``` ### Training The model can be trained with the loss it outputs. Passing `text` to the processor prepares the CTC `labels`, with padding positions masked out. Note that OmniASR transcribes in lowercase, so the (uppercase) LibriSpeech transcripts are lowercased below. ```python from datasets import Audio, load_dataset from transformers import AutoModelForCTC, AutoProcessor model_id = "hf-audio/omniasr-ctc-3b-v2" NUM_SAMPLES = 5 processor = AutoProcessor.from_pretrained(model_id) model = AutoModelForCTC.from_pretrained(model_id, device_map="auto") model.train() ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation") ds = ds.cast_column("audio", Audio(sampling_rate=processor.feature_extractor.sampling_rate)) speech_samples = [el["array"] for el in ds["audio"][:NUM_SAMPLES]] text_samples = [text.lower() for text in ds["text"][:NUM_SAMPLES]] # passing `text` to the processor will prepare inputs' `labels` key inputs = processor(audio=speech_samples, text=text_samples, sampling_rate=processor.feature_extractor.sampling_rate) inputs.to(model.device, dtype=model.dtype) outputs = model(**inputs) print("Loss:", outputs.loss.item()) outputs.loss.backward() ``` ### Torch compile The CTC variant runs a single forward pass, which is compiled by passing a `CompileConfig` to `generate`. Padding all inputs to the same length (here 30 seconds) keeps the input shapes static, so that new inputs don't trigger a recompilation. On an A100, we observed a speed-up of ~1.3 for a batch size of 4 ([script](https://gist.github.com/ebezzam/26af2bd40fa207af322de39701179650#file-example_compile_ctc-py)). ```python import torch from datasets import Audio, load_dataset from transformers import AutoModelForCTC, AutoProcessor, CompileConfig model_id = "hf-audio/omniasr-ctc-3b-v2" NUM_SAMPLES = 4 num_warmup = 3 processor = AutoProcessor.from_pretrained(model_id) model = AutoModelForCTC.from_pretrained(model_id, dtype=torch.bfloat16).to("cuda").eval() ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation") ds = ds.cast_column("audio", Audio(sampling_rate=processor.feature_extractor.sampling_rate)) speech_samples = [el["array"] for el in ds["audio"][:NUM_SAMPLES]] inputs = processor( speech_samples, sampling_rate=processor.feature_extractor.sampling_rate, padding="max_length", max_length=30 * processor.feature_extractor.sampling_rate, ).to(model.device, dtype=model.dtype) compile_config = CompileConfig(fullgraph=True, mode="reduce-overhead") # Warmup for _ in range(num_warmup): _ = model.generate(**inputs, compile_config=compile_config) torch.cuda.synchronize() # Apply model outputs = model.generate(**inputs, compile_config=compile_config) print(processor.decode(outputs, skip_special_tokens=True)[0]) ``` ## Supported Languages The list of 1600+ supported languages and their naming convention follows the original [here](https://github.com/facebookresearch/omnilingual-asr/blob/81f51e224ce9e74b02cc2a3eaf21b2d91d743455/src/omnilingual_asr/models/wav2vec2_llama/lang_ids.py#L9). Languages follow the format `{language_code}_{script}`, for example `eng_Latn` - English (Latin script), `cmn_Hans` - Mandarin Chinese (Simplified), ... --- ## Citation **BibTeX:** ```bibtex @misc{omnilingualasr2025, title={{Omnilingual ASR}: Open-Source Multilingual Speech Recognition for 1600+ Languages}, author={{Omnilingual ASR Team} and Keren, Gil and Kozhevnikov, Artyom and Meng, Yen and Ropers, Christophe and Setzler, Matthew and Wang, Skyler and Adebara, Ife and Auli, Michael and Can, Balioglu and Chan, Kevin and Cheng, Chierh and Chuang, Joe and Droof, Caley and Duppenthaler, Mark and Duquenne, Paul-Ambroise and Erben, Alexander and Gao, Cynthia and Mejia Gonzalez, Gabriel and Lyu, Kehan and Miglani, Sagar and Pratap, Vineel and Sadagopan, Kaushik Ram and Saleem, Safiyyah and Turkatenko, Arina and Ventayol-Boada, Albert and Yong, Zheng-Xin and Chung, Yu-An and Maillard, Jean and Moritz, Rashel and Mourachko, Alexandre and Williamson, Mary and Yates, Shireen}, year={2025}, url={https://ai.meta.com/research/publications/omnilingual-asr-open-source-multilingual-speech-recognition-for-1600-languages/}, } ```