import{s as $l,f as Cl,o as kl,n as ft}from"../chunks/scheduler.f7e1785c.js";import{S as xl,i as Jl,g as i,s as l,r as m,A as Ul,h as o,f as s,c as a,j as gl,u as h,x as r,k as N,y as _l,a as n,v as f,d as y,t as w,w as M,m as Il,n as jl}from"../chunks/index.9f8f0838.js";import{T as ht}from"../chunks/Tip.4575d9cf.js";import{C as T}from"../chunks/CodeBlock.b3510e34.js";import{H as nn,E as Zl}from"../chunks/EditOnGithub.5a9bb8c5.js";function Hl(k){let p,v=`Even though the fine-tuned models start out using the same set of weights from the shared pre-trained model, the
final versions are all quite different in the end. You can’t take a fine-tuned ASR model and swap out the pre-nets and
post-net to get a working TTS model, for example. SpeechT5 is flexible, but not that flexible ;)`;return{c(){p=i("p"),p.textContent=v},l(d){p=o(d,"P",{"data-svelte-h":!0}),r(p)!=="svelte-186t2pn"&&(p.textContent=v)},m(d,c){n(d,p,c)},p:ft,d(d){d&&s(p)}}}function Gl(k){let p,v=`Speaker embeddings is a method of representing a speaker’s identity in a compact way, as a vector of
fixed size, regardless of the length of the utterance. These embeddings capture essential information about a speaker’s
voice, accent, intonation, and other unique characteristics that distinguish one speaker from another. Such embeddings can
be used for speaker verification, speaker diarization, speaker identification, and more.
The most common techniques for generating speaker embeddings include:`,d,c,$="<li>I-Vectors (identity vectors): I-Vectors are based on a Gaussian mixture model (GMM). They represent speakers as low-dimensional fixed-length vectors derived from the statistics of a speaker-specific GMM, and are obtained in unsupervised manner.</li> <li>X-Vectors: X-Vectors are derived using deep neural networks (DNNs) and capture frame-level speaker information by incorporating temporal context.</li>",C,b,J=`<a href="https://www.danielpovey.com/files/2018_icassp_xvectors.pdf" rel="nofollow">X-Vectors</a> are a state-of-the-art method that shows superior performance
on evaluation datasets compared to I-Vectors. The deep neural network is used to obtain X-Vectors: it trains to discriminate
between speakers, and maps variable-length utterances to fixed-dimensional embeddings. You can also load an X-Vector speaker embedding that has been computed ahead of time, which will encapsulate the speaking characteristics of a particular speaker.`;return{c(){p=i("p"),p.textContent=v,d=l(),c=i("ul"),c.innerHTML=$,C=l(),b=i("p"),b.innerHTML=J},l(u){p=o(u,"P",{"data-svelte-h":!0}),r(p)!=="svelte-mdrkn0"&&(p.textContent=v),d=a(u),c=o(u,"UL",{"data-svelte-h":!0}),r(c)!=="svelte-1hi7sgd"&&(c.innerHTML=$),C=a(u),b=o(u,"P",{"data-svelte-h":!0}),r(b)!=="svelte-1jxhw7z"&&(b.innerHTML=J)},m(u,g){n(u,p,g),n(u,d,g),n(u,c,g),n(u,C,g),n(u,b,g)},p:ft,d(u){u&&(s(p),s(d),s(c),s(C),s(b))}}}function Bl(k){let p,v=`<a href="https://arxiv.org/pdf/2010.05646v2.pdf" rel="nofollow">HiFi-GAN</a> is a state-of-the-art generative adversarial network (GAN) designed
for high-fidelity speech synthesis. It is capable of generating high-quality and realistic audio waveforms from spectrogram inputs.`,d,c,$=`On a high level, HiFi-GAN consists of one generator and two discriminators. The generator is a fully convolutional
neural network that takes a mel-spectrogram as input and learns to produce raw audio waveforms. The discriminators’
role is to distinguish between real and generated audio. The two discriminators focus on different aspects of the audio.`,C,b,J=`HiFi-GAN is trained on a large dataset of high-quality audio recordings. It uses a so-called <em>adversarial training</em>,
where the generator and discriminator networks compete against each other. Initially, the generator produces low-quality
audio, and the discriminator can easily differentiate it from real audio. As training progresses, the generator improves
its output, aiming to fool the discriminator. The discriminator, in turn, becomes more accurate in distinguishing real
and generated audio. This adversarial feedback loop helps both networks improve over time. Ultimately, HiFi-GAN learns to
generate high-fidelity audio that closely resembles the characteristics of the training data.`;return{c(){p=i("p"),p.innerHTML=v,d=l(),c=i("p"),c.textContent=$,C=l(),b=i("p"),b.innerHTML=J},l(u){p=o(u,"P",{"data-svelte-h":!0}),r(p)!=="svelte-1netc3w"&&(p.innerHTML=v),d=a(u),c=o(u,"P",{"data-svelte-h":!0}),r(c)!=="svelte-1c62h2f"&&(c.textContent=$),C=a(u),b=o(u,"P",{"data-svelte-h":!0}),r(b)!=="svelte-guovqp"&&(b.innerHTML=J)},m(u,g){n(u,p,g),n(u,d,g),n(u,c,g),n(u,C,g),n(u,b,g)},p:ft,d(u){u&&(s(p),s(d),s(c),s(C),s(b))}}}function Vl(k){let p,v='Bark, like other 🤗 Transformers models, can be optimized in just a few lines of code regarding speed and memory impact. To find out how, click on <a href="https://colab.research.google.com/github/ylacombe/notebooks/blob/main/Benchmark_Bark_HuggingFace.ipynb" rel="nofollow">this colab demonstration notebook</a>.';return{c(){p=i("p"),p.innerHTML=v},l(d){p=o(d,"P",{"data-svelte-h":!0}),r(p)!=="svelte-19jzp61"&&(p.innerHTML=v)},m(d,c){n(d,p,c)},p:ft,d(d){d&&s(p)}}}function Sl(k){let p,v,d;return v=new T({props:{code:"cGlwJTIwaW5zdGFsbCUyMGdpdCUyQmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmh1Z2dpbmdmYWNlJTJGdHJhbnNmb3JtZXJzLmdpdA==",highlighted:"pip install git+https://github.com/huggingface/transformers.git",wrap:!1}}),{c(){p=Il(`MMS model has been added to 🤗 Transformers very recently, so you will have to install the library from source:

	`),m(v.$$.fragment)},l(c){p=jl(c,`MMS model has been added to 🤗 Transformers very recently, so you will have to install the library from source:

	`),h(v.$$.fragment,c)},m(c,$){n(c,p,$),f(v,c,$),d=!0},p:ft,i(c){d||(y(v.$$.fragment,c),d=!0)},o(c){w(v.$$.fragment,c),d=!1},d(c){c&&s(p),M(v,c)}}}function Wl(k){let p,v,d,c,$,C,b,J=`Compared to ASR (automatic speech recognition) and audio classification tasks, there are significantly fewer pre-trained
model checkpoints available. On the 🤗 Hub, you’ll find close to 300 suitable checkpoints. Among
these pre-trained models we’ll focus on two architectures that are readily available for you in the 🤗 Transformers library -
SpeechT5 and Massive Multilingual Speech (MMS). In this section, we’ll explore how to use these pre-trained models in the
Transformers library for TTS.`,u,g,yt,L,ln=`<a href="https://arxiv.org/abs/2110.07205" rel="nofollow">SpeechT5</a> is a model published by Junyi Ao et al. from Microsoft that is capable of
handling a range of speech tasks. While in this unit, we focus on the text-to-speech aspect,
this model can be tailored to speech-to-text tasks (automatic speech recognition or speaker identification),
as well as speech-to-speech (e.g. speech enhancement or converting between different voices). This is due to how the model
is designed and pre-trained.`,wt,Q,an=`At the heart of SpeechT5 is a regular Transformer encoder-decoder model. Just like any other Transformer, the encoder-decoder
network models a sequence-to-sequence transformation using hidden representations. This Transformer backbone is the same
for all tasks SpeechT5 supports.`,Mt,F,on=`This Transformer is complemented with six modal-specific (speech/text) <em>pre-nets</em> and <em>post-nets</em>. The input speech or text
(depending on the task) is preprocessed through a corresponding pre-net to obtain the hidden representations that Transformer
can use. The Transformer’s output is then passed to a post-net that will use it to generate the output in the target modality.`,vt,E,rn="This is what the architecture looks like (image from the original paper):",bt,U,pn='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/speecht5/architecture.jpg" alt="SpeechT5 architecture from the original paper"/>',Tt,q,cn=`SpeechT5 is first pre-trained using large-scale unlabeled speech and text data, to acquire a unified representation
of different modalities. During the pre-training phase all pre-nets and post-nets are used simultaneously.`,gt,Y,dn=`After pre-training, the entire encoder-decoder backbone is fine-tuned for each individual task. At this step, only the
pre-nets and post-nets relevant to the specific task are employed. For example, to use SpeechT5 for text-to-speech, you’d
need the text encoder pre-net for the text inputs and the speech decoder pre- and post-nets for the speech outputs.`,$t,P,un=`This approach allows to obtain several models fine-tuned for different speech tasks that all benefit from the initial
pre-training on unlabeled data.`,Ct,_,kt,A,mn="Let’s see what are the pre- and post-nets that SpeechT5 uses for the TTS task specifically:",xt,D,hn="<li>Text encoder pre-net: A text embedding layer that maps text tokens to the hidden representations that the encoder expects. This is similar to what happens in an NLP model such as BERT.</li> <li>Speech decoder pre-net: This takes a log mel spectrogram as input and uses a sequence of linear layers to compress the spectrogram into hidden representations.</li> <li>Speech decoder post-net: This predicts a residual to add to the output spectrogram and is used to refine the results.</li>",Jt,K,fn="When combined, this is what SpeechT5 architecture for text-to-speech looks like:",Ut,I,yn='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/speecht5/tts.jpg" alt="SpeechT5 architecture for TTS"/>',_t,O,wn=`As you can see, the output is a log mel spectrogram and not a final waveform. If you recall, we briefly touched on
this topic in <a href="../chapter3/introduction#spectrogram-output">Unit 3</a>. It is common for models that generate audio to produce
a log mel spectrogram, which needs to be converted to a waveform with an additional neural network known as a vocoder.`,It,ee,Mn="Let’s see how you could do that.",jt,te,vn=`First, let’s load the fine-tuned TTS SpeechT5 model from the 🤗 Hub, along with the processor object used for tokenization
and feature extraction:`,Zt,se,Ht,ne,bn="Next, tokenize the input text.",Gt,le,Bt,ae,Tn=`The SpeechT5 TTS model is not limited to creating speech for a single speaker. Instead, it uses so-called speaker embeddings
that capture a particular speaker’s voice characteristics.`,Vt,j,St,ie,gn=`Let’s load such a speaker embedding from a dataset on the Hub. The embeddings
were obtained from the <a href="http://www.festvox.org/cmu_arctic/" rel="nofollow">CMU ARCTIC dataset</a> using
<a href="https://huggingface.co/mechanicalsea/speecht5-vc/blob/main/manifest/utils/prep_cmu_arctic_spkemb.py" rel="nofollow">this script</a>, but
any X-Vector embedding should work.`,Wt,oe,zt,re,$n="The speaker embedding is a tensor of shape (1, 512). This particular speaker embedding describes a female voice.",Rt,pe,Cn="At this point we already have enough inputs to generate a log mel spectrogram as an output, you can do it like this:",Xt,ce,Nt,de,kn=`This outputs a tensor of shape (140, 80) containing a log mel spectrogram. The first dimension is the sequence length, and
it may vary between runs as the speech decoder pre-net always applies dropout to the input sequence. This adds a bit of
random variability to the generated speech.`,Lt,ue,xn=`However, if we are looking to generate speech waveform, we need to specify a vocoder to use for the spectrogram to waveform conversion.
In theory, you can use any vocoder that works on 80-bin mel spectrograms. Conveniently, 🤗 Transformers offers a vocoder
based on HiFi-GAN. Its weights were kindly provided by the original authors of SpeechT5.`,Qt,Z,Ft,me,Jn="Loading the vocoder is as easy as any other 🤗 Transformers model.",Et,he,qt,fe,Un="Now all you need to do is pass it as an argument when generating speech, and the outputs will be automatically converted to the speech waveform.",Yt,ye,Pt,we,_n="Let’s listen to the result. The sample rate used by SpeechT5 is always 16 kHz.",At,Me,Dt,ve,In="Neat!",Kt,be,jn=`Feel free to play with the SpeechT5 text-to-speech demo, explore other voices, experiment with inputs. Note that this
pre-trained checkpoint only supports English language:`,Ot,x,Zn="",Hn,es,Te,ts,ge,Gn='Bark is a transformer-based text-to-speech model proposed by Suno AI in <a href="https://github.com/suno-ai/bark" rel="nofollow">suno-ai/bark</a>.',ss,$e,Bn='Unlike SpeechT5, Bark generates raw speech waveforms directly, eliminating the need for a separate vocoder during inference – it’s already integrated. This efficiency is achieved through the utilization of <a href="https://huggingface.co/docs/transformers/main/en/model_doc/encodec" rel="nofollow"><code>Encodec</code></a>, which serves as both a codec and a compression tool.',ns,Ce,Vn="With <code>Encodec</code>, you can compress audio into a lightweight format to reduce memory usage and subsequently decompress it to restore the original audio. This compression process is facilitated by 8 codebooks, each consisting of integer vectors. Think of these codebooks as representations or embeddings of the audio in integer form. It’s important to note that each successive codebook improves the quality of the audio reconstruction from the previous codebooks. As codebooks are integer vectors, they can be learned by transformer models, which are very efficient in this task. This is what Bark was specifically trained to do.",ls,ke,Sn="To be more specific, Bark is made of 4 main models:",as,xe,Wn="<li><code>BarkSemanticModel</code> (also referred to as the ‘text’ model): a causal auto-regressive transformer model that takes as input tokenized text, and predicts semantic text tokens that capture the meaning of the text.</li> <li><code>BarkCoarseModel</code> (also referred to as the ‘coarse acoustics’ model): a causal autoregressive transformer, that takes as input the results of the <code>BarkSemanticModel</code> model. It aims at predicting the first two audio codebooks necessary for EnCodec.</li> <li><code>BarkFineModel</code> (the ‘fine acoustics’ model), this time a non-causal autoencoder transformer, which iteratively predicts the last codebooks based on the sum of the previous codebooks embeddings.</li> <li>having predicted all the codebook channels from the <code>EncodecModel</code>, Bark uses it to decode the output audio array.</li>",is,Je,zn="It should be noted that each of the first three modules can support conditional speaker embeddings to condition the output sound according to specific predefined voice.",os,Ue,Rn="Bark is an highly-controllable text-to-speech model, meaning you can use with various settings, as we are going to see.",rs,_e,Xn="Before everything, load the model and its processor.",ps,Ie,Nn="The processor role here is two-sides:",cs,je,Ln="<li>It is used to tokenize the input text, i.e. to cut it into small pieces that the model can understand.</li> <li>It stores speaker embeddings, i.e voice presets that can condition the generation.</li>",ds,Ze,us,He,Qn='Bark is very versatile and can generate audio conditioned by <a href="https://suno-ai.notion.site/8b8e8749ed514b0cbf3f699013548683?v=bc67cff786b04b50b3ceb756fd05f68c" rel="nofollow">a speaker embeddings library</a> which can be loaded via the processor.',ms,Ge,hs,H,Fn=`<source src="https://huggingface.co/datasets/ylacombe/hf-course-audio-files/resolve/main/first_sample.wav" type="audio/wav"/> 
Your browser does not support the audio element.`,fs,Be,En='It can also generate ready-to-use multilingual speeches, such as French and Chinese. You can find a list of supported languages <a href="https://huggingface.co/suno/bark" rel="nofollow">here</a>. Unlike MMS, discussed below, it is not necessary to specify the language used, but simply adapt the input text to the corresponding language.',ys,Ve,ws,G,qn=`<source src="https://huggingface.co/datasets/ylacombe/hf-course-audio-files/resolve/main/second_sample.wav" type="audio/wav"/> 
Your browser does not support the audio element.`,Ms,Se,Yn="The model can also generate <strong>non-verbal communications</strong> such as laughing, sighing and crying. You just have to modify the input text with corresponding cues such as <code>[clears throat]</code>, <code>[laughter]</code>, or <code>...</code>.",vs,We,bs,B,Pn=`<source src="https://huggingface.co/datasets/ylacombe/hf-course-audio-files/resolve/main/third_sample.wav" type="audio/wav"/> 
Your browser does not support the audio element.`,Ts,ze,An="Bark can even generate music. You can help by adding ♪ musical notes ♪ around your words.",gs,Re,$s,V,Dn=`<source src="https://huggingface.co/datasets/ylacombe/hf-course-audio-files/resolve/main/fourth_sample.wav" type="audio/wav"/> 
Your browser does not support the audio element.`,Cs,Xe,Kn=`In addition to all these features, Bark supports batch processing, which means you can process several text entries at the same time, at the expense of more intensive computation.
On some hardware, such as GPUs, batching enables faster overall generation, which means it can be faster to generate samples all at once than to generate them one by one.`,ks,Ne,On="Let’s try generating a few examples:",xs,Le,Js,Qe,el="Let’s listen to the outputs one by one.",Us,Fe,tl="First one:",_s,Ee,Is,S,sl=`<source src="https://huggingface.co/datasets/ylacombe/hf-course-audio-files/resolve/main/batch_1.wav" type="audio/wav"/> 
Your browser does not support the audio element.`,js,qe,nl="Second one:",Zs,Ye,Hs,W,ll=`<source src="https://huggingface.co/datasets/ylacombe/hf-course-audio-files/resolve/main/batch_2.wav" type="audio/wav"/> 
Your browser does not support the audio element.`,Gs,Pe,al="Third one:",Bs,Ae,Vs,z,il=`<source src="https://huggingface.co/datasets/ylacombe/hf-course-audio-files/resolve/main/batch_3.wav" type="audio/wav"/> 
Your browser does not support the audio element.`,Ss,R,Ws,De,zs,Ke,ol=`What if you are looking for a pre-trained model in a language other than English? Massive Multilingual Speech (MMS) is
another model that covers an array of speech tasks, however, it supports a large number of languages. For instance, it can
synthesize speech in over 1,100 languages.`,Rs,Oe,rl=`MMS for text-to-speech is based on <a href="https://arxiv.org/pdf/2106.06103.pdf" rel="nofollow">VITS Kim et al., 2021</a>, which is one of the
state-of-the-art TTS approaches.`,Xs,et,pl=`VITS is a speech generation network that converts text into raw speech waveforms. It works like a conditional variational
auto-encoder, estimating audio features from the input text. First, acoustic features, represented as spectrograms, are
generated. The waveform is then decoded using transposed convolutional layers adapted from HiFi-GAN.
During inference, the text encodings are upsampled and transformed into waveforms using the flow module and HiFi-GAN decoder.
Like Bark, there’s no need for a vocoder, as waveforms are generated directly.`,Ns,X,Ls,tt,cl=`Let’s give MMS a go, and see how we can synthesize speech in a language other than English, e.g. German.
First, we’ll load the model checkpoint and the tokenizer for the correct language:`,Qs,st,Fs,nt,dl=`You may notice that to load the MMS model you need to use <code>VitsModel</code> and <code>VitsTokenizer</code>. This is because MMS for text-to-speech
is based on the VITS model as mentioned earlier.`,Es,lt,ul="Let’s pick an example text in German, like these first two lines from a children’s song:",qs,at,Ys,it,ml="To generate a waveform output, preprocess the text with the tokenizer, and pass it to the model:",Ps,ot,As,rt,hl="Let’s listen to it:",Ds,pt,Ks,ct,fl='Wunderbar! If you’d like to try MMS with another language, find other suitable <code>vits</code> checkpoints <a href="https://huggingface.co/models?filter=vits" rel="nofollow">on 🤗 Hub</a>.',Os,dt,yl="Now let’s see how you can fine-tune a TTS model yourself!",en,ut,tn,mt,sn;return $=new nn({props:{title:"Pre-trained models for text-to-speech",local:"pre-trained-models-for-text-to-speech",headingTag:"h1"}}),g=new nn({props:{title:"SpeechT5",local:"speecht5",headingTag:"h2"}}),_=new ht({props:{$$slots:{default:[Hl]},$$scope:{ctx:k}}}),se=new T({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNwZWVjaFQ1UHJvY2Vzc29yJTJDJTIwU3BlZWNoVDVGb3JUZXh0VG9TcGVlY2glMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBTcGVlY2hUNVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGc3BlZWNodDVfdHRzJTIyKSUwQW1vZGVsJTIwJTNEJTIwU3BlZWNoVDVGb3JUZXh0VG9TcGVlY2guZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnNwZWVjaHQ1X3R0cyUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SpeechT5Processor, SpeechT5ForTextToSpeech

processor = SpeechT5Processor.from_pretrained(<span class="hljs-string">&quot;microsoft/speecht5_tts&quot;</span>)
model = SpeechT5ForTextToSpeech.from_pretrained(<span class="hljs-string">&quot;microsoft/speecht5_tts&quot;</span>)`,wrap:!1}}),le=new T({props:{code:"aW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0QlMjJEb24ndCUyMGNvdW50JTIwdGhlJTIwZGF5cyUyQyUyMG1ha2UlMjB0aGUlMjBkYXlzJTIwY291bnQuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMik=",highlighted:'inputs = processor(text=<span class="hljs-string">&quot;Don&#x27;t count the days, make the days count.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)',wrap:!1}}),j=new ht({props:{$$slots:{default:[Gl]},$$scope:{ctx:k}}}),oe=new T({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZW1iZWRkaW5nc19kYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMk1hdHRoaWpzJTJGY211LWFyY3RpYy14dmVjdG9ycyUyMiUyQyUyMHNwbGl0JTNEJTIydmFsaWRhdGlvbiUyMiklMEElMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXNwZWFrZXJfZW1iZWRkaW5ncyUyMCUzRCUyMHRvcmNoLnRlbnNvcihlbWJlZGRpbmdzX2RhdGFzZXQlNUI3MzA2JTVEJTVCJTIyeHZlY3RvciUyMiU1RCkudW5zcXVlZXplKDAp",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

embeddings_dataset = load_dataset(<span class="hljs-string">&quot;Matthijs/cmu-arctic-xvectors&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)

<span class="hljs-keyword">import</span> torch

speaker_embeddings = torch.tensor(embeddings_dataset[<span class="hljs-number">7306</span>][<span class="hljs-string">&quot;xvector&quot;</span>]).unsqueeze(<span class="hljs-number">0</span>)`,wrap:!1}}),ce=new T({props:{code:"c3BlY3Ryb2dyYW0lMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZV9zcGVlY2goaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTJDJTIwc3BlYWtlcl9lbWJlZGRpbmdzKQ==",highlighted:'spectrogram = model.generate_speech(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], speaker_embeddings)',wrap:!1}}),Z=new ht({props:{$$slots:{default:[Bl]},$$scope:{ctx:k}}}),he=new T({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNwZWVjaFQ1SGlmaUdhbiUwQSUwQXZvY29kZXIlMjAlM0QlMjBTcGVlY2hUNUhpZmlHYW4uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnNwZWVjaHQ1X2hpZmlnYW4lMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SpeechT5HifiGan

vocoder = SpeechT5HifiGan.from_pretrained(<span class="hljs-string">&quot;microsoft/speecht5_hifigan&quot;</span>)`,wrap:!1}}),ye=new T({props:{code:"c3BlZWNoJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGVfc3BlZWNoKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMHNwZWFrZXJfZW1iZWRkaW5ncyUyQyUyMHZvY29kZXIlM0R2b2NvZGVyKQ==",highlighted:'speech = model.generate_speech(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], speaker_embeddings, vocoder=vocoder)',wrap:!1}}),Me=new T({props:{code:"ZnJvbSUyMElQeXRob24uZGlzcGxheSUyMGltcG9ydCUyMEF1ZGlvJTBBJTBBQXVkaW8oc3BlZWNoJTJDJTIwcmF0ZSUzRDE2MDAwKQ==",highlighted:`<span class="hljs-keyword">from</span> IPython.display <span class="hljs-keyword">import</span> Audio

Audio(speech, rate=<span class="hljs-number">16000</span>)`,wrap:!1}}),Te=new nn({props:{title:"Bark",local:"bark",headingTag:"h2"}}),Ze=new T({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJhcmtNb2RlbCUyQyUyMEJhcmtQcm9jZXNzb3IlMEElMEFtb2RlbCUyMCUzRCUyMEJhcmtNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyc3VubyUyRmJhcmstc21hbGwlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQmFya1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyc3VubyUyRmJhcmstc21hbGwlMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BarkModel, BarkProcessor

model = BarkModel.from_pretrained(<span class="hljs-string">&quot;suno/bark-small&quot;</span>)
processor = BarkProcessor.from_pretrained(<span class="hljs-string">&quot;suno/bark-small&quot;</span>)`,wrap:!1}}),Ge=new T({props:{code:"JTIzJTIwYWRkJTIwYSUyMHNwZWFrZXIlMjBlbWJlZGRpbmclMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoJTIyVGhpcyUyMGlzJTIwYSUyMHRlc3QhJTIyJTJDJTIwdm9pY2VfcHJlc2V0JTNEJTIydjIlMkZlbl9zcGVha2VyXzMlMjIpJTBBJTBBc3BlZWNoX291dHB1dCUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzKS5jcHUoKS5udW1weSgp",highlighted:`<span class="hljs-comment"># add a speaker embedding</span>
inputs = processor(<span class="hljs-string">&quot;This is a test!&quot;</span>, voice_preset=<span class="hljs-string">&quot;v2/en_speaker_3&quot;</span>)

speech_output = model.generate(**inputs).cpu().numpy()`,wrap:!1}}),Ve=new T({props:{code:"JTIzJTIwdHJ5JTIwaXQlMjBpbiUyMEZyZW5jaCUyQyUyMGxldCdzJTIwYWxzbyUyMGFkZCUyMGElMjBGcmVuY2glMjBzcGVha2VyJTIwZW1iZWRkaW5nJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKCUyMkMnZXN0JTIwdW4lMjB0ZXN0ISUyMiUyQyUyMHZvaWNlX3ByZXNldCUzRCUyMnYyJTJGZnJfc3BlYWtlcl8xJTIyKSUwQSUwQXNwZWVjaF9vdXRwdXQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0cykuY3B1KCkubnVtcHkoKQ==",highlighted:`<span class="hljs-comment"># try it in French, let&#x27;s also add a French speaker embedding</span>
inputs = processor(<span class="hljs-string">&quot;C&#x27;est un test!&quot;</span>, voice_preset=<span class="hljs-string">&quot;v2/fr_speaker_1&quot;</span>)

speech_output = model.generate(**inputs).cpu().numpy()`,wrap:!1}}),We=new T({props:{code:"aW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKCUwQSUyMCUyMCUyMCUyMCUyMiU1QmNsZWFycyUyMHRocm9hdCU1RCUyMFRoaXMlMjBpcyUyMGElMjB0ZXN0JTIwLi4uJTIwYW5kJTIwSSUyMGp1c3QlMjB0b29rJTIwYSUyMGxvbmclMjBwYXVzZS4lMjIlMkMlMEElMjAlMjAlMjAlMjB2b2ljZV9wcmVzZXQlM0QlMjJ2MiUyRmZyX3NwZWFrZXJfMSUyMiUyQyUwQSklMEElMEFzcGVlY2hfb3V0cHV0JTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMpLmNwdSgpLm51bXB5KCk=",highlighted:`inputs = processor(
    <span class="hljs-string">&quot;[clears throat] This is a test ... and I just took a long pause.&quot;</span>,
    voice_preset=<span class="hljs-string">&quot;v2/fr_speaker_1&quot;</span>,
)

speech_output = model.generate(**inputs).cpu().numpy()`,wrap:!1}}),Re=new T({props:{code:"aW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKCUwQSUyMCUyMCUyMCUyMCUyMiVFMiU5OSVBQSUyMEluJTIwdGhlJTIwbWlnaHR5JTIwanVuZ2xlJTJDJTIwSSdtJTIwdHJ5aW5nJTIwdG8lMjBnZW5lcmF0ZSUyMGJhcmtzLiUyMiUyQyUwQSklMEElMEFzcGVlY2hfb3V0cHV0JTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMpLmNwdSgpLm51bXB5KCk=",highlighted:`inputs = processor(
    <span class="hljs-string">&quot;♪ In the mighty jungle, I&#x27;m trying to generate barks.&quot;</span>,
)

speech_output = model.generate(**inputs).cpu().numpy()`,wrap:!1}}),Le=new T({props:{code:"aW5wdXRfbGlzdCUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMiU1QmNsZWFycyUyMHRocm9hdCU1RCUyMEhlbGxvJTIwdWglMjAuLi4lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMCU1QmxhdWdodGVyJTVEJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyTGV0J3MlMjB0cnklMjBnZW5lcmF0aW5nJTIwc3BlZWNoJTJDJTIwd2l0aCUyMEJhcmslMkMlMjBhJTIwdGV4dC10by1zcGVlY2glMjBtb2RlbCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMiVFMiU5OSVBQSUyMEluJTIwdGhlJTIwanVuZ2xlJTJDJTIwdGhlJTIwbWlnaHR5JTIwanVuZ2xlJTJDJTIwdGhlJTIwbGlvbiUyMGJhcmtzJTIwdG9uaWdodCUyMCVFMiU5OSVBQSUyMiUyQyUwQSU1RCUwQSUwQSUyMyUyMGFsc28lMjBhZGQlMjBhJTIwc3BlYWtlciUyMGVtYmVkZGluZyUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbnB1dF9saXN0JTJDJTIwdm9pY2VfcHJlc2V0JTNEJTIydjIlMkZlbl9zcGVha2VyXzMlMjIpJTBBJTBBc3BlZWNoX291dHB1dCUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzKS5jcHUoKS5udW1weSgp",highlighted:`input_list = [
    <span class="hljs-string">&quot;[clears throat] Hello uh ..., my dog is cute [laughter]&quot;</span>,
    <span class="hljs-string">&quot;Let&#x27;s try generating speech, with Bark, a text-to-speech model&quot;</span>,
    <span class="hljs-string">&quot;♪ In the jungle, the mighty jungle, the lion barks tonight ♪&quot;</span>,
]

<span class="hljs-comment"># also add a speaker embedding</span>
inputs = processor(input_list, voice_preset=<span class="hljs-string">&quot;v2/en_speaker_3&quot;</span>)

speech_output = model.generate(**inputs).cpu().numpy()`,wrap:!1}}),Ee=new T({props:{code:"ZnJvbSUyMElQeXRob24uZGlzcGxheSUyMGltcG9ydCUyMEF1ZGlvJTBBJTBBc2FtcGxpbmdfcmF0ZSUyMCUzRCUyMG1vZGVsLmdlbmVyYXRpb25fY29uZmlnLnNhbXBsZV9yYXRlJTBBQXVkaW8oc3BlZWNoX291dHB1dCU1QjAlNUQlMkMlMjByYXRlJTNEc2FtcGxpbmdfcmF0ZSk=",highlighted:`<span class="hljs-keyword">from</span> IPython.display <span class="hljs-keyword">import</span> Audio

sampling_rate = model.generation_config.sample_rate
Audio(speech_output[<span class="hljs-number">0</span>], rate=sampling_rate)`,wrap:!1}}),Ye=new T({props:{code:"QXVkaW8oc3BlZWNoX291dHB1dCU1QjElNUQlMkMlMjByYXRlJTNEc2FtcGxpbmdfcmF0ZSk=",highlighted:'Audio(speech_output[<span class="hljs-number">1</span>], rate=sampling_rate)',wrap:!1}}),Ae=new T({props:{code:"QXVkaW8oc3BlZWNoX291dHB1dCU1QjIlNUQlMkMlMjByYXRlJTNEc2FtcGxpbmdfcmF0ZSk=",highlighted:'Audio(speech_output[<span class="hljs-number">2</span>], rate=sampling_rate)',wrap:!1}}),R=new ht({props:{$$slots:{default:[Vl]},$$scope:{ctx:k}}}),De=new nn({props:{title:"Massive Multilingual Speech (MMS)",local:"massive-multilingual-speech-mms",headingTag:"h2"}}),X=new ht({props:{warning:!0,$$slots:{default:[Sl]},$$scope:{ctx:k}}}),st=new T({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpdHNNb2RlbCUyQyUyMFZpdHNUb2tlbml6ZXIlMEElMEFtb2RlbCUyMCUzRCUyMFZpdHNNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZtbXMtdHRzLWRldSUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBWaXRzVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRm1tcy10dHMtZGV1JTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> VitsModel, VitsTokenizer

model = VitsModel.from_pretrained(<span class="hljs-string">&quot;facebook/mms-tts-deu&quot;</span>)
tokenizer = VitsTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/mms-tts-deu&quot;</span>)`,wrap:!1}}),at=new T({props:{code:"dGV4dF9leGFtcGxlJTIwJTNEJTIwKCUwQSUyMCUyMCUyMCUyMCUyMkljaCUyMGJpbiUyMFNjaG5hcHBpJTIwZGFzJTIwa2xlaW5lJTIwS3Jva29kaWwlMkMlMjBrb21tJTIwYXVzJTIwJUMzJTg0Z3lwdGVuJTIwZGFzJTIwbGllZ3QlMjBkaXJla3QlMjBhbSUyME5pbC4lMjIlMEEp",highlighted:`text_example = (
    <span class="hljs-string">&quot;Ich bin Schnappi das kleine Krokodil, komm aus Ägypten das liegt direkt am Nil.&quot;</span>
)`,wrap:!1}}),ot=new T({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIodGV4dF9leGFtcGxlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFpbnB1dF9pZHMlMjAlM0QlMjBpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcyklMEElMEFzcGVlY2glMjAlM0QlMjBvdXRwdXRzJTVCJTIyd2F2ZWZvcm0lMjIlNUQ=",highlighted:`<span class="hljs-keyword">import</span> torch

inputs = tokenizer(text_example, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
input_ids = inputs[<span class="hljs-string">&quot;input_ids&quot;</span>]


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

speech = outputs[<span class="hljs-string">&quot;waveform&quot;</span>]`,wrap:!1}}),pt=new T({props:{code:"ZnJvbSUyMElQeXRob24uZGlzcGxheSUyMGltcG9ydCUyMEF1ZGlvJTBBJTBBQXVkaW8oc3BlZWNoJTJDJTIwcmF0ZSUzRDE2MDAwKQ==",highlighted:`<span class="hljs-keyword">from</span> IPython.display <span class="hljs-keyword">import</span> Audio

Audio(speech, rate=<span class="hljs-number">16000</span>)`,wrap:!1}}),ut=new Zl({props:{source:"https://github.com/huggingface/audio-transformers-course/blob/main/chapters/en/chapter6/pre-trained_models.mdx"}}),{c(){p=i("meta"),v=l(),d=i("p"),c=l(),m($.$$.fragment),C=l(),b=i("p"),b.textContent=J,u=l(),m(g.$$.fragment),yt=l(),L=i("p"),L.innerHTML=ln,wt=l(),Q=i("p"),Q.textContent=an,Mt=l(),F=i("p"),F.innerHTML=on,vt=l(),E=i("p"),E.textContent=rn,bt=l(),U=i("div"),U.innerHTML=pn,Tt=l(),q=i("p"),q.textContent=cn,gt=l(),Y=i("p"),Y.textContent=dn,$t=l(),P=i("p"),P.textContent=un,Ct=l(),m(_.$$.fragment),kt=l(),A=i("p"),A.textContent=mn,xt=l(),D=i("ul"),D.innerHTML=hn,Jt=l(),K=i("p"),K.textContent=fn,Ut=l(),I=i("div"),I.innerHTML=yn,_t=l(),O=i("p"),O.innerHTML=wn,It=l(),ee=i("p"),ee.textContent=Mn,jt=l(),te=i("p"),te.textContent=vn,Zt=l(),m(se.$$.fragment),Ht=l(),ne=i("p"),ne.textContent=bn,Gt=l(),m(le.$$.fragment),Bt=l(),ae=i("p"),ae.textContent=Tn,Vt=l(),m(j.$$.fragment),St=l(),ie=i("p"),ie.innerHTML=gn,Wt=l(),m(oe.$$.fragment),zt=l(),re=i("p"),re.textContent=$n,Rt=l(),pe=i("p"),pe.textContent=Cn,Xt=l(),m(ce.$$.fragment),Nt=l(),de=i("p"),de.textContent=kn,Lt=l(),ue=i("p"),ue.textContent=xn,Qt=l(),m(Z.$$.fragment),Ft=l(),me=i("p"),me.textContent=Jn,Et=l(),m(he.$$.fragment),qt=l(),fe=i("p"),fe.textContent=Un,Yt=l(),m(ye.$$.fragment),Pt=l(),we=i("p"),we.textContent=_n,At=l(),m(Me.$$.fragment),Dt=l(),ve=i("p"),ve.textContent=In,Kt=l(),be=i("p"),be.textContent=jn,Ot=l(),x=i("iframe"),x.innerHTML=Zn,es=l(),m(Te.$$.fragment),ts=l(),ge=i("p"),ge.innerHTML=Gn,ss=l(),$e=i("p"),$e.innerHTML=Bn,ns=l(),Ce=i("p"),Ce.innerHTML=Vn,ls=l(),ke=i("p"),ke.textContent=Sn,as=l(),xe=i("ul"),xe.innerHTML=Wn,is=l(),Je=i("p"),Je.textContent=zn,os=l(),Ue=i("p"),Ue.textContent=Rn,rs=l(),_e=i("p"),_e.textContent=Xn,ps=l(),Ie=i("p"),Ie.textContent=Nn,cs=l(),je=i("ol"),je.innerHTML=Ln,ds=l(),m(Ze.$$.fragment),us=l(),He=i("p"),He.innerHTML=Qn,ms=l(),m(Ge.$$.fragment),hs=l(),H=i("audio"),H.innerHTML=Fn,fs=l(),Be=i("p"),Be.innerHTML=En,ys=l(),m(Ve.$$.fragment),ws=l(),G=i("audio"),G.innerHTML=qn,Ms=l(),Se=i("p"),Se.innerHTML=Yn,vs=l(),m(We.$$.fragment),bs=l(),B=i("audio"),B.innerHTML=Pn,Ts=l(),ze=i("p"),ze.textContent=An,gs=l(),m(Re.$$.fragment),$s=l(),V=i("audio"),V.innerHTML=Dn,Cs=l(),Xe=i("p"),Xe.textContent=Kn,ks=l(),Ne=i("p"),Ne.textContent=On,xs=l(),m(Le.$$.fragment),Js=l(),Qe=i("p"),Qe.textContent=el,Us=l(),Fe=i("p"),Fe.textContent=tl,_s=l(),m(Ee.$$.fragment),Is=l(),S=i("audio"),S.innerHTML=sl,js=l(),qe=i("p"),qe.textContent=nl,Zs=l(),m(Ye.$$.fragment),Hs=l(),W=i("audio"),W.innerHTML=ll,Gs=l(),Pe=i("p"),Pe.textContent=al,Bs=l(),m(Ae.$$.fragment),Vs=l(),z=i("audio"),z.innerHTML=il,Ss=l(),m(R.$$.fragment),Ws=l(),m(De.$$.fragment),zs=l(),Ke=i("p"),Ke.textContent=ol,Rs=l(),Oe=i("p"),Oe.innerHTML=rl,Xs=l(),et=i("p"),et.textContent=pl,Ns=l(),m(X.$$.fragment),Ls=l(),tt=i("p"),tt.textContent=cl,Qs=l(),m(st.$$.fragment),Fs=l(),nt=i("p"),nt.innerHTML=dl,Es=l(),lt=i("p"),lt.textContent=ul,qs=l(),m(at.$$.fragment),Ys=l(),it=i("p"),it.textContent=ml,Ps=l(),m(ot.$$.fragment),As=l(),rt=i("p"),rt.textContent=hl,Ds=l(),m(pt.$$.fragment),Ks=l(),ct=i("p"),ct.innerHTML=fl,Os=l(),dt=i("p"),dt.textContent=yl,en=l(),m(ut.$$.fragment),tn=l(),mt=i("p"),this.h()},l(e){const t=Ul("svelte-u9bgzb",document.head);p=o(t,"META",{name:!0,content:!0}),t.forEach(s),v=a(e),d=o(e,"P",{}),gl(d).forEach(s),c=a(e),h($.$$.fragment,e),C=a(e),b=o(e,"P",{"data-svelte-h":!0}),r(b)!=="svelte-1daxplp"&&(b.textContent=J),u=a(e),h(g.$$.fragment,e),yt=a(e),L=o(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-yag015"&&(L.innerHTML=ln),wt=a(e),Q=o(e,"P",{"data-svelte-h":!0}),r(Q)!=="svelte-c9tc8d"&&(Q.textContent=an),Mt=a(e),F=o(e,"P",{"data-svelte-h":!0}),r(F)!=="svelte-13972z8"&&(F.innerHTML=on),vt=a(e),E=o(e,"P",{"data-svelte-h":!0}),r(E)!=="svelte-wr8kuz"&&(E.textContent=rn),bt=a(e),U=o(e,"DIV",{class:!0,"data-svelte-h":!0}),r(U)!=="svelte-1j5439p"&&(U.innerHTML=pn),Tt=a(e),q=o(e,"P",{"data-svelte-h":!0}),r(q)!=="svelte-1kbr6z9"&&(q.textContent=cn),gt=a(e),Y=o(e,"P",{"data-svelte-h":!0}),r(Y)!=="svelte-fdwn9q"&&(Y.textContent=dn),$t=a(e),P=o(e,"P",{"data-svelte-h":!0}),r(P)!=="svelte-165k5vk"&&(P.textContent=un),Ct=a(e),h(_.$$.fragment,e),kt=a(e),A=o(e,"P",{"data-svelte-h":!0}),r(A)!=="svelte-n345q3"&&(A.textContent=mn),xt=a(e),D=o(e,"UL",{"data-svelte-h":!0}),r(D)!=="svelte-jd8qh8"&&(D.innerHTML=hn),Jt=a(e),K=o(e,"P",{"data-svelte-h":!0}),r(K)!=="svelte-81isp3"&&(K.textContent=fn),Ut=a(e),I=o(e,"DIV",{class:!0,"data-svelte-h":!0}),r(I)!=="svelte-sze2fn"&&(I.innerHTML=yn),_t=a(e),O=o(e,"P",{"data-svelte-h":!0}),r(O)!=="svelte-1x4m0vh"&&(O.innerHTML=wn),It=a(e),ee=o(e,"P",{"data-svelte-h":!0}),r(ee)!=="svelte-mpoa3m"&&(ee.textContent=Mn),jt=a(e),te=o(e,"P",{"data-svelte-h":!0}),r(te)!=="svelte-1rb9653"&&(te.textContent=vn),Zt=a(e),h(se.$$.fragment,e),Ht=a(e),ne=o(e,"P",{"data-svelte-h":!0}),r(ne)!=="svelte-swfq00"&&(ne.textContent=bn),Gt=a(e),h(le.$$.fragment,e),Bt=a(e),ae=o(e,"P",{"data-svelte-h":!0}),r(ae)!=="svelte-74c7oy"&&(ae.textContent=Tn),Vt=a(e),h(j.$$.fragment,e),St=a(e),ie=o(e,"P",{"data-svelte-h":!0}),r(ie)!=="svelte-jz5sfv"&&(ie.innerHTML=gn),Wt=a(e),h(oe.$$.fragment,e),zt=a(e),re=o(e,"P",{"data-svelte-h":!0}),r(re)!=="svelte-f6dlnz"&&(re.textContent=$n),Rt=a(e),pe=o(e,"P",{"data-svelte-h":!0}),r(pe)!=="svelte-1awgz3s"&&(pe.textContent=Cn),Xt=a(e),h(ce.$$.fragment,e),Nt=a(e),de=o(e,"P",{"data-svelte-h":!0}),r(de)!=="svelte-jpr5s4"&&(de.textContent=kn),Lt=a(e),ue=o(e,"P",{"data-svelte-h":!0}),r(ue)!=="svelte-ftado2"&&(ue.textContent=xn),Qt=a(e),h(Z.$$.fragment,e),Ft=a(e),me=o(e,"P",{"data-svelte-h":!0}),r(me)!=="svelte-44n2yf"&&(me.textContent=Jn),Et=a(e),h(he.$$.fragment,e),qt=a(e),fe=o(e,"P",{"data-svelte-h":!0}),r(fe)!=="svelte-1kphbin"&&(fe.textContent=Un),Yt=a(e),h(ye.$$.fragment,e),Pt=a(e),we=o(e,"P",{"data-svelte-h":!0}),r(we)!=="svelte-19xs0zc"&&(we.textContent=_n),At=a(e),h(Me.$$.fragment,e),Dt=a(e),ve=o(e,"P",{"data-svelte-h":!0}),r(ve)!=="svelte-1r9io3v"&&(ve.textContent=In),Kt=a(e),be=o(e,"P",{"data-svelte-h":!0}),r(be)!=="svelte-1h3brza"&&(be.textContent=jn),Ot=a(e),x=o(e,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0,"data-svelte-h":!0}),r(x)!=="svelte-k7mwvh"&&(x.innerHTML=Zn),es=a(e),h(Te.$$.fragment,e),ts=a(e),ge=o(e,"P",{"data-svelte-h":!0}),r(ge)!=="svelte-luezb9"&&(ge.innerHTML=Gn),ss=a(e),$e=o(e,"P",{"data-svelte-h":!0}),r($e)!=="svelte-td1jzt"&&($e.innerHTML=Bn),ns=a(e),Ce=o(e,"P",{"data-svelte-h":!0}),r(Ce)!=="svelte-ayk4yt"&&(Ce.innerHTML=Vn),ls=a(e),ke=o(e,"P",{"data-svelte-h":!0}),r(ke)!=="svelte-1bbb3eg"&&(ke.textContent=Sn),as=a(e),xe=o(e,"UL",{"data-svelte-h":!0}),r(xe)!=="svelte-1ho1l4x"&&(xe.innerHTML=Wn),is=a(e),Je=o(e,"P",{"data-svelte-h":!0}),r(Je)!=="svelte-birews"&&(Je.textContent=zn),os=a(e),Ue=o(e,"P",{"data-svelte-h":!0}),r(Ue)!=="svelte-mr83a0"&&(Ue.textContent=Rn),rs=a(e),_e=o(e,"P",{"data-svelte-h":!0}),r(_e)!=="svelte-hrck43"&&(_e.textContent=Xn),ps=a(e),Ie=o(e,"P",{"data-svelte-h":!0}),r(Ie)!=="svelte-hgto8u"&&(Ie.textContent=Nn),cs=a(e),je=o(e,"OL",{"data-svelte-h":!0}),r(je)!=="svelte-1d9lyek"&&(je.innerHTML=Ln),ds=a(e),h(Ze.$$.fragment,e),us=a(e),He=o(e,"P",{"data-svelte-h":!0}),r(He)!=="svelte-1ep51cg"&&(He.innerHTML=Qn),ms=a(e),h(Ge.$$.fragment,e),hs=a(e),H=o(e,"AUDIO",{"data-svelte-h":!0}),r(H)!=="svelte-1dcfkqn"&&(H.innerHTML=Fn),fs=a(e),Be=o(e,"P",{"data-svelte-h":!0}),r(Be)!=="svelte-1ezu4yu"&&(Be.innerHTML=En),ys=a(e),h(Ve.$$.fragment,e),ws=a(e),G=o(e,"AUDIO",{"data-svelte-h":!0}),r(G)!=="svelte-1mf2amh"&&(G.innerHTML=qn),Ms=a(e),Se=o(e,"P",{"data-svelte-h":!0}),r(Se)!=="svelte-1sw314w"&&(Se.innerHTML=Yn),vs=a(e),h(We.$$.fragment,e),bs=a(e),B=o(e,"AUDIO",{"data-svelte-h":!0}),r(B)!=="svelte-18uewve"&&(B.innerHTML=Pn),Ts=a(e),ze=o(e,"P",{"data-svelte-h":!0}),r(ze)!=="svelte-17xea6o"&&(ze.textContent=An),gs=a(e),h(Re.$$.fragment,e),$s=a(e),V=o(e,"AUDIO",{"data-svelte-h":!0}),r(V)!=="svelte-xst92l"&&(V.innerHTML=Dn),Cs=a(e),Xe=o(e,"P",{"data-svelte-h":!0}),r(Xe)!=="svelte-q2c458"&&(Xe.textContent=Kn),ks=a(e),Ne=o(e,"P",{"data-svelte-h":!0}),r(Ne)!=="svelte-1gu4p56"&&(Ne.textContent=On),xs=a(e),h(Le.$$.fragment,e),Js=a(e),Qe=o(e,"P",{"data-svelte-h":!0}),r(Qe)!=="svelte-dtoew1"&&(Qe.textContent=el),Us=a(e),Fe=o(e,"P",{"data-svelte-h":!0}),r(Fe)!=="svelte-8xc0ic"&&(Fe.textContent=tl),_s=a(e),h(Ee.$$.fragment,e),Is=a(e),S=o(e,"AUDIO",{"data-svelte-h":!0}),r(S)!=="svelte-v3niu0"&&(S.innerHTML=sl),js=a(e),qe=o(e,"P",{"data-svelte-h":!0}),r(qe)!=="svelte-kbivly"&&(qe.textContent=nl),Zs=a(e),h(Ye.$$.fragment,e),Hs=a(e),W=o(e,"AUDIO",{"data-svelte-h":!0}),r(W)!=="svelte-1x1ywin"&&(W.innerHTML=ll),Gs=a(e),Pe=o(e,"P",{"data-svelte-h":!0}),r(Pe)!=="svelte-a5t5uz"&&(Pe.textContent=al),Bs=a(e),h(Ae.$$.fragment,e),Vs=a(e),z=o(e,"AUDIO",{"data-svelte-h":!0}),r(z)!=="svelte-69zylm"&&(z.innerHTML=il),Ss=a(e),h(R.$$.fragment,e),Ws=a(e),h(De.$$.fragment,e),zs=a(e),Ke=o(e,"P",{"data-svelte-h":!0}),r(Ke)!=="svelte-1sn7aa3"&&(Ke.textContent=ol),Rs=a(e),Oe=o(e,"P",{"data-svelte-h":!0}),r(Oe)!=="svelte-11mw9ju"&&(Oe.innerHTML=rl),Xs=a(e),et=o(e,"P",{"data-svelte-h":!0}),r(et)!=="svelte-5uuyg0"&&(et.textContent=pl),Ns=a(e),h(X.$$.fragment,e),Ls=a(e),tt=o(e,"P",{"data-svelte-h":!0}),r(tt)!=="svelte-7htp4h"&&(tt.textContent=cl),Qs=a(e),h(st.$$.fragment,e),Fs=a(e),nt=o(e,"P",{"data-svelte-h":!0}),r(nt)!=="svelte-1s5fwe"&&(nt.innerHTML=dl),Es=a(e),lt=o(e,"P",{"data-svelte-h":!0}),r(lt)!=="svelte-cy5yeb"&&(lt.textContent=ul),qs=a(e),h(at.$$.fragment,e),Ys=a(e),it=o(e,"P",{"data-svelte-h":!0}),r(it)!=="svelte-1hq1hkh"&&(it.textContent=ml),Ps=a(e),h(ot.$$.fragment,e),As=a(e),rt=o(e,"P",{"data-svelte-h":!0}),r(rt)!=="svelte-cmwyek"&&(rt.textContent=hl),Ds=a(e),h(pt.$$.fragment,e),Ks=a(e),ct=o(e,"P",{"data-svelte-h":!0}),r(ct)!=="svelte-159l1h7"&&(ct.innerHTML=fl),Os=a(e),dt=o(e,"P",{"data-svelte-h":!0}),r(dt)!=="svelte-ul4o7z"&&(dt.textContent=yl),en=a(e),h(ut.$$.fragment,e),tn=a(e),mt=o(e,"P",{}),gl(mt).forEach(s),this.h()},h(){N(p,"name","hf:doc:metadata"),N(p,"content",zl),N(U,"class","flex justify-center"),N(I,"class","flex justify-center"),Cl(x.src,Hn="https://matthijs-speecht5-tts-demo.hf.space")||N(x,"src",Hn),N(x,"frameborder","0"),N(x,"width","850"),N(x,"height","450"),H.controls="",G.controls="",B.controls="",V.controls="",S.controls="",W.controls="",z.controls=""},m(e,t){_l(document.head,p),n(e,v,t),n(e,d,t),n(e,c,t),f($,e,t),n(e,C,t),n(e,b,t),n(e,u,t),f(g,e,t),n(e,yt,t),n(e,L,t),n(e,wt,t),n(e,Q,t),n(e,Mt,t),n(e,F,t),n(e,vt,t),n(e,E,t),n(e,bt,t),n(e,U,t),n(e,Tt,t),n(e,q,t),n(e,gt,t),n(e,Y,t),n(e,$t,t),n(e,P,t),n(e,Ct,t),f(_,e,t),n(e,kt,t),n(e,A,t),n(e,xt,t),n(e,D,t),n(e,Jt,t),n(e,K,t),n(e,Ut,t),n(e,I,t),n(e,_t,t),n(e,O,t),n(e,It,t),n(e,ee,t),n(e,jt,t),n(e,te,t),n(e,Zt,t),f(se,e,t),n(e,Ht,t),n(e,ne,t),n(e,Gt,t),f(le,e,t),n(e,Bt,t),n(e,ae,t),n(e,Vt,t),f(j,e,t),n(e,St,t),n(e,ie,t),n(e,Wt,t),f(oe,e,t),n(e,zt,t),n(e,re,t),n(e,Rt,t),n(e,pe,t),n(e,Xt,t),f(ce,e,t),n(e,Nt,t),n(e,de,t),n(e,Lt,t),n(e,ue,t),n(e,Qt,t),f(Z,e,t),n(e,Ft,t),n(e,me,t),n(e,Et,t),f(he,e,t),n(e,qt,t),n(e,fe,t),n(e,Yt,t),f(ye,e,t),n(e,Pt,t),n(e,we,t),n(e,At,t),f(Me,e,t),n(e,Dt,t),n(e,ve,t),n(e,Kt,t),n(e,be,t),n(e,Ot,t),n(e,x,t),n(e,es,t),f(Te,e,t),n(e,ts,t),n(e,ge,t),n(e,ss,t),n(e,$e,t),n(e,ns,t),n(e,Ce,t),n(e,ls,t),n(e,ke,t),n(e,as,t),n(e,xe,t),n(e,is,t),n(e,Je,t),n(e,os,t),n(e,Ue,t),n(e,rs,t),n(e,_e,t),n(e,ps,t),n(e,Ie,t),n(e,cs,t),n(e,je,t),n(e,ds,t),f(Ze,e,t),n(e,us,t),n(e,He,t),n(e,ms,t),f(Ge,e,t),n(e,hs,t),n(e,H,t),n(e,fs,t),n(e,Be,t),n(e,ys,t),f(Ve,e,t),n(e,ws,t),n(e,G,t),n(e,Ms,t),n(e,Se,t),n(e,vs,t),f(We,e,t),n(e,bs,t),n(e,B,t),n(e,Ts,t),n(e,ze,t),n(e,gs,t),f(Re,e,t),n(e,$s,t),n(e,V,t),n(e,Cs,t),n(e,Xe,t),n(e,ks,t),n(e,Ne,t),n(e,xs,t),f(Le,e,t),n(e,Js,t),n(e,Qe,t),n(e,Us,t),n(e,Fe,t),n(e,_s,t),f(Ee,e,t),n(e,Is,t),n(e,S,t),n(e,js,t),n(e,qe,t),n(e,Zs,t),f(Ye,e,t),n(e,Hs,t),n(e,W,t),n(e,Gs,t),n(e,Pe,t),n(e,Bs,t),f(Ae,e,t),n(e,Vs,t),n(e,z,t),n(e,Ss,t),f(R,e,t),n(e,Ws,t),f(De,e,t),n(e,zs,t),n(e,Ke,t),n(e,Rs,t),n(e,Oe,t),n(e,Xs,t),n(e,et,t),n(e,Ns,t),f(X,e,t),n(e,Ls,t),n(e,tt,t),n(e,Qs,t),f(st,e,t),n(e,Fs,t),n(e,nt,t),n(e,Es,t),n(e,lt,t),n(e,qs,t),f(at,e,t),n(e,Ys,t),n(e,it,t),n(e,Ps,t),f(ot,e,t),n(e,As,t),n(e,rt,t),n(e,Ds,t),f(pt,e,t),n(e,Ks,t),n(e,ct,t),n(e,Os,t),n(e,dt,t),n(e,en,t),f(ut,e,t),n(e,tn,t),n(e,mt,t),sn=!0},p(e,[t]){const wl={};t&2&&(wl.$$scope={dirty:t,ctx:e}),_.$set(wl);const Ml={};t&2&&(Ml.$$scope={dirty:t,ctx:e}),j.$set(Ml);const vl={};t&2&&(vl.$$scope={dirty:t,ctx:e}),Z.$set(vl);const bl={};t&2&&(bl.$$scope={dirty:t,ctx:e}),R.$set(bl);const Tl={};t&2&&(Tl.$$scope={dirty:t,ctx:e}),X.$set(Tl)},i(e){sn||(y($.$$.fragment,e),y(g.$$.fragment,e),y(_.$$.fragment,e),y(se.$$.fragment,e),y(le.$$.fragment,e),y(j.$$.fragment,e),y(oe.$$.fragment,e),y(ce.$$.fragment,e),y(Z.$$.fragment,e),y(he.$$.fragment,e),y(ye.$$.fragment,e),y(Me.$$.fragment,e),y(Te.$$.fragment,e),y(Ze.$$.fragment,e),y(Ge.$$.fragment,e),y(Ve.$$.fragment,e),y(We.$$.fragment,e),y(Re.$$.fragment,e),y(Le.$$.fragment,e),y(Ee.$$.fragment,e),y(Ye.$$.fragment,e),y(Ae.$$.fragment,e),y(R.$$.fragment,e),y(De.$$.fragment,e),y(X.$$.fragment,e),y(st.$$.fragment,e),y(at.$$.fragment,e),y(ot.$$.fragment,e),y(pt.$$.fragment,e),y(ut.$$.fragment,e),sn=!0)},o(e){w($.$$.fragment,e),w(g.$$.fragment,e),w(_.$$.fragment,e),w(se.$$.fragment,e),w(le.$$.fragment,e),w(j.$$.fragment,e),w(oe.$$.fragment,e),w(ce.$$.fragment,e),w(Z.$$.fragment,e),w(he.$$.fragment,e),w(ye.$$.fragment,e),w(Me.$$.fragment,e),w(Te.$$.fragment,e),w(Ze.$$.fragment,e),w(Ge.$$.fragment,e),w(Ve.$$.fragment,e),w(We.$$.fragment,e),w(Re.$$.fragment,e),w(Le.$$.fragment,e),w(Ee.$$.fragment,e),w(Ye.$$.fragment,e),w(Ae.$$.fragment,e),w(R.$$.fragment,e),w(De.$$.fragment,e),w(X.$$.fragment,e),w(st.$$.fragment,e),w(at.$$.fragment,e),w(ot.$$.fragment,e),w(pt.$$.fragment,e),w(ut.$$.fragment,e),sn=!1},d(e){e&&(s(v),s(d),s(c),s(C),s(b),s(u),s(yt),s(L),s(wt),s(Q),s(Mt),s(F),s(vt),s(E),s(bt),s(U),s(Tt),s(q),s(gt),s(Y),s($t),s(P),s(Ct),s(kt),s(A),s(xt),s(D),s(Jt),s(K),s(Ut),s(I),s(_t),s(O),s(It),s(ee),s(jt),s(te),s(Zt),s(Ht),s(ne),s(Gt),s(Bt),s(ae),s(Vt),s(St),s(ie),s(Wt),s(zt),s(re),s(Rt),s(pe),s(Xt),s(Nt),s(de),s(Lt),s(ue),s(Qt),s(Ft),s(me),s(Et),s(qt),s(fe),s(Yt),s(Pt),s(we),s(At),s(Dt),s(ve),s(Kt),s(be),s(Ot),s(x),s(es),s(ts),s(ge),s(ss),s($e),s(ns),s(Ce),s(ls),s(ke),s(as),s(xe),s(is),s(Je),s(os),s(Ue),s(rs),s(_e),s(ps),s(Ie),s(cs),s(je),s(ds),s(us),s(He),s(ms),s(hs),s(H),s(fs),s(Be),s(ys),s(ws),s(G),s(Ms),s(Se),s(vs),s(bs),s(B),s(Ts),s(ze),s(gs),s($s),s(V),s(Cs),s(Xe),s(ks),s(Ne),s(xs),s(Js),s(Qe),s(Us),s(Fe),s(_s),s(Is),s(S),s(js),s(qe),s(Zs),s(Hs),s(W),s(Gs),s(Pe),s(Bs),s(Vs),s(z),s(Ss),s(Ws),s(zs),s(Ke),s(Rs),s(Oe),s(Xs),s(et),s(Ns),s(Ls),s(tt),s(Qs),s(Fs),s(nt),s(Es),s(lt),s(qs),s(Ys),s(it),s(Ps),s(As),s(rt),s(Ds),s(Ks),s(ct),s(Os),s(dt),s(en),s(tn),s(mt)),s(p),M($,e),M(g,e),M(_,e),M(se,e),M(le,e),M(j,e),M(oe,e),M(ce,e),M(Z,e),M(he,e),M(ye,e),M(Me,e),M(Te,e),M(Ze,e),M(Ge,e),M(Ve,e),M(We,e),M(Re,e),M(Le,e),M(Ee,e),M(Ye,e),M(Ae,e),M(R,e),M(De,e),M(X,e),M(st,e),M(at,e),M(ot,e),M(pt,e),M(ut,e)}}}const zl='{"title":"Pre-trained models for text-to-speech","local":"pre-trained-models-for-text-to-speech","sections":[{"title":"SpeechT5","local":"speecht5","sections":[],"depth":2},{"title":"Bark","local":"bark","sections":[],"depth":2},{"title":"Massive Multilingual Speech (MMS)","local":"massive-multilingual-speech-mms","sections":[],"depth":2}],"depth":1}';function Rl(k){return kl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class El extends xl{constructor(p){super(),Jl(this,p,Rl,Wl,$l,{})}}export{El as component};
