import{s as Yl,o as Al,n as xl}from"../chunks/scheduler.01eeda35.js";import{S as Sl,i as ql,g as o,s as a,r as p,A as Ll,h as i,f as l,c as n,j as Fl,u as m,x as r,k as ll,y as Pl,a as s,v as c,d,t as M,w as u}from"../chunks/index.6dd51b66.js";import{T as _l}from"../chunks/Tip.de9bae2b.js";import{C as f}from"../chunks/CodeBlock.19ec9b8c.js";import{H as j,E as Kl}from"../chunks/index.58fe8f9d.js";function Dl(ze){let y,g="You can safely ignore a warning such as:",w,b,T;return b=new f({props:{code:"U29tZSUyMHdlaWdodHMlMjBvZiUyMFdhdjJWZWMyRm9yQ1RDJTIwd2VyZSUyMG5vdCUyMGluaXRpYWxpemVkJTIwZnJvbSUyMHRoZSUyMG1vZGVsJTIwY2hlY2twb2ludCUyMGF0JTIwZmFjZWJvb2slMkZtbXMtMWItYWxsJTIwYW5kJTIwYXJlJTIwbmV3bHklMjBpbml0aWFsaXplZCUyMGJlY2F1c2UlMjB0aGUlMjBzaGFwZXMlMjBkaWQlMjBub3QlMjBtYXRjaCUzQSUwQS0lMjBsbV9oZWFkLmJpYXMlM0ElMjBmb3VuZCUyMHNoYXBlJTIwdG9yY2guU2l6ZSglNUIxNTQlNUQpJTIwaW4lMjB0aGUlMjBjaGVja3BvaW50JTIwYW5kJTIwdG9yY2guU2l6ZSglNUIzMTQlNUQpJTIwaW4lMjB0aGUlMjBtb2RlbCUyMGluc3RhbnRpYXRlZCUwQS0lMjBsbV9oZWFkLndlaWdodCUzQSUyMGZvdW5kJTIwc2hhcGUlMjB0b3JjaC5TaXplKCU1QjE1NCUyQyUyMDEyODAlNUQpJTIwaW4lMjB0aGUlMjBjaGVja3BvaW50JTIwYW5kJTIwdG9yY2guU2l6ZSglNUIzMTQlMkMlMjAxMjgwJTVEKSUyMGluJTIwdGhlJTIwbW9kZWwlMjBpbnN0YW50aWF0ZWQlMEFZb3UlMjBzaG91bGQlMjBwcm9iYWJseSUyMFRSQUlOJTIwdGhpcyUyMG1vZGVsJTIwb24lMjBhJTIwZG93bi1zdHJlYW0lMjB0YXNrJTIwdG8lMjBiZSUyMGFibGUlMjB0byUyMHVzZSUyMGl0JTIwZm9yJTIwcHJlZGljdGlvbnMlMjBhbmQlMjBpbmZlcmVuY2Uu",highlighted:`Some weights of Wav2Vec2ForCTC were not initialized from the model checkpoint at facebook/mms-1b-all and are newly initialized because the shapes did not match:
- lm_head.bias: found shape torch.Size([154]) in the checkpoint and torch.Size([314]) in the model instantiated
- lm_head.weight: found shape torch.Size([154, 1280]) in the checkpoint and torch.Size([314, 1280]) in the model instantiated
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.`,wrap:!1}}),{c(){y=o("p"),y.textContent=g,w=a(),p(b.$$.fragment)},l(h){y=i(h,"P",{"data-svelte-h":!0}),r(y)!=="svelte-17yglm5"&&(y.textContent=g),w=n(h),m(b.$$.fragment,h)},m(h,J){s(h,y,J),s(h,w,J),c(b,h,J),T=!0},p:xl,i(h){T||(d(b.$$.fragment,h),T=!0)},o(h){M(b.$$.fragment,h),T=!1},d(h){h&&(l(y),l(w)),u(b,h)}}}function Ol(ze){let y,g=`The MMS for ASR architecture is based on the Wav2Vec2 model, refer to <a href="wav2vec2">Wav2Vec2’s documentation page</a> for further
details on how to finetune with models for various downstream tasks.`,w,b,T='MMS-TTS uses the same model architecture as VITS, refer to <a href="vits">VITS’s documentation page</a> for API reference.';return{c(){y=o("p"),y.innerHTML=g,w=a(),b=o("p"),b.innerHTML=T},l(h){y=i(h,"P",{"data-svelte-h":!0}),r(y)!=="svelte-ez75p4"&&(y.innerHTML=g),w=n(h),b=i(h,"P",{"data-svelte-h":!0}),r(b)!=="svelte-102khel"&&(b.innerHTML=T)},m(h,J){s(h,y,J),s(h,w,J),s(h,b,J)},p:xl,d(h){h&&(l(y),l(w),l(b))}}}function es(ze){let y,g,w,b,T,h,J,sl=`<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/> <img alt="TensorFlow" src="https://img.shields.io/badge/TensorFlow-FF6F00?style=flat&amp;logo=tensorflow&amp;logoColor=white"/> <img alt="Flax" src="https://img.shields.io/badge/Flax-29a79b.svg?style=flat&amp;logo=data:image/png;base64,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
"/>`,Ee,Z,He,W,al=`The MMS model was proposed in <a href="https://arxiv.org/abs/2305.13516" rel="nofollow">Scaling Speech Technology to 1,000+ Languages</a>
by Vineel Pratap, Andros Tjandra, Bowen Shi, Paden Tomasello, Arun Babu, Sayani Kundu, Ali Elkahky, Zhaoheng Ni, Apoorv Vyas, Maryam Fazel-Zarandi, Alexei Baevski, Yossi Adi, Xiaohui Zhang, Wei-Ning Hsu, Alexis Conneau, Michael Auli`,Fe,k,nl="The abstract from the paper is the following:",_e,C,ol=`<em>Expanding the language coverage of speech technology has the potential to improve access to information for many more people.
However, current speech technology is restricted to about one hundred languages which is a small fraction of the over 7,000
languages spoken around the world.
The Massively Multilingual Speech (MMS) project increases the number of supported languages by 10-40x, depending on the task.
The main ingredients are a new dataset based on readings of publicly available religious texts and effectively leveraging
self-supervised learning. We built pre-trained wav2vec 2.0 models covering 1,406 languages,
a single multilingual automatic speech recognition model for 1,107 languages, speech synthesis models
for the same number of languages, as well as a language identification model for 4,017 languages.
Experiments show that our multilingual speech recognition model more than halves the word error rate of
Whisper on 54 languages of the FLEURS benchmark while being trained on a small fraction of the labeled data.</em>`,xe,I,il='Here are the different models open sourced in the MMS project. The models and code are originally released <a href="https://github.com/facebookresearch/fairseq/tree/main/examples/mms" rel="nofollow">here</a>. We have add them to the <code>transformers</code> framework, making them easier to use.',Ye,R,Ae,B,rl='The ASR model checkpoints  can be found here : <a href="https://huggingface.co/facebook/mms-1b-fl102" rel="nofollow">mms-1b-fl102</a>, <a href="https://huggingface.co/facebook/mms-1b-l1107" rel="nofollow">mms-1b-l1107</a>, <a href="https://huggingface.co/facebook/mms-1b-all" rel="nofollow">mms-1b-all</a>. For best accuracy, use the <code>mms-1b-all</code> model.',Se,X,pl="Tips:",qe,V,ml=`<li>All ASR models accept a float array corresponding to the raw waveform of the speech signal. The raw waveform should be pre-processed with <a href="/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2FeatureExtractor">Wav2Vec2FeatureExtractor</a>.</li> <li>The models were trained using connectionist temporal classification (CTC) so the model output has to be decoded using
<a href="/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer">Wav2Vec2CTCTokenizer</a>.</li> <li>You can load different language adapter weights for different languages via <a href="/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC.load_adapter">load_adapter()</a>. Language adapters only consists of roughly 2 million parameters
and can therefore be efficiently loaded on the fly when needed.</li>`,Le,G,Pe,$,cl=`By default MMS loads adapter weights for English. If you want to load adapter weights of another language
make sure to specify <code>target_lang=&lt;your-chosen-target-lang&gt;</code> as well as <code>&quot;ignore_mismatched_sizes=True</code>.
The <code>ignore_mismatched_sizes=True</code> keyword has to be passed to allow the language model head to be resized according
to the vocabulary of the specified language.
Similarly, the processor should be loaded with the same target language`,Ke,N,De,U,Oe,z,dl="If you want to use the ASR pipeline, you can load your chosen target language as such:",et,Q,tt,E,lt,H,Ml=`Next, let’s look at how we can run MMS in inference and change adapter layers after having called <code>~PretrainedModel.from_pretrained</code>
First, we load audio data in different languages using the <a href="https://github.com/huggingface/datasets" rel="nofollow">Datasets</a>.`,st,F,at,_,ul="Next, we load the model and processor",nt,x,ot,Y,hl=`Now we process the audio data, pass the processed audio data to the model and transcribe the model output,
just like we usually do for <a href="/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC">Wav2Vec2ForCTC</a>.`,it,A,rt,S,yl=`We can now keep the same model in memory and simply switch out the language adapters by
calling the convenient <a href="/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2ForCTC.load_adapter">load_adapter()</a> function for the model and <a href="/docs/transformers/main/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.set_target_lang">set_target_lang()</a> for the tokenizer.
We pass the target language as an input - <code>&quot;fra&quot;</code> for French.`,pt,q,mt,L,fl="In the same way the language can be switched out for all other supported languages. Please have a look at:",ct,P,dt,K,bl="to see all supported languages.",Mt,D,Jl='To further improve performance from ASR models, language model decoding can be used. See the documentation <a href="https://huggingface.co/facebook/mms-1b-all" rel="nofollow">here</a> for further details.',ut,O,ht,ee,wl=`MMS-TTS uses the same model architecture as VITS, which was added to 🤗 Transformers in v4.33. MMS trains a separate
model checkpoint for each of the 1100+ languages in the project. All available checkpoints can be found on the Hugging
Face Hub: <a href="https://huggingface.co/models?sort=trending&amp;search=facebook%2Fmms-tts" rel="nofollow">facebook/mms-tts</a>, and the inference
documentation under <a href="https://huggingface.co/docs/transformers/main/en/model_doc/vits" rel="nofollow">VITS</a>.`,yt,te,ft,le,Tl="To use the MMS model, first update to the latest version of the Transformers library:",bt,se,Jt,ae,gl=`Since the flow-based model in VITS is non-deterministic, it is good practice to set a seed to ensure reproducibility of
the outputs.`,wt,ne,jl=`<li>For languages with a Roman alphabet, such as English or French, the tokenizer can be used directly to
pre-process the text inputs. The following code example runs a forward pass using the MMS-TTS English checkpoint:</li>`,Tt,oe,gt,ie,Ul="The resulting waveform can be saved as a <code>.wav</code> file:",jt,re,Ut,pe,vl="Or displayed in a Jupyter Notebook / Google Colab:",vt,me,Zt,ce,Zl=`For certain languages with non-Roman alphabets, such as Arabic, Mandarin or Hindi, the <a href="https://github.com/isi-nlp/uroman" rel="nofollow"><code>uroman</code></a>
perl package is required to pre-process the text inputs to the Roman alphabet.`,Wt,de,Wl=`You can check whether you require the <code>uroman</code> package for your language by inspecting the <code>is_uroman</code> attribute of
the pre-trained <code>tokenizer</code>:`,kt,Me,Ct,ue,kl=`If required, you should apply the uroman package to your text inputs <strong>prior</strong> to passing them to the <code>VitsTokenizer</code>,
since currently the tokenizer does not support performing the pre-processing itself.`,It,he,Cl="To do this, first clone the uroman repository to your local machine and set the bash variable <code>UROMAN</code> to the local path:",Rt,ye,Bt,fe,Il=`You can then pre-process the text input using the following code snippet. You can either rely on using the bash variable
<code>UROMAN</code> to point to the uroman repository, or you can pass the uroman directory as an argument to the <code>uromanize</code> function:`,Xt,be,Vt,Je,Rl="<strong>Tips:</strong>",Gt,we,Bl="<li>The MMS-TTS checkpoints are trained on lower-cased, un-punctuated text. By default, the <code>VitsTokenizer</code> <em>normalizes</em> the inputs by removing any casing and punctuation, to avoid passing out-of-vocabulary characters to the model. Hence, the model is agnostic to casing and punctuation, so these should be avoided in the text prompt. You can disable normalisation by setting <code>normalize=False</code> in the call to the tokenizer, but this will lead to un-expected behaviour and is discouraged.</li> <li>The speaking rate can be varied by setting the attribute <code>model.speaking_rate</code> to a chosen value. Likewise, the randomness of the noise is controlled by <code>model.noise_scale</code>:</li>",$t,Te,Nt,ge,zt,je,Xl='Different LID models are available based on the number of languages they can recognize - <a href="https://huggingface.co/facebook/mms-lid-126" rel="nofollow">126</a>, <a href="https://huggingface.co/facebook/mms-lid-256" rel="nofollow">256</a>, <a href="https://huggingface.co/facebook/mms-lid-512" rel="nofollow">512</a>, <a href="https://huggingface.co/facebook/mms-lid-1024" rel="nofollow">1024</a>, <a href="https://huggingface.co/facebook/mms-lid-2048" rel="nofollow">2048</a>, <a href="https://huggingface.co/facebook/mms-lid-4017" rel="nofollow">4017</a>.',Qt,Ue,Et,ve,Vl="First, we install transformers and some other libraries",Ht,Ze,Ft,We,Gl="Next, we load a couple of audio samples via <code>datasets</code>. Make sure that the audio data is sampled to 16000 kHz.",_t,ke,xt,Ce,$l="Next, we load the model and processor",Yt,Ie,At,Re,Nl='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 <a href="https://huggingface.co/harshit345/xlsr-wav2vec-speech-emotion-recognition" rel="nofollow">ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition</a>',St,Be,qt,Xe,zl="To see all the supported languages of a checkpoint, you can print out the language ids as follows:",Lt,Ve,Pt,Ge,Kt,$e,Ql=`Pretrained models are available for two different sizes - <a href="https://huggingface.co/facebook/mms-300m" rel="nofollow">300M</a> ,
<a href="https://huggingface.co/facebook/mms-1b" rel="nofollow">1Bil</a>.`,Dt,v,Ot,Ne,el,Qe,tl;return T=new j({props:{title:"MMS",local:"mms",headingTag:"h1"}}),Z=new j({props:{title:"Overview",local:"overview",headingTag:"h2"}}),R=new j({props:{title:"Automatic Speech Recognition (ASR)",local:"automatic-speech-recognition-asr",headingTag:"h3"}}),G=new j({props:{title:"Loading",local:"loading",headingTag:"h4"}}),N=new f({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyRm9yQ1RDJTJDJTIwQXV0b1Byb2Nlc3NvciUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyZmFjZWJvb2slMkZtbXMtMWItYWxsJTIyJTBBdGFyZ2V0X2xhbmclMjAlM0QlMjAlMjJmcmElMjIlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRhcmdldF9sYW5nJTNEdGFyZ2V0X2xhbmcpJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMkZvckNUQy5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjB0YXJnZXRfbGFuZyUzRHRhcmdldF9sYW5nJTJDJTIwaWdub3JlX21pc21hdGNoZWRfc2l6ZXMlM0RUcnVlKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2ForCTC, AutoProcessor

model_id = <span class="hljs-string">&quot;facebook/mms-1b-all&quot;</span>
target_lang = <span class="hljs-string">&quot;fra&quot;</span>

processor = AutoProcessor.from_pretrained(model_id, target_lang=target_lang)
model = Wav2Vec2ForCTC.from_pretrained(model_id, target_lang=target_lang, ignore_mismatched_sizes=<span class="hljs-literal">True</span>)`,wrap:!1}}),U=new _l({props:{$$slots:{default:[Dl]},$$scope:{ctx:ze}}}),Q=new f({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJmYWNlYm9vayUyRm1tcy0xYi1hbGwlMjIlMEF0YXJnZXRfbGFuZyUyMCUzRCUyMCUyMmZyYSUyMiUwQSUwQXBpcGUlMjAlM0QlMjBwaXBlbGluZShtb2RlbCUzRG1vZGVsX2lkJTJDJTIwbW9kZWxfa3dhcmdzJTNEJTdCJTIydGFyZ2V0X2xhbmclMjIlM0ElMjAlMjJmcmElMjIlMkMlMjAlMjJpZ25vcmVfbWlzbWF0Y2hlZF9zaXplcyUyMiUzQSUyMFRydWUlN0Qp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

model_id = <span class="hljs-string">&quot;facebook/mms-1b-all&quot;</span>
target_lang = <span class="hljs-string">&quot;fra&quot;</span>

pipe = pipeline(model=model_id, model_kwargs={<span class="hljs-string">&quot;target_lang&quot;</span>: <span class="hljs-string">&quot;fra&quot;</span>, <span class="hljs-string">&quot;ignore_mismatched_sizes&quot;</span>: <span class="hljs-literal">True</span>})`,wrap:!1}}),E=new j({props:{title:"Inference",local:"inference",headingTag:"h4"}}),F=new f({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTJDJTIwQXVkaW8lMEElMEElMjMlMjBFbmdsaXNoJTBBc3RyZWFtX2RhdGElMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIybW96aWxsYS1mb3VuZGF0aW9uJTJGY29tbW9uX3ZvaWNlXzEzXzAlMjIlMkMlMjAlMjJlbiUyMiUyQyUyMHNwbGl0JTNEJTIydGVzdCUyMiUyQyUyMHN0cmVhbWluZyUzRFRydWUpJTBBc3RyZWFtX2RhdGElMjAlM0QlMjBzdHJlYW1fZGF0YS5jYXN0X2NvbHVtbiglMjJhdWRpbyUyMiUyQyUyMEF1ZGlvKHNhbXBsaW5nX3JhdGUlM0QxNjAwMCkpJTBBZW5fc2FtcGxlJTIwJTNEJTIwbmV4dChpdGVyKHN0cmVhbV9kYXRhKSklNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVEJTBBJTBBJTIzJTIwRnJlbmNoJTBBc3RyZWFtX2RhdGElMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIybW96aWxsYS1mb3VuZGF0aW9uJTJGY29tbW9uX3ZvaWNlXzEzXzAlMjIlMkMlMjAlMjJmciUyMiUyQyUyMHNwbGl0JTNEJTIydGVzdCUyMiUyQyUyMHN0cmVhbWluZyUzRFRydWUpJTBBc3RyZWFtX2RhdGElMjAlM0QlMjBzdHJlYW1fZGF0YS5jYXN0X2NvbHVtbiglMjJhdWRpbyUyMiUyQyUyMEF1ZGlvKHNhbXBsaW5nX3JhdGUlM0QxNjAwMCkpJTBBZnJfc2FtcGxlJTIwJTNEJTIwbmV4dChpdGVyKHN0cmVhbV9kYXRhKSklNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVE",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset, Audio

<span class="hljs-comment"># English</span>
stream_data = load_dataset(<span class="hljs-string">&quot;mozilla-foundation/common_voice_13_0&quot;</span>, <span class="hljs-string">&quot;en&quot;</span>, split=<span class="hljs-string">&quot;test&quot;</span>, streaming=<span class="hljs-literal">True</span>)
stream_data = stream_data.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=<span class="hljs-number">16000</span>))
en_sample = <span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(stream_data))[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>]

