Run this model with HF Jobs
Run facebook/mms-lid-512 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/facebook/mms-lid-512. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/facebook/mms-lid-512 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use facebook/mms-lid-512 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/mms-lid-512 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("audio-classification", model="facebook/mms-lid-512")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForAudioClassification processor = AutoProcessor.from_pretrained("facebook/mms-lid-512") model = AutoModelForAudioClassification.from_pretrained("facebook/mms-lid-512", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
5da5ea8
1
Parent(s): 44c2879
upload readme
Browse files1234---tags:- mms---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811---tags:- mmslanguage:- ab- af- ak- am- ar- as- av- ay- az- ba- bm- be- bn- bi- bo- sh- br- bg- ca- cs- ce- cv- ku- cy- da- de- dv- dz- el- en- eo- et- eu- ee- fo- fa- fj- fi- fr- fy- ff- ga- gl- gn- gu- zh- ht- ha- he- hi- sh- hu- hy- ig- ia- ms- is- it- jv- ja- kn- ka- kk- kr- km- ki- rw- ky- ko- kv- lo- la- lv- ln- lt- lb- lg- mh- ml- mr- ms- mk- mg- mt- mn- mi- my- zh- nl- 'no'- 'no'- ne- ny- oc- om- or- os- pa- pl- pt- ms- ps- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- qu- ro- rn- ru- sg- sk- sl- sm- sn- sd- so- es- sq- su- sv- sw- ta- tt- te- tg- tl- th- ti- ts- tr- uk- ms- vi- wo- xh- ms- yo- ms- zu- zalicense: cc-by-nc-4.0datasets:- google/fleursmetrics:- acc---# Massively Multilingual Speech (MMS) - Finetuned LIDThis checkpoint is a model fine-tuned for speech language identification (LID) and part of Facebook's [Massive Multilingual Speech project](https://research.facebook.com/publications/scaling-speech-technology-to-1000-languages/).This checkpoint is based on the [Wav2Vec2 architecture](https://huggingface.co/docs/transformers/model_doc/wav2vec2) and classifies raw audio input to a probability distribution over 512 output classes (each class representing a language).The checkpoint consists of **1 billion parameters** and has been fine-tuned from [facebook/mms-1b](https://huggingface.co/facebook/mms-1b) on 512 languages.## Table Of Content- [Example](#example)- [Supported Languages](#supported-languages)- [Model details](#model-details)- [Additional links](#additional-links)## ExampleThis MMS checkpoint can be used with [Transformers](https://github.com/huggingface/transformers) to identifythe spoken language of an audio. It can recognize the [following 512 languages](#supported-languages).Let's look at a simple example.First, we install transformers and some other libraries```pip install torch accelerate torchaudio datasetspip install --upgrade transformers````**Note**: In order to use MMS you need to have at least `transformers >= 4.30` installed. If the `4.30` versionis not yet available [on PyPI](https://pypi.org/project/transformers/) make sure to install `transformers` fromsource:```pip install git+https://github.com/huggingface/transformers.git```Next, we load a couple of audio samples via `datasets`. Make sure that the audio data is sampled to 16000 kHz.```pyfrom datasets import load_dataset, Audio# Englishstream_data = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="test", streaming=True)stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000))en_sample = next(iter(stream_data))["audio"]["array"]# Arabicstream_data = load_dataset("mozilla-foundation/common_voice_13_0", "ar", split="test", streaming=True)stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000))ar_sample = next(iter(stream_data))["audio"]["array"]```Next, we load the model and processor```pyfrom transformers import Wav2Vec2ForSequenceClassification, AutoFeatureExtractorimport torchmodel_id = "facebook/mms-lid-512"processor = AutoFeatureExtractor.from_pretrained(model_id)model = Wav2Vec2ForSequenceClassification.from_pretrained(model_id)```Now we process the audio data, pass the processed audio data to the model to classify it into a language, just like we usually do for Wav2Vec2 audio classification models such as [ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition](https://huggingface.co/harshit345/xlsr-wav2vec-speech-emotion-recognition)```py# Englishinputs = processor(en_sample, sampling_rate=16_000, return_tensors="pt")with torch.no_grad():outputs = model(**inputs).logitslang_id = torch.argmax(outputs, dim=-1)[0].item()detected_lang = model.config.id2label[lang_id]# 'eng'# Arabicinputs = processor(ar_sample, sampling_rate=16_000, return_tensors="pt")with torch.no_grad():outputs = model(**inputs).logitslang_id = torch.argmax(outputs, dim=-1)[0].item()detected_lang = model.config.id2label[lang_id]# 'ara'```To see all the supported languages of a checkpoint, you can print out the language ids as follows:```pyprocessor.id2label.values()```For more details, about the architecture please have a look at [the official docs](https://huggingface.co/docs/transformers/main/en/model_doc/mms).## Supported LanguagesThis model supports 512 languages. Unclick the following to toogle all supported languages of this checkpoint in [ISO 639-3 code](https://en.wikipedia.org/wiki/ISO_639-3).You can find more details about the languages and their ISO 649-3 codes in the [MMS Language Coverage Overview](https://dl.fbaipublicfiles.com/mms/misc/language_coverage_mms.html).<details><summary>Click to toggle</summary>- ara- cmn- eng- spa- fra- mlg- swe- por- vie- ful- sun- asm- ben- zlm- kor- ind- hin- tuk- urd- aze- slv- mon- hau- tel- swh- bod- rus- tur- heb- mar- som- tgl- tat- tha- cat- ron- mal- bel- pol- yor- nld- bul- hat- afr- isl- amh- tam- hun- hrv- lit- cym- fas- mkd- ell- bos- deu- sqi- jav- kmr- nob- uzb- snd- lat- nya- grn- mya- orm- lin- hye- yue- pan- jpn- kaz- npi- kik- kat- guj- kan- tgk- ukr- ces- lav- bak- khm- cak- fao- glg- ltz- xog- lao- mlt- sin- aka- sna- che- mam- ita- quc- srp- mri- tuv- nno- pus- eus- kbp- ory- lug- bre- luo- nhx- slk- ewe- fin- rif- dan- yid- yao- mos- quh- hne- xon- new- quy- est- dyu- ttq- bam- pse- uig- sck- ngl- tso- mup- dga- seh- lis- wal- ctg- bfz- bxk- ceb- kru- war- khg- bbc- thl- vmw- zne- sid- tpi- nym- bgq- bfy- hlb- teo- fon- kfx- bfa- mag- ayr- any- mnk- adx- ava- hyw- san- kek- chv- kri- btx- nhy- dnj- lon- men- ium- nga- nsu- prk- kir- bom- run- hwc- mnw- ubl- kin- rkt- xmm- iba- gux- ses- wsg- tir- gbm- mai- nyy- nan- nyn- gog- ngu- hoc- nyf- sus- bcc- hak- grt- suk- nij- kaa- bem- rmy- nus- ach- awa- dip- rim- nhe- pcm- kde- tem- quz- bba- kbr- taj- dik- dgo- bgc- xnr- kac- laj- dag- ktb- mgh- shn- oci- zyb- alz- wol- guw- nia- bci- sba- kab- nnb- ilo- mfe- xpe- bcl- haw- mad- ljp- gmv- nyo- kxm- nod- sag- sas- myx- sgw- mak- kfy- jam- lgg- nhi- mey- sgj- hay- pam- heh- nhw- yua- shi- mrw- hil- pag- cce- npl- ace- kam- min- pko- toi- ncj- umb- hno- ban- syl- bxg- nse- xho- mkw- nch- mas- bum- mww- epo- tzm- zul- lrc- ibo- abk- azz- guz- ksw- lus- ckb- mer- pov- rhg- knc- tum- nso- bho- ndc- ijc- qug- lub- srr- mni- zza- dje- tiv- gle- lua- swk- ada- lic- skr- mfa- bto- unr- hdy- kea- glk- ast- nup- sat- ktu- bhb- sgc- dks- ncl- emk- urh- tsc- idu- igb- its- kng- kmb- tsn- bin- gom- ven- sef- sco- trp- glv- haq- kha- rmn- sot- sou- gno- igl- efi- nde- rki- kjg- fan- wci- bjn- pmy- bqi- ina- hni- the- nuz- ajg- ymm- fmu- nyk- snk- esg- thq- pht- wes- pnb- phr- mui- tkt- bug- mrr- kas- zgb- lir- vah- ssw- iii- brx- rwr- kmc- dib- pcc- zyn- hea- hms- thr- wbr- bfb- wtm- blk- dhd- swv- zzj- niq- mtr- gju- kjp- haz- shy- nbl- aii- sjp- bns- brh- msi- tsg- tcy- kbl- noe- tyz- ahr- aar- wuu- kbd- bca- pwr- hsn- kua- tdd- bgp- abs- zlj- ebo- bra- nhp- tts- zyj- lmn- cqd- dcc- cjk- bfr- bew- arg- drs- chw- bej- bjj- ibb- tig- nut- jax- tdg- nlv- pch- fvr- mlq- kfr- nhn- tji- hoj- cpx- cdo- bgn- btm- trf- daq- max- nba- mut- hnd- ryu- abr- sop- odk- nap- gbr- czh- vls- gdx- yaf- sdh- anw- ttj- nhg- cgg- ifm- mdh- scn- lki- luz- stv- kmz- nds- mtq- knn- mnp- bar- mzn- gsw- fry</details>## Model details- **Developed by:** Vineel Pratap et al.- **Model type:** Multi-Lingual Automatic Speech Recognition model- **Language(s):** 512 languages, see [supported languages](#supported-languages)- **License:** CC-BY-NC 4.0 license- **Num parameters**: 1 billion- **Audio sampling rate**: 16,000 kHz- **Cite as:**@article{pratap2023mms,title={Scaling Speech Technology to 1,000+ Languages},author={Vineel Pratap and Andros Tjandra and Bowen Shi and Paden Tomasello and Arun Babu and Sayani Kundu and Ali Elkahky and Zhaoheng Ni and Apoorv Vyas and Maryam Fazel-Zarandi and Alexei Baevski and Yossi Adi and Xiaohui Zhang and Wei-Ning Hsu and Alexis Conneau and Michael Auli},journal={arXiv},year={2023}}## Additional Links- [Blog post](https://ai.facebook.com/blog/multilingual-model-speech-recognition/)- [Transformers documentation](https://huggingface.co/docs/transformers/main/en/model_doc/mms).- [Paper](https://arxiv.org/abs/2305.13516)- [GitHub Repository](https://github.com/facebookresearch/fairseq/tree/main/examples/mms#asr)- [Other **MMS** checkpoints](https://huggingface.co/models?other=mms)- MMS base checkpoints:- [facebook/mms-1b](https://huggingface.co/facebook/mms-1b)- [facebook/mms-300m](https://huggingface.co/facebook/mms-300m)- [Official Space](https://huggingface.co/spaces/facebook/MMS)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512- ara- cmn- eng- spa- fra- mlg- swe- por- vie- ful- sun- asm- ben- zlm- kor- ind- hin- tuk- urd- aze- slv- mon- hau- tel- swh- bod- rus- tur- heb- mar- som- tgl- tat- tha- cat- ron- mal- bel- pol- yor- nld- bul- hat- afr- isl- amh- tam- hun- hrv- lit- cym- fas- mkd- ell- bos- deu- sqi- jav- kmr- nob- uzb- snd- lat- nya- grn- mya- orm- lin- hye- yue- pan- jpn- kaz- npi- kik- kat- guj- kan- tgk- ukr- ces- lav- bak- khm- cak- fao- glg- ltz- xog- lao- mlt- sin- aka- sna- che- mam- ita- quc- srp- mri- tuv- nno- pus- eus- kbp- ory- lug- bre- luo- nhx- slk- ewe- fin- rif- dan- yid- yao- mos- quh- hne- xon- new- quy- est- dyu- ttq- bam- pse- uig- sck- ngl- tso- mup- dga- seh- lis- wal- ctg- bfz- bxk- ceb- kru- war- khg- bbc- thl- vmw- zne- sid- tpi- nym- bgq- bfy- hlb- teo- fon- kfx- bfa- mag- ayr- any- mnk- adx- ava- hyw- san- kek- chv- kri- btx- nhy- dnj- lon- men- ium- nga- nsu- prk- kir- bom- run- hwc- mnw- ubl- kin- rkt- xmm- iba- gux- ses- wsg- tir- gbm- mai- nyy- nan- nyn- gog- ngu- hoc- nyf- sus- bcc- hak- grt- suk- nij- kaa- bem- rmy- nus- ach- awa- dip- rim- nhe- pcm- kde- tem- quz- bba- kbr- taj- dik- dgo- bgc- xnr- kac- laj- dag- ktb- mgh- shn- oci- zyb- alz- wol- guw- nia- bci- sba- kab- nnb- ilo- mfe- xpe- bcl- haw- mad- ljp- gmv- nyo- kxm- nod- sag- sas- myx- sgw- mak- kfy- jam- lgg- nhi- mey- sgj- hay- pam- heh- nhw- yua- shi- mrw- hil- pag- cce- npl- ace- kam- min- pko- toi- ncj- umb- hno- ban- syl- bxg- nse- xho- mkw- nch- mas- bum- mww- epo- tzm- zul- lrc- ibo- abk- azz- guz- ksw- lus- ckb- mer- pov- rhg- knc- tum- nso- bho- ndc- ijc- qug- lub- srr- mni- zza- dje- tiv- gle- lua- swk- ada- lic- skr- mfa- bto- unr- hdy- kea- glk- ast- nup- sat- ktu- bhb- sgc- dks- ncl- emk- urh- tsc- idu- igb- its- kng- kmb- tsn- bin- gom- ven- sef- sco- trp- glv- haq- kha- rmn- sot- sou- gno- igl- efi- nde- rki- kjg- fan- wci- bjn- pmy- bqi- ina- hni- the- nuz- ajg- ymm- fmu- nyk- snk- esg- thq- pht- wes- pnb- phr- mui- tkt- bug- mrr- kas- zgb- lir- vah- ssw- iii- brx- rwr- kmc- dib- pcc- zyn- hea- hms- thr- wbr- bfb- wtm- blk- dhd- swv- zzj- niq- mtr- gju- kjp- haz- shy- nbl- aii- sjp- bns- brh- msi- tsg- tcy- kbl- noe- tyz- ahr- aar- wuu- kbd- bca- pwr- hsn- kua- tdd- bgp- abs- zlj- ebo- bra- nhp- tts- zyj- lmn- cqd- dcc- cjk- bfr- bew- arg- drs- chw- bej- bjj- ibb- tig- nut- jax- tdg- nlv- pch- fvr- mlq- kfr- nhn- tji- hoj- cpx- cdo- bgn- btm- trf- daq- max- nba- mut- hnd- ryu- abr- sop- odk- nap- gbr- czh- vls- gdx- yaf- sdh- anw- ttj- nhg- cgg- ifm- mdh- scn- lki- luz- stv- kmz- nds- mtq- knn- mnp- bar- mzn- gsw- fryREADME.md+808-1
langs.txtAdded+512