<span class="hljs-comment"># French</span>
stream_data = load_dataset(<span class="hljs-string">&quot;mozilla-foundation/common_voice_13_0&quot;</span>, <span class="hljs-string">&quot;fr&quot;</span>, split=<span class="hljs-string">&quot;test&quot;</span>, streaming=<span class="hljs-literal">True</span>)
stream_data = stream_data.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=<span class="hljs-number">16000</span>))
fr_sample = <span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(stream_data))[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>]`,wrap:!1}}),x=new f({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyRm9yQ1RDJTJDJTIwQXV0b1Byb2Nlc3NvciUwQWltcG9ydCUyMHRvcmNoJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJmYWNlYm9vayUyRm1tcy0xYi1hbGwlMjIlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCklMEFtb2RlbCUyMCUzRCUyMFdhdjJWZWMyRm9yQ1RDLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2ForCTC, AutoProcessor
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;facebook/mms-1b-all&quot;</span>

processor = AutoProcessor.from_pretrained(model_id)
model = Wav2Vec2ForCTC.from_pretrained(model_id)`,wrap:!1}}),A=new f({props:{code:"aW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGVuX3NhbXBsZSUyQyUyMHNhbXBsaW5nX3JhdGUlM0QxNl8wMDAlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQWlkcyUyMCUzRCUyMHRvcmNoLmFyZ21heChvdXRwdXRzJTJDJTIwZGltJTNELTEpJTVCMCU1RCUwQXRyYW5zY3JpcHRpb24lMjAlM0QlMjBwcm9jZXNzb3IuZGVjb2RlKGlkcyklMEElMjMlMjAnam9lJTIwa2V0b24lMjBkaXNhcHByb3ZlZCUyMG9mJTIwZmlsbXMlMjBhbmQlMjBidXN0ZXIlMjBhbHNvJTIwaGFkJTIwcmVzZXJ2YXRpb25zJTIwYWJvdXQlMjB0aGUlMjBtZWRpYSc=",highlighted:`inputs = processor(en_sample, sampling_rate=<span class="hljs-number">16_000</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-keyword">with</span> torch.no_grad():
    outputs = model(**inputs).logits

ids = torch.argmax(outputs, dim=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>]
transcription = processor.decode(ids)
<span class="hljs-comment"># &#x27;joe keton disapproved of films and buster also had reservations about the media&#x27;</span>`,wrap:!1}}),q=new f({props:{code:"cHJvY2Vzc29yLnRva2VuaXplci5zZXRfdGFyZ2V0X2xhbmcoJTIyZnJhJTIyKSUwQW1vZGVsLmxvYWRfYWRhcHRlciglMjJmcmElMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGZyX3NhbXBsZSUyQyUyMHNhbXBsaW5nX3JhdGUlM0QxNl8wMDAlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQWlkcyUyMCUzRCUyMHRvcmNoLmFyZ21heChvdXRwdXRzJTJDJTIwZGltJTNELTEpJTVCMCU1RCUwQXRyYW5zY3JpcHRpb24lMjAlM0QlMjBwcm9jZXNzb3IuZGVjb2RlKGlkcyklMEElMjMlMjAlMjJjZSUyMGRlcm5pZXIlMjBlc3QlMjB2b2wlQzMlQTklMjB0b3V0JTIwYXUlMjBsb25nJTIwZGUlMjBsJ2hpc3RvaXJlJTIwcm9tYWluZSUyMg==",highlighted:`processor.tokenizer.set_target_lang(<span class="hljs-string">&quot;fra&quot;</span>)
model.load_adapter(<span class="hljs-string">&quot;fra&quot;</span>)

inputs = processor(fr_sample, sampling_rate=<span class="hljs-number">16_000</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-keyword">with</span> torch.no_grad():
    outputs = model(**inputs).logits

ids = torch.argmax(outputs, dim=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>]
transcription = processor.decode(ids)
<span class="hljs-comment"># &quot;ce dernier est volé tout au long de l&#x27;histoire romaine&quot;</span>`,wrap:!1}}),P=new f({props:{code:"cHJvY2Vzc29yLnRva2VuaXplci52b2NhYi5rZXlzKCk=",highlighted:"processor.tokenizer.vocab.keys()",wrap:!1}}),O=new j({props:{title:"Speech Synthesis (TTS)",local:"speech-synthesis-tts",headingTag:"h3"}}),te=new j({props:{title:"Inference",local:"inference",headingTag:"h4"}}),se=new f({props:{code:"cGlwJTIwaW5zdGFsbCUyMC0tdXBncmFkZSUyMHRyYW5zZm9ybWVycyUyMGFjY2VsZXJhdGU=",highlighted:"pip install --upgrade transformers accelerate",wrap:!1}}),oe=new f({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwVml0c1Rva2VuaXplciUyQyUyMFZpdHNNb2RlbCUyQyUyMHNldF9zZWVkJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwVml0c1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZtbXMtdHRzLWVuZyUyMiklMEFtb2RlbCUyMCUzRCUyMFZpdHNNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZtbXMtdHRzLWVuZyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIodGV4dCUzRCUyMkhlbGxvJTIwLSUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFzZXRfc2VlZCg1NTUpJTIwJTIwJTIzJTIwbWFrZSUyMGRldGVybWluaXN0aWMlMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQXdhdmVmb3JtJTIwJTNEJTIwb3V0cHV0cy53YXZlZm9ybSU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> VitsTokenizer, VitsModel, set_seed

tokenizer = VitsTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mms-tts-eng&quot;</span>)
model = VitsModel.from_pretrained(<span class="hljs-string">&quot;facebook/mms-tts-eng&quot;</span>)

inputs = tokenizer(text=<span class="hljs-string">&quot;Hello - my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

set_seed(<span class="hljs-number">555</span>)  <span class="hljs-comment"># make deterministic</span>

<span class="hljs-keyword">with</span> torch.no_grad():
   outputs = model(**inputs)

waveform = outputs.waveform[<span class="hljs-number">0</span>]`,wrap:!1}}),re=new f({props:{code:"aW1wb3J0JTIwc2NpcHklMEElMEFzY2lweS5pby53YXZmaWxlLndyaXRlKCUyMnN5bnRoZXNpemVkX3NwZWVjaC53YXYlMjIlMkMlMjByYXRlJTNEbW9kZWwuY29uZmlnLnNhbXBsaW5nX3JhdGUlMkMlMjBkYXRhJTNEd2F2ZWZvcm0p",highlighted:`<span class="hljs-keyword">import</span> scipy

scipy.io.wavfile.write(<span class="hljs-string">&quot;synthesized_speech.wav&quot;</span>, rate=model.config.sampling_rate, data=waveform)`,wrap:!1}}),me=new f({props:{code:"ZnJvbSUyMElQeXRob24uZGlzcGxheSUyMGltcG9ydCUyMEF1ZGlvJTBBJTBBQXVkaW8od2F2ZWZvcm0lMkMlMjByYXRlJTNEbW9kZWwuY29uZmlnLnNhbXBsaW5nX3JhdGUp",highlighted:`<span class="hljs-keyword">from</span> IPython.display <span class="hljs-keyword">import</span> Audio

Audio(waveform, rate=model.config.sampling_rate)`,wrap:!1}}),Me=new f({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpdHNUb2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBWaXRzVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm1tcy10dHMtZW5nJTIyKSUwQXByaW50KHRva2VuaXplci5pc191cm9tYW4p",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> VitsTokenizer

tokenizer = VitsTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mms-tts-eng&quot;</span>)
<span class="hljs-built_in">print</span>(tokenizer.is_uroman)`,wrap:!1}}),ye=new f({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZpc2ktbmxwJTJGdXJvbWFuLmdpdCUwQWNkJTIwdXJvbWFuJTBBZXhwb3J0JTIwVVJPTUFOJTNEJTI0KHB3ZCk=",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/isi-nlp/uroman.git
<span class="hljs-built_in">cd</span> uroman
<span class="hljs-built_in">export</span> UROMAN=$(<span class="hljs-built_in">pwd</span>)`,wrap:!1}}),be=new f({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwVml0c1Rva2VuaXplciUyQyUyMFZpdHNNb2RlbCUyQyUyMHNldF9zZWVkJTBBaW1wb3J0JTIwb3MlMEFpbXBvcnQlMjBzdWJwcm9jZXNzJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwVml0c1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZtbXMtdHRzLWtvciUyMiklMEFtb2RlbCUyMCUzRCUyMFZpdHNNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZtbXMtdHRzLWtvciUyMiklMEElMEFkZWYlMjB1cm9tYW5pemUoaW5wdXRfc3RyaW5nJTJDJTIwdXJvbWFuX3BhdGgpJTNBJTBBJTIwJTIwJTIwJTIwJTIyJTIyJTIyQ29udmVydCUyMG5vbi1Sb21hbiUyMHN0cmluZ3MlMjB0byUyMFJvbWFuJTIwdXNpbmclMjB0aGUlMjAlNjB1cm9tYW4lNjAlMjBwZXJsJTIwcGFja2FnZS4lMjIlMjIlMjIlMEElMjAlMjAlMjAlMjBzY3JpcHRfcGF0aCUyMCUzRCUyMG9zLnBhdGguam9pbih1cm9tYW5fcGF0aCUyQyUyMCUyMmJpbiUyMiUyQyUyMCUyMnVyb21hbi5wbCUyMiklMEElMEElMjAlMjAlMjAlMjBjb21tYW5kJTIwJTNEJTIwJTVCJTIycGVybCUyMiUyQyUyMHNjcmlwdF9wYXRoJTVEJTBBJTBBJTIwJTIwJTIwJTIwcHJvY2VzcyUyMCUzRCUyMHN1YnByb2Nlc3MuUG9wZW4oY29tbWFuZCUyQyUyMHN0ZGluJTNEc3VicHJvY2Vzcy5QSVBFJTJDJTIwc3Rkb3V0JTNEc3VicHJvY2Vzcy5QSVBFJTJDJTIwc3RkZXJyJTNEc3VicHJvY2Vzcy5QSVBFKSUwQSUyMCUyMCUyMCUyMCUyMyUyMEV4ZWN1dGUlMjB0aGUlMjBwZXJsJTIwY29tbWFuZCUwQSUyMCUyMCUyMCUyMHN0ZG91dCUyQyUyMHN0ZGVyciUyMCUzRCUyMHByb2Nlc3MuY29tbXVuaWNhdGUoaW5wdXQlM0RpbnB1dF9zdHJpbmcuZW5jb2RlKCkpJTBBJTBBJTIwJTIwJTIwJTIwaWYlMjBwcm9jZXNzLnJldHVybmNvZGUlMjAhJTNEJTIwMCUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJhaXNlJTIwVmFsdWVFcnJvcihmJTIyRXJyb3IlMjAlN0Jwcm9jZXNzLnJldHVybmNvZGUlN0QlM0ElMjAlN0JzdGRlcnIuZGVjb2RlKCklN0QlMjIpJTBBJTBBJTIwJTIwJTIwJTIwJTIzJTIwUmV0dXJuJTIwdGhlJTIwb3V0cHV0JTIwYXMlMjBhJTIwc3RyaW5nJTIwYW5kJTIwc2tpcCUyMHRoZSUyMG5ldy1saW5lJTIwY2hhcmFjdGVyJTIwYXQlMjB0aGUlMjBlbmQlMEElMjAlMjAlMjAlMjByZXR1cm4lMjBzdGRvdXQuZGVjb2RlKCklNUIlM0EtMSU1RCUwQSUwQXRleHQlMjAlM0QlMjAlMjIlRUMlOUQlQjQlRUIlQjQlOTAlMjAlRUIlQUMlQjQlRUMlOEElQTglMjAlRUMlOUQlQkMlRUMlOUQlQjQlRUMlOTUlQkMlMjIlMEF1cm9tYW5pemVkX3RleHQlMjAlM0QlMjB1cm9tYW5pemUodGV4dCUyQyUyMHVyb21hbl9wYXRoJTNEb3MuZW52aXJvbiU1QiUyMlVST01BTiUyMiU1RCklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIodGV4dCUzRHVyb21hbml6ZWRfdGV4dCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBc2V0X3NlZWQoNTU1KSUyMCUyMCUyMyUyMG1ha2UlMjBkZXRlcm1pbmlzdGljJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQpJTBBJTBBd2F2ZWZvcm0lMjAlM0QlMjBvdXRwdXRzLndhdmVmb3JtJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> VitsTokenizer, VitsModel, set_seed
<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">import</span> subprocess

tokenizer = VitsTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mms-tts-kor&quot;</span>)
model = VitsModel.from_pretrained(<span class="hljs-string">&quot;facebook/mms-tts-kor&quot;</span>)

<span class="hljs-keyword">def</span> <span class="hljs-title function_">uromanize</span>(<span class="hljs-params">input_string, uroman_path</span>):
    <span class="hljs-string">&quot;&quot;&quot;Convert non-Roman strings to Roman using the \`uroman\` perl package.&quot;&quot;&quot;</span>
    script_path = os.path.join(uroman_path, <span class="hljs-string">&quot;bin&quot;</span>, <span class="hljs-string">&quot;uroman.pl&quot;</span>)

    command = [<span class="hljs-string">&quot;perl&quot;</span>, script_path]

    process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    <span class="hljs-comment"># Execute the perl command</span>
    stdout, stderr = process.communicate(<span class="hljs-built_in">input</span>=input_string.encode())

    <span class="hljs-keyword">if</span> process.returncode != <span class="hljs-number">0</span>:
        <span class="hljs-keyword">raise</span> ValueError(<span class="hljs-string">f&quot;Error <span class="hljs-subst">{process.returncode}</span>: <span class="hljs-subst">{stderr.decode()}</span>&quot;</span>)

    <span class="hljs-comment"># Return the output as a string and skip the new-line character at the end</span>
    <span class="hljs-keyword">return</span> stdout.decode()[:-<span class="hljs-number">1</span>]

text = <span class="hljs-string">&quot;이봐 무슨 일이야&quot;</span>
uromanized_text = uromanize(text, uroman_path=os.environ[<span class="hljs-string">&quot;UROMAN&quot;</span>])

inputs = tokenizer(text=uromanized_text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

set_seed(<span class="hljs-number">555</span>)  <span class="hljs-comment"># make deterministic</span>
<span class="hljs-keyword">with</span> torch.no_grad():
   outputs = model(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>])

waveform = outputs.waveform[<span class="hljs-number">0</span>]`,wrap:!1}}),Te=new f({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwVml0c1Rva2VuaXplciUyQyUyMFZpdHNNb2RlbCUyQyUyMHNldF9zZWVkJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwVml0c1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZtbXMtdHRzLWVuZyUyMiklMEFtb2RlbCUyMCUzRCUyMFZpdHNNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZtbXMtdHRzLWVuZyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIodGV4dCUzRCUyMkhlbGxvJTIwLSUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBtYWtlJTIwZGV0ZXJtaW5pc3RpYyUwQXNldF9zZWVkKDU1NSklMjAlMjAlMEElMEElMjMlMjBtYWtlJTIwc3BlZWNoJTIwZmFzdGVyJTIwYW5kJTIwbW9yZSUyMG5vaXN5JTBBbW9kZWwuc3BlYWtpbmdfcmF0ZSUyMCUzRCUyMDEuNSUwQW1vZGVsLm5vaXNlX3NjYWxlJTIwJTNEJTIwMC44JTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> VitsTokenizer, VitsModel, set_seed

tokenizer = VitsTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mms-tts-eng&quot;</span>)
model = VitsModel.from_pretrained(<span class="hljs-string">&quot;facebook/mms-tts-eng&quot;</span>)

inputs = tokenizer(text=<span class="hljs-string">&quot;Hello - my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-comment"># make deterministic</span>
set_seed(<span class="hljs-number">555</span>)  

<span class="hljs-comment"># make speech faster and more noisy</span>
model.speaking_rate = <span class="hljs-number">1.5</span>
model.noise_scale = <span class="hljs-number">0.8</span>

<span class="hljs-keyword">with</span> torch.no_grad():
   outputs = model(**inputs)`,wrap:!1}}),ge=new j({props:{title:"Language Identification (LID)",local:"language-identification-lid",headingTag:"h3"}}),Ue=new j({props:{title:"Inference",local:"inference",headingTag:"h4"}}),Ze=new f({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRvcmNoJTIwYWNjZWxlcmF0ZSUyMGRhdGFzZXRzJTVCYXVkaW8lNUQlMEFwaXAlMjBpbnN0YWxsJTIwLS11cGdyYWRlJTIwdHJhbnNmb3JtZXJz",highlighted:`pip install torch accelerate datasets[audio]
pip install --upgrade transformers`,wrap:!1}}),ke=new f({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTJDJTIwQXVkaW8lMEElMEElMjMlMjBFbmdsaXNoJTBBc3RyZWFtX2RhdGElMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIybW96aWxsYS1mb3VuZGF0aW9uJTJGY29tbW9uX3ZvaWNlXzEzXzAlMjIlMkMlMjAlMjJlbiUyMiUyQyUyMHNwbGl0JTNEJTIydGVzdCUyMiUyQyUyMHN0cmVhbWluZyUzRFRydWUpJTBBc3RyZWFtX2RhdGElMjAlM0QlMjBzdHJlYW1fZGF0YS5jYXN0X2NvbHVtbiglMjJhdWRpbyUyMiUyQyUyMEF1ZGlvKHNhbXBsaW5nX3JhdGUlM0QxNjAwMCkpJTBBZW5fc2FtcGxlJTIwJTNEJTIwbmV4dChpdGVyKHN0cmVhbV9kYXRhKSklNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVEJTBBJTBBJTIzJTIwQXJhYmljJTBBc3RyZWFtX2RhdGElMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIybW96aWxsYS1mb3VuZGF0aW9uJTJGY29tbW9uX3ZvaWNlXzEzXzAlMjIlMkMlMjAlMjJhciUyMiUyQyUyMHNwbGl0JTNEJTIydGVzdCUyMiUyQyUyMHN0cmVhbWluZyUzRFRydWUpJTBBc3RyZWFtX2RhdGElMjAlM0QlMjBzdHJlYW1fZGF0YS5jYXN0X2NvbHVtbiglMjJhdWRpbyUyMiUyQyUyMEF1ZGlvKHNhbXBsaW5nX3JhdGUlM0QxNjAwMCkpJTBBYXJfc2FtcGxlJTIwJTNEJTIwbmV4dChpdGVyKHN0cmVhbV9kYXRhKSklNUIlMjJhdWRpbyUyMiU1RCU1QiUyMmFycmF5JTIyJTVE",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset, Audio

<span class="hljs-comment"># English</span>
stream_data = load_dataset(<span class="hljs-string">&quot;mozilla-foundation/common_voice_13_0&quot;</span>, <span class="hljs-string">&quot;en&quot;</span>, split=<span class="hljs-string">&quot;test&quot;</span>, streaming=<span class="hljs-literal">True</span>)
stream_data = stream_data.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=<span class="hljs-number">16000</span>))
en_sample = <span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(stream_data))[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>]

<span class="hljs-comment"># Arabic</span>
stream_data = load_dataset(<span class="hljs-string">&quot;mozilla-foundation/common_voice_13_0&quot;</span>, <span class="hljs-string">&quot;ar&quot;</span>, split=<span class="hljs-string">&quot;test&quot;</span>, streaming=<span class="hljs-literal">True</span>)
stream_data = stream_data.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=<span class="hljs-number">16000</span>))
ar_sample = <span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(stream_data))[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>]`,wrap:!1}}),Ie=new f({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFdhdjJWZWMyRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUyQyUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMmZhY2Vib29rJTJGbW1zLWxpZC0xMjYlMjIlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQpJTBBbW9kZWwlMjAlM0QlMjBXYXYyVmVjMkZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Wav2Vec2ForSequenceClassification, AutoFeatureExtractor
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;facebook/mms-lid-126&quot;</span>

processor = AutoFeatureExtractor.from_pretrained(model_id)
model = Wav2Vec2ForSequenceClassification.from_pretrained(model_id)`,wrap:!1}}),Be=new f({props:{code:"JTIzJTIwRW5nbGlzaCUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvcihlbl9zYW1wbGUlMkMlMjBzYW1wbGluZ19yYXRlJTNEMTZfMDAwJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEFsYW5nX2lkJTIwJTNEJTIwdG9yY2guYXJnbWF4KG91dHB1dHMlMkMlMjBkaW0lM0QtMSklNUIwJTVELml0ZW0oKSUwQWRldGVjdGVkX2xhbmclMjAlM0QlMjBtb2RlbC5jb25maWcuaWQybGFiZWwlNUJsYW5nX2lkJTVEJTBBJTIzJTIwJ2VuZyclMEElMEElMjMlMjBBcmFiaWMlMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoYXJfc2FtcGxlJTJDJTIwc2FtcGxpbmdfcmF0ZSUzRDE2XzAwMCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBbGFuZ19pZCUyMCUzRCUyMHRvcmNoLmFyZ21heChvdXRwdXRzJTJDJTIwZGltJTNELTEpJTVCMCU1RC5pdGVtKCklMEFkZXRlY3RlZF9sYW5nJTIwJTNEJTIwbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCbGFuZ19pZCU1RCUwQSUyMyUyMCdhcmEn",highlighted:`<span class="hljs-comment"># English</span>
inputs = processor(en_sample, sampling_rate=<span class="hljs-number">16_000</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-keyword">with</span> torch.no_grad():
    outputs = model(**inputs).logits

lang_id = torch.argmax(outputs, dim=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>].item()
detected_lang = model.config.id2label[lang_id]
<span class="hljs-comment"># &#x27;eng&#x27;</span>

<span class="hljs-comment"># Arabic</span>
inputs = processor(ar_sample, sampling_rate=<span class="hljs-number">16_000</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-keyword">with</span> torch.no_grad():
    outputs = model(**inputs).logits

lang_id = torch.argmax(outputs, dim=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>].item()
detected_lang = model.config.id2label[lang_id]
<span class="hljs-comment"># &#x27;ara&#x27;</span>`,wrap:!1}}),Ve=new f({props:{code:"cHJvY2Vzc29yLmlkMmxhYmVsLnZhbHVlcygp",highlighted:"processor.id2label.values()",wrap:!1}}),Ge=new j({props:{title:"Audio Pretrained Models",local:"audio-pretrained-models",headingTag:"h3"}}),v=new _l({props:{$$slots:{default:[Ol]},$$scope:{ctx:ze}}}),Ne=new Kl({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/mms.md"}}),{c(){y=o("meta"),g=a(),w=o("p"),b=a(),p(T.$$.fragment),h=a(),J=o("div"),J.innerHTML=sl,Ee=a(),p(Z.$$.fragment),He=a(),W=o("p"),W.innerHTML=al,Fe=a(),k=o("p"),k.textContent=nl,_e=a(),C=o("p"),C.innerHTML=ol,xe=a(),I=o("p"),I.innerHTML=il,Ye=a(),p(R.$$.fragment),Ae=a(),B=o("p"),B.innerHTML=rl,Se=a(),X=o("p"),X.textContent=pl,qe=a(),V=o("ul"),V.innerHTML=ml,Le=a(),p(G.$$.fragment),Pe=a(),$=o("p"),$.innerHTML=cl,Ke=a(),p(N.$$.fragment),De=a(),p(U.$$.fragment),Oe=a(),z=o("p"),z.textContent=dl,et=a(),p(Q.$$.fragment),tt=a(),p(E.$$.fragment),lt=a(),H=o("p"),H.innerHTML=Ml,st=a(),p(F.$$.fragment),at=a(),_=o("p"),_.textContent=ul,nt=a(),p(x.$$.fragment),ot=a(),Y=o("p"),Y.innerHTML=hl,it=a(),p(A.$$.fragment),rt=a(),S=o("p"),S.innerHTML=yl,pt=a(),p(q.$$.fragment),mt=a(),L=o("p"),L.textContent=fl,ct=a(),p(P.$$.fragment),dt=a(),K=o("p"),K.textContent=bl,Mt=a(),D=o("p"),D.innerHTML=Jl,ut=a(),p(O.$$.fragment),ht=a(),ee=o("p"),ee.innerHTML=wl,yt=a(),p(te.$$.fragment),ft=a(),le=o("p"),le.textContent=Tl,bt=a(),p(se.$$.fragment),Jt=a(),ae=o("p"),ae.textContent=gl,wt=a(),ne=o("ul"),ne.innerHTML=jl,Tt=a(),p(oe.$$.fragment),gt=a(),ie=o("p"),ie.innerHTML=Ul,jt=a(),p(re.$$.fragment),Ut=a(),pe=o("p"),pe.textContent=vl,vt=a(),p(me.$$.fragment),Zt=a(),ce=o("p"),ce.innerHTML=Zl,Wt=a(),de=o("p"),de.innerHTML=Wl,kt=a(),p(Me.$$.fragment),Ct=a(),ue=o("p"),ue.innerHTML=kl,It=a(),he=o("p"),he.innerHTML=Cl,Rt=a(),p(ye.$$.fragment),Bt=a(),fe=o("p"),fe.innerHTML=Il,Xt=a(),p(be.$$.fragment),Vt=a(),Je=o("p"),Je.innerHTML=Rl,Gt=a(),we=o("ul"),we.innerHTML=Bl,$t=a(),p(Te.$$.fragment),Nt=a(),p(ge.$$.fragment),zt=a(),je=o("p"),je.innerHTML=Xl,Qt=a(),p(Ue.$$.fragment),Et=a(),ve=o("p"),ve.textContent=Vl,Ht=a(),p(Ze.$$.fragment),Ft=a(),We=o("p"),We.innerHTML=Gl,_t=a(),p(ke.$$.fragment),xt=a(),Ce=o("p"),Ce.textContent=$l,Yt=a(),p(Ie.$$.fragment),At=a(),Re=o("p"),Re.innerHTML=Nl,St=a(),p(Be.$$.fragment),qt=a(),Xe=o("p"),Xe.textContent=zl,Lt=a(),p(Ve.$$.fragment),Pt=a(),p(Ge.$$.fragment),Kt=a(),$e=o("p"),$e.innerHTML=Ql,Dt=a(),p(v.$$.fragment),Ot=a(),p(Ne.$$.fragment),el=a(),Qe=o("p"),this.h()},l(e){const t=Ll("svelte-u9bgzb",document.head);y=i(t,"META",{name:!0,content:!0}),t.forEach(l),g=n(e),w=i(e,"P",{}),Fl(w).forEach(l),b=n(e),m(T.$$.fragment,e),h=n(e),J=i(e,"DIV",{class:!0,"data-svelte-h":!0}),r(J)!=="svelte-1px1zvi"&&(J.innerHTML=sl),Ee=n(e),m(Z.$$.fragment,e),He=n(e),W=i(e,"P",{"data-svelte-h":!0}),r(W)!=="svelte-1lu69tn"&&(W.innerHTML=al),Fe=n(e),k=i(e,"P",{"data-svelte-h":!0}),r(k)!=="svelte-vfdo9a"&&(k.textContent=nl),_e=n(e),C=i(e,"P",{"data-svelte-h":!0}),r(C)!=="svelte-omjokx"&&(C.innerHTML=ol),xe=n(e),I=i(e,"P",{"data-svelte-h":!0}),r(I)!=="svelte-139x4qi"&&(I.innerHTML=il),Ye=n(e),m(R.$$.fragment,e),Ae=n(e),B=i(e,"P",{"data-svelte-h":!0}),r(B)!=="svelte-1ganmax"&&(B.innerHTML=rl),Se=n(e),X=i(e,"P",{"data-svelte-h":!0}),r(X)!=="svelte-axv494"&&(X.textContent=pl),qe=n(e),V=i(e,"UL",{"data-svelte-h":!0}),r(V)!=="svelte-1r1v8mp"&&(V.innerHTML=ml),Le=n(e),m(G.$$.fragment,e),Pe=n(e),$=i(e,"P",{"data-svelte-h":!0}),r($)!=="svelte-yw6zrr"&&($.innerHTML=cl),Ke=n(e),m(N.$$.fragment,e),De=n(e),m(U.$$.fragment,e),Oe=n(e),z=i(e,"P",{"data-svelte-h":!0}),r(z)!=="svelte-vujju9"&&(z.textContent=dl),et=n(e),m(Q.$$.fragment,e),tt=n(e),m(E.$$.fragment,e),lt=n(e),H=i(e,"P",{"data-svelte-h":!0}),r(H)!=="svelte-883u4f"&&(H.innerHTML=Ml),st=n(e),m(F.$$.fragment,e),at=n(e),_=i(e,"P",{"data-svelte-h":!0}),r(_)!=="svelte-11gbe5o"&&(_.textContent=ul),nt=n(e),m(x.$$.fragment,e),ot=n(e),Y=i(e,"P",{"data-svelte-h":!0}),r(Y)!=="svelte-1jvcw2b"&&(Y.innerHTML=hl),it=n(e),m(A.$$.fragment,e),rt=n(e),S=i(e,"P",{"data-svelte-h":!0}),r(S)!=="svelte-rulh4z"&&(S.innerHTML=yl),pt=n(e),m(q.$$.fragment,e),mt=n(e),L=i(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-1okcee"&&(L.textContent=fl),ct=n(e),m(P.$$.fragment,e),dt=n(e),K=i(e,"P",{"data-svelte-h":!0}),r(K)!=="svelte-ftdh8u"&&(K.textContent=bl),Mt=n(e),D=i(e,"P",{"data-svelte-h":!0}),r(D)!=="svelte-19swadf"&&(D.innerHTML=Jl),ut=n(e),m(O.$$.fragment,e),ht=n(e),ee=i(e,"P",{"data-svelte-h":!0}),r(ee)!=="svelte-1c7flxd"&&(ee.innerHTML=wl),yt=n(e),m(te.$$.fragment,e),ft=n(e),le=i(e,"P",{"data-svelte-h":!0}),r(le)!=="svelte-1e3j2ci"&&(le.textContent=Tl),bt=n(e),m(se.$$.fragment,e),Jt=n(e),ae=i(e,"P",{"data-svelte-h":!0}),r(ae)!=="svelte-1fyd5jc"&&(ae.textContent=gl),wt=n(e),ne=i(e,"UL",{"data-svelte-h":!0}),r(ne)!=="svelte-llt2bz"&&(ne.innerHTML=jl),Tt=n(e),m(oe.$$.fragment,e),gt=n(e),ie=i(e,"P",{"data-svelte-h":!0}),r(ie)!=="svelte-1wosc4r"&&(ie.innerHTML=Ul),jt=n(e),m(re.$$.fragment,e),Ut=n(e),pe=i(e,"P",{"data-svelte-h":!0}),r(pe)!=="svelte-1es17w7"&&(pe.textContent=vl),vt=n(e),m(me.$$.fragment,e),Zt=n(e),ce=i(e,"P",{"data-svelte-h":!0}),r(ce)!=="svelte-wf3m3a"&&(ce.innerHTML=Zl),Wt=n(e),de=i(e,"P",{"data-svelte-h":!0}),r(de)!=="svelte-19haabz"&&(de.innerHTML=Wl),kt=n(e),m(Me.$$.fragment,e),Ct=n(e),ue=i(e,"P",{"data-svelte-h":!0}),r(ue)!=="svelte-1cubh3b"&&(ue.innerHTML=kl),It=n(e),he=i(e,"P",{"data-svelte-h":!0}),r(he)!=="svelte-14ycm1z"&&(he.innerHTML=Cl),Rt=n(e),m(ye.$$.fragment,e),Bt=n(e),fe=i(e,"P",{"data-svelte-h":!0}),r(fe)!=="svelte-yn6uj7"&&(fe.innerHTML=Il),Xt=n(e),m(be.$$.fragment,e),Vt=n(e),Je=i(e,"P",{"data-svelte-h":!0}),r(Je)!=="svelte-z7vo8h"&&(Je.innerHTML=Rl),Gt=n(e),we=i(e,"UL",{"data-svelte-h":!0}),r(we)!=="svelte-qq0pco"&&(we.innerHTML=Bl),$t=n(e),m(Te.$$.fragment,e),Nt=n(e),m(ge.$$.fragment,e),zt=n(e),je=i(e,"P",{"data-svelte-h":!0}),r(je)!=="svelte-1d4axu2"&&(je.innerHTML=Xl),Qt=n(e),m(Ue.$$.fragment,e),Et=n(e),ve=i(e,"P",{"data-svelte-h":!0}),r(ve)!=="svelte-1h8fqaf"&&(ve.textContent=Vl),Ht=n(e),m(Ze.$$.fragment,e),Ft=n(e),We=i(e,"P",{"data-svelte-h":!0}),r(We)!=="svelte-biwzt4"&&(We.innerHTML=Gl),_t=n(e),m(ke.$$.fragment,e),xt=n(e),Ce=i(e,"P",{"data-svelte-h":!0}),r(Ce)!=="svelte-11gbe5o"&&(Ce.textContent=$l),Yt=n(e),m(Ie.$$.fragment,e),At=n(e),Re=i(e,"P",{"data-svelte-h":!0}),r(Re)!=="svelte-1tsaj8l"&&(Re.innerHTML=Nl),St=n(e),m(Be.$$.fragment,e),qt=n(e),Xe=i(e,"P",{"data-svelte-h":!0}),r(Xe)!=="svelte-p73t64"&&(Xe.textContent=zl),Lt=n(e),m(Ve.$$.fragment,e),Pt=n(e),m(Ge.$$.fragment,e),Kt=n(e),$e=i(e,"P",{"data-svelte-h":!0}),r($e)!=="svelte-1asto85"&&($e.innerHTML=Ql),Dt=n(e),m(v.$$.fragment,e),Ot=n(e),m(Ne.$$.fragment,e),el=n(e),Qe=i(e,"P",{}),Fl(Qe).forEach(l),this.h()},h(){ll(y,"name","hf:doc:metadata"),ll(y,"content",ts),ll(J,"class","flex flex-wrap space-x-1")},m(e,t){Pl(document.head,y),s(e,g,t),s(e,w,t),s(e,b,t),c(T,e,t),s(e,h,t),s(e,J,t),s(e,Ee,t),c(Z,e,t),s(e,He,t),s(e,W,t),s(e,Fe,t),s(e,k,t),s(e,_e,t),s(e,C,t),s(e,xe,t),s(e,I,t),s(e,Ye,t),c(R,e,t),s(e,Ae,t),s(e,B,t),s(e,Se,t),s(e,X,t),s(e,qe,t),s(e,V,t),s(e,Le,t),c(G,e,t),s(e,Pe,t),s(e,$,t),s(e,Ke,t),c(N,e,t),s(e,De,t),c(U,e,t),s(e,Oe,t),s(e,z,t),s(e,et,t),c(Q,e,t),s(e,tt,t),c(E,e,t),s(e,lt,t),s(e,H,t),s(e,st,t),c(F,e,t),s(e,at,t),s(e,_,t),s(e,nt,t),c(x,e,t),s(e,ot,t),s(e,Y,t),s(e,it,t),c(A,e,t),s(e,rt,t),s(e,S,t),s(e,pt,t),c(q,e,t),s(e,mt,t),s(e,L,t),s(e,ct,t),c(P,e,t),s(e,dt,t),s(e,K,t),s(e,Mt,t),s(e,D,t),s(e,ut,t),c(O,e,t),s(e,ht,t),s(e,ee,t),s(e,yt,t),c(te,e,t),s(e,ft,t),s(e,le,t),s(e,bt,t),c(se,e,t),s(e,Jt,t),s(e,ae,t),s(e,wt,t),s(e,ne,t),s(e,Tt,t),c(oe,e,t),s(e,gt,t),s(e,ie,t),s(e,jt,t),c(re,e,t),s(e,Ut,t),s(e,pe,t),s(e,vt,t),c(me,e,t),s(e,Zt,t),s(e,ce,t),s(e,Wt,t),s(e,de,t),s(e,kt,t),c(Me,e,t),s(e,Ct,t),s(e,ue,t),s(e,It,t),s(e,he,t),s(e,Rt,t),c(ye,e,t),s(e,Bt,t),s(e,fe,t),s(e,Xt,t),c(be,e,t),s(e,Vt,t),s(e,Je,t),s(e,Gt,t),s(e,we,t),s(e,$t,t),c(Te,e,t),s(e,Nt,t),c(ge,e,t),s(e,zt,t),s(e,je,t),s(e,Qt,t),c(Ue,e,t),s(e,Et,t),s(e,ve,t),s(e,Ht,t),c(Ze,e,t),s(e,Ft,t),s(e,We,t),s(e,_t,t),c(ke,e,t),s(e,xt,t),s(e,Ce,t),s(e,Yt,t),c(Ie,e,t),s(e,At,t),s(e,Re,t),s(e,St,t),c(Be,e,t),s(e,qt,t),s(e,Xe,t),s(e,Lt,t),c(Ve,e,t),s(e,Pt,t),c(Ge,e,t),s(e,Kt,t),s(e,$e,t),s(e,Dt,t),c(v,e,t),s(e,Ot,t),c(Ne,e,t),s(e,el,t),s(e,Qe,t),tl=!0},p(e,[t]){const El={};t&2&&(El.$$scope={dirty:t,ctx:e}),U.$set(El);const Hl={};t&2&&(Hl.$$scope={dirty:t,ctx:e}),v.$set(Hl)},i(e){tl||(d(T.$$.fragment,e),d(Z.$$.fragment,e),d(R.$$.fragment,e),d(G.$$.fragment,e),d(N.$$.fragment,e),d(U.$$.fragment,e),d(Q.$$.fragment,e),d(E.$$.fragment,e),d(F.$$.fragment,e),d(x.$$.fragment,e),d(A.$$.fragment,e),d(q.$$.fragment,e),d(P.$$.fragment,e),d(O.$$.fragment,e),d(te.$$.fragment,e),d(se.$$.fragment,e),d(oe.$$.fragment,e),d(re.$$.fragment,e),d(me.$$.fragment,e),d(Me.$$.fragment,e),d(ye.$$.fragment,e),d(be.$$.fragment,e),d(Te.$$.fragment,e),d(ge.$$.fragment,e),d(Ue.$$.fragment,e),d(Ze.$$.fragment,e),d(ke.$$.fragment,e),d(Ie.$$.fragment,e),d(Be.$$.fragment,e),d(Ve.$$.fragment,e),d(Ge.$$.fragment,e),d(v.$$.fragment,e),d(Ne.$$.fragment,e),tl=!0)},o(e){M(T.$$.fragment,e),M(Z.$$.fragment,e),M(R.$$.fragment,e),M(G.$$.fragment,e),M(N.$$.fragment,e),M(U.$$.fragment,e),M(Q.$$.fragment,e),M(E.$$.fragment,e),M(F.$$.fragment,e),M(x.$$.fragment,e),M(A.$$.fragment,e),M(q.$$.fragment,e),M(P.$$.fragment,e),M(O.$$.fragment,e),M(te.$$.fragment,e),M(se.$$.fragment,e),M(oe.$$.fragment,e),M(re.$$.fragment,e),M(me.$$.fragment,e),M(Me.$$.fragment,e),M(ye.$$.fragment,e),M(be.$$.fragment,e),M(Te.$$.fragment,e),M(ge.$$.fragment,e),M(Ue.$$.fragment,e),M(Ze.$$.fragment,e),M(ke.$$.fragment,e),M(Ie.$$.fragment,e),M(Be.$$.fragment,e),M(Ve.$$.fragment,e),M(Ge.$$.fragment,e),M(v.$$.fragment,e),M(Ne.$$.fragment,e),tl=!1},d(e){e&&(l(g),l(w),l(b),l(h),l(J),l(Ee),l(He),l(W),l(Fe),l(k),l(_e),l(C),l(xe),l(I),l(Ye),l(Ae),l(B),l(Se),l(X),l(qe),l(V),l(Le),l(Pe),l($),l(Ke),l(De),l(Oe),l(z),l(et),l(tt),l(lt),l(H),l(st),l(at),l(_),l(nt),l(ot),l(Y),l(it),l(rt),l(S),l(pt),l(mt),l(L),l(ct),l(dt),l(K),l(Mt),l(D),l(ut),l(ht),l(ee),l(yt),l(ft),l(le),l(bt),l(Jt),l(ae),l(wt),l(ne),l(Tt),l(gt),l(ie),l(jt),l(Ut),l(pe),l(vt),l(Zt),l(ce),l(Wt),l(de),l(kt),l(Ct),l(ue),l(It),l(he),l(Rt),l(Bt),l(fe),l(Xt),l(Vt),l(Je),l(Gt),l(we),l($t),l(Nt),l(zt),l(je),l(Qt),l(Et),l(ve),l(Ht),l(Ft),l(We),l(_t),l(xt),l(Ce),l(Yt),l(At),l(Re),l(St),l(qt),l(Xe),l(Lt),l(Pt),l(Kt),l($e),l(Dt),l(Ot),l(el),l(Qe)),l(y),u(T,e),u(Z,e),u(R,e),u(G,e),u(N,e),u(U,e),u(Q,e),u(E,e),u(F,e),u(x,e),u(A,e),u(q,e),u(P,e),u(O,e),u(te,e),u(se,e),u(oe,e),u(re,e),u(me,e),u(Me,e),u(ye,e),u(be,e),u(Te,e),u(ge,e),u(Ue,e),u(Ze,e),u(ke,e),u(Ie,e),u(Be,e),u(Ve,e),u(Ge,e),u(v,e),u(Ne,e)}}}const ts='{"title":"MMS","local":"mms","sections":[{"title":"Overview","local":"overview","sections":[{"title":"Automatic Speech Recognition (ASR)","local":"automatic-speech-recognition-asr","sections":[{"title":"Loading","local":"loading","sections":[],"depth":4},{"title":"Inference","local":"inference","sections":[],"depth":4}],"depth":3},{"title":"Speech Synthesis (TTS)","local":"speech-synthesis-tts","sections":[{"title":"Inference","local":"inference","sections":[],"depth":4}],"depth":3},{"title":"Language Identification (LID)","local":"language-identification-lid","sections":[{"title":"Inference","local":"inference","sections":[],"depth":4}],"depth":3},{"title":"Audio Pretrained Models","local":"audio-pretrained-models","sections":[],"depth":3}],"depth":2}],"depth":1}';function ls(ze){return Al(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class rs extends Sl{constructor(y){super(),ql(this,y,ls,es,Yl,{})}}export{rs as component};
