import{S as Zo,i as No,s as jo,e as r,k as h,w as T,t as l,M as Ao,c as i,d as t,m as d,a as n,x as k,h as p,b as c,N as Ga,G as o,g as a,y as M,q as $,o as _,B as E,v as Fo,L as Wo}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ts}from"../../chunks/Tip-hf-doc-builder.js";import{I as Ua}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as N}from"../../chunks/CodeBlock-hf-doc-builder.js";function Ro(W){let u,v;return{c(){u=r("p"),v=l(`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\u2019t 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 ;)`)},l(w){u=i(w,"P",{});var f=n(u);v=p(f,`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\u2019t 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 ;)`),f.forEach(t)},m(w,f){a(w,u,f),o(u,v)},d(w){w&&t(u)}}}function zo(W){let u,v,w,f,g,S,j,x,I,V,b,G,Z,y;return{c(){u=r("p"),v=l(`Speaker embeddings is a method of representing a speaker\u2019s 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\u2019s
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:`),w=h(),f=r("ul"),g=r("li"),S=l("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."),j=h(),x=r("li"),I=l("X-Vectors: X-Vectors are derived using deep neural networks (DNNs) and capture frame-level speaker information by incorporating temporal context."),V=h(),b=r("p"),G=r("a"),Z=l("X-Vectors"),y=l(` 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.`),this.h()},l(m){u=i(m,"P",{});var J=n(u);v=p(J,`Speaker embeddings is a method of representing a speaker\u2019s 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\u2019s
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:`),J.forEach(t),w=d(m),f=i(m,"UL",{});var U=n(f);g=i(U,"LI",{});var A=n(g);S=p(A,"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."),A.forEach(t),j=d(U),x=i(U,"LI",{});var F=n(x);I=p(F,"X-Vectors: X-Vectors are derived using deep neural networks (DNNs) and capture frame-level speaker information by incorporating temporal context."),F.forEach(t),U.forEach(t),V=d(m),b=i(m,"P",{});var ee=n(b);G=i(ee,"A",{href:!0,rel:!0});var te=n(G);Z=p(te,"X-Vectors"),te.forEach(t),y=p(ee,` 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.`),ee.forEach(t),this.h()},h(){c(G,"href","https://www.danielpovey.com/files/2018_icassp_xvectors.pdf"),c(G,"rel","nofollow")},m(m,J){a(m,u,J),o(u,v),a(m,w,J),a(m,f,J),o(f,g),o(g,S),o(f,j),o(f,x),o(x,I),a(m,V,J),a(m,b,J),o(b,G),o(G,Z),o(b,y)},d(m){m&&t(u),m&&t(w),m&&t(f),m&&t(V),m&&t(b)}}}function Ho(W){let u,v,w,f,g,S,j,x,I,V,b,G,Z;return{c(){u=r("p"),v=r("a"),w=l("HiFi-GAN"),f=l(` 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.`),g=h(),S=r("p"),j=l(`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\u2019
role is to distinguish between real and generated audio. The two discriminators focus on different aspects of the audio.`),x=h(),I=r("p"),V=l("HiFi-GAN is trained on a large dataset of high-quality audio recordings. It uses a so-called "),b=r("em"),G=l("adversarial training"),Z=l(`,
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.`),this.h()},l(y){u=i(y,"P",{});var m=n(u);v=i(m,"A",{href:!0,rel:!0});var J=n(v);w=p(J,"HiFi-GAN"),J.forEach(t),f=p(m,` 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.`),m.forEach(t),g=d(y),S=i(y,"P",{});var U=n(S);j=p(U,`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\u2019
role is to distinguish between real and generated audio. The two discriminators focus on different aspects of the audio.`),U.forEach(t),x=d(y),I=i(y,"P",{});var A=n(I);V=p(A,"HiFi-GAN is trained on a large dataset of high-quality audio recordings. It uses a so-called "),b=i(A,"EM",{});var F=n(b);G=p(F,"adversarial training"),F.forEach(t),Z=p(A,`,
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.`),A.forEach(t),this.h()},h(){c(v,"href","https://arxiv.org/pdf/2010.05646v2.pdf"),c(v,"rel","nofollow")},m(y,m){a(y,u,m),o(u,v),o(v,w),o(u,f),a(y,g,m),a(y,S,m),o(S,j),a(y,x,m),a(y,I,m),o(I,V),o(I,b),o(b,G),o(I,Z)},d(y){y&&t(u),y&&t(g),y&&t(S),y&&t(x),y&&t(I)}}}function Po(W){let u,v,w;return v=new N({props:{code:"cGlwJTIwaW5zdGFsbCUyMGdpdCUyQmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmhvbGxhbmNlJTJGdHJhbnNmb3JtZXJzLmdpdCU0MDY5MDBlOGJhNjUzMjE2MmE4NjEzZDIyNzBlYzIyODZjM2Y1OGY1N2I=",highlighted:"pip install git+https://github.com/hollance/transformers.git@6900e8ba6532162a8613d2270ec2286c3f58f57b"}}),{c(){u=l(`MMS model has been added to \u{1F917} Transformers very recently, so the API may still slightly change. At the time of this Unit's 
release, the MMS for TTS is scheduled to be merged in Transformers \`main\` in a couple of days. 
Once it's merged, you will have to install the library from source. Meanwhile, if you're eager to try the following inference 
example, you can install the model from the PR's branch:

	`),T(v.$$.fragment)},l(f){u=p(f,`MMS model has been added to \u{1F917} Transformers very recently, so the API may still slightly change. At the time of this Unit's 
release, the MMS for TTS is scheduled to be merged in Transformers \`main\` in a couple of days. 
Once it's merged, you will have to install the library from source. Meanwhile, if you're eager to try the following inference 
example, you can install the model from the PR's branch:

	`),k(v.$$.fragment,f)},m(f,g){a(f,u,g),M(v,f,g),w=!0},p:Wo,i(f){w||($(v.$$.fragment,f),w=!0)},o(f){_(v.$$.fragment,f),w=!1},d(f){f&&t(u),E(v,f)}}}function Xo(W){let u,v,w,f,g,S,j,x,I,V,b,G,Z,y,m,J,U,A,F,ee,te,se,ae,ks,Ms,wt,Me,$s,vt,R,_s,ot,Es,Ss,rt,Js,xs,bt,$e,Is,gt,oe,_e,Va,Tt,Ee,Gs,kt,Se,Us,Mt,Je,Vs,$t,B,_t,xe,Zs,Et,z,it,Ns,js,nt,As,Fs,lt,Ws,St,Ie,Rs,Jt,re,Ge,Za,xt,Q,zs,Ue,Hs,Ps,It,Ve,Xs,Gt,Ze,qs,Ut,ie,Vt,Ne,Cs,Zt,ne,Nt,je,Bs,jt,Y,At,H,Qs,le,Ys,Ls,pe,Ds,Ks,Ft,he,Wt,Ae,Os,Rt,Fe,ea,zt,de,Ht,We,ta,Pt,Re,sa,Xt,L,qt,ze,aa,Ct,fe,Bt,He,oa,Qt,ce,Yt,Pe,ra,Lt,ue,Dt,Xe,ia,Kt,qe,na,Ot,P,Na,es,C,D,pt,me,la,ht,pa,ts,Ce,ha,ss,K,da,ye,fa,ca,as,Be,ua,os,O,rs,Qe,ma,is,we,ns,X,ya,dt,wa,va,ft,ba,ga,ls,Ye,Ta,ps,ve,hs,Le,ka,ds,be,fs,De,Ma,cs,ge,us,q,$a,ct,_a,Ea,Te,Sa,Ja,ms,Ke,xa,ys;return S=new Ua({}),U=new Ua({}),B=new Ts({props:{$$slots:{default:[Ro]},$$scope:{ctx:W}}}),ie=new N({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>)`}}),ne=new N({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>)'}}),Y=new Ts({props:{$$slots:{default:[zo]},$$scope:{ctx:W}}}),he=new N({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>)`}}),de=new N({props:{code:"c3BlY3Ryb2dyYW0lMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZV9zcGVlY2goaW5wdXRzJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTJDJTIwc3BlYWtlcl9lbWJlZGRpbmdzKQ==",highlighted:'spectrogram = model.generate_speech(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], speaker_embeddings)'}}),L=new Ts({props:{$$slots:{default:[Ho]},$$scope:{ctx:W}}}),fe=new N({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>)`}}),ce=new N({props:{code:"c3BlZWNoJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGVfc3BlZWNoKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMHNwZWFrZXJfZW1iZWRkaW5ncyUyQyUyMHZvY29kZXIlM0R2b2NvZGVyKQ==",highlighted:'speech = model.generate_speech(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], speaker_embeddings, vocoder=vocoder)'}}),ue=new N({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>)`}}),me=new Ua({}),O=new Ts({props:{warning:!0,$$slots:{default:[Po]},$$scope:{ctx:W}}}),we=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFZpdHNNb2RlbCUyQyUyMFZpdHNUb2tlbml6ZXIlMEElMEFtb2RlbCUyMCUzRCUyMFZpdHNNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyTWF0dGhpanMlMkZtbXMtdHRzLWRldSUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBWaXRzVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJNYXR0aGlqcyUyRm1tcy10dHMtZGV1JTIyKQ==",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;Matthijs/mms-tts-deu&quot;</span>)
tokenizer = VitsTokenizer.from_pretrained(<span class="hljs-string">&quot;Matthijs/mms-tts-deu&quot;</span>)`}}),ve=new N({props:{code:"dGV4dF9leGFtcGxlJTIwJTNEJTIwKCUwQSUyMCUyMCUyMCUyMCUyMkljaCUyMGJpbiUyMFNjaG5hcHBpJTIwZGFzJTIwa2xlaW5lJTIwS3Jva29kaWwlMkMlMjBrb21tJTIwYXVzJTIwJUMzJTg0Z3lwdGVuJTIwZGFzJTIwbGllZ3QlMjBkaXJla3QlMjBhbSUyME5pbC4lMjIlMEEp",highlighted:`text_example = (
    <span class="hljs-string">&quot;Ich bin Schnappi das kleine Krokodil, komm aus \xC4gypten das liegt direkt am Nil.&quot;</span>
)`}}),be=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIodGV4dF9leGFtcGxlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFpbnB1dF9pZHMlMjAlM0QlMjBpbnB1dHMlNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0X2lkcyklMEElMEFzcGVlY2glMjAlM0QlMjBvdXRwdXRzLmF1ZGlvJTVCMCU1RA==",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.audio[<span class="hljs-number">0</span>]`}}),ge=new N({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>)`}}),{c(){u=r("meta"),v=h(),w=r("h1"),f=r("a"),g=r("span"),T(S.$$.fragment),j=h(),x=r("span"),I=l("Pre-trained models for text-to-speech"),V=h(),b=r("p"),G=l(`Compared to ASR (automatic speech recognition) and audio classification tasks, there are significantly fewer pre-trained
model checkpoints available. On the \u{1F917} Hub, you\u2019ll find close to 300 suitable checkpoints. Among
these pre-trained models we\u2019ll focus on two architectures that are readily available for you in the \u{1F917} Transformers library -
SpeechT5 and Massive Multilingual Speech (MMS). In this section, we\u2019ll explore how to use these pre-trained models in the
Transformers library for TTS.`),Z=h(),y=r("h2"),m=r("a"),J=r("span"),T(U.$$.fragment),A=h(),F=r("span"),ee=l("SpeechT5"),te=h(),se=r("p"),ae=r("a"),ks=l("SpeechT5"),Ms=l(` 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=h(),Me=r("p"),$s=l(`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.`),vt=h(),R=r("p"),_s=l("This Transformer is complemented with six modal-specific (speech/text) "),ot=r("em"),Es=l("pre-nets"),Ss=l(" and "),rt=r("em"),Js=l("post-nets"),xs=l(`. 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\u2019s output is then passed to a post-net that will use it to generate the output in the target modality.`),bt=h(),$e=r("p"),Is=l("This is what the architecture looks like (image from the original paper):"),gt=h(),oe=r("div"),_e=r("img"),Tt=h(),Ee=r("p"),Gs=l(`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.`),kt=h(),Se=r("p"),Us=l(`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\u2019d
need the text encoder pre-net for the text inputs and the speech decoder pre- and post-nets for the speech outputs.`),Mt=h(),Je=r("p"),Vs=l(`This approach allows to obtain several models fine-tuned for different speech tasks that all benefit from the initial
pre-training on unlabeled data.`),$t=h(),T(B.$$.fragment),_t=h(),xe=r("p"),Zs=l("Let\u2019s see what are the pre- and post-nets that SpeechT5 uses for the TTS task specifically:"),Et=h(),z=r("ul"),it=r("li"),Ns=l("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."),js=h(),nt=r("li"),As=l("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."),Fs=h(),lt=r("li"),Ws=l("Speech decoder post-net: This predicts a residual to add to the output spectrogram and is used to refine the results."),St=h(),Ie=r("p"),Rs=l("When combined, this is what SpeechT5 architecture for text-to-speech looks like:"),Jt=h(),re=r("div"),Ge=r("img"),xt=h(),Q=r("p"),zs=l(`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 `),Ue=r("a"),Hs=l("Unit 3"),Ps=l(`. 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=h(),Ve=r("p"),Xs=l("Let\u2019s see how you could do that."),Gt=h(),Ze=r("p"),qs=l(`First, let\u2019s load the fine-tuned TTS SpeechT5 model from the \u{1F917} Hub, along with the processor object used for tokenization
and feature extraction:`),Ut=h(),T(ie.$$.fragment),Vt=h(),Ne=r("p"),Cs=l("Next, tokenize the input text."),Zt=h(),T(ne.$$.fragment),Nt=h(),je=r("p"),Bs=l(`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\u2019s voice characteristics.`),jt=h(),T(Y.$$.fragment),At=h(),H=r("p"),Qs=l(`Let\u2019s load such a speaker embedding from a dataset on the Hub. The embeddings
were obtained from the `),le=r("a"),Ys=l("CMU ARCTIC dataset"),Ls=l(` using
`),pe=r("a"),Ds=l("this script"),Ks=l(`, but
any X-Vector embedding should work.`),Ft=h(),T(he.$$.fragment),Wt=h(),Ae=r("p"),Os=l("The speaker embedding is a tensor of shape (1, 512). This particular speaker embedding describes a female voice."),Rt=h(),Fe=r("p"),ea=l("At this point we already have enough inputs to generate a log mel spectrogram as an output, you can do it like this:"),zt=h(),T(de.$$.fragment),Ht=h(),We=r("p"),ta=l(`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.`),Pt=h(),Re=r("p"),sa=l(`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, \u{1F917} Transformers offers a vocoder
based on HiFi-GAN. Its weights were kindly provided by the original authors of SpeechT5.`),Xt=h(),T(L.$$.fragment),qt=h(),ze=r("p"),aa=l("Loading the vocoder is as easy as any other \u{1F917} Transformers model."),Ct=h(),T(fe.$$.fragment),Bt=h(),He=r("p"),oa=l("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."),Qt=h(),T(ce.$$.fragment),Yt=h(),Pe=r("p"),ra=l("Let\u2019s listen to the result. The sample rate used by SpeechT5 is always 16 kHz."),Lt=h(),T(ue.$$.fragment),Dt=h(),Xe=r("p"),ia=l("Neat!"),Kt=h(),qe=r("p"),na=l(`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=h(),P=r("iframe"),es=h(),C=r("h2"),D=r("a"),pt=r("span"),T(me.$$.fragment),la=h(),ht=r("span"),pa=l("Massive Multilingual Speech (MMS)"),ts=h(),Ce=r("p"),ha=l(`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.`),ss=h(),K=r("p"),da=l("MMS for text-to-speech is based on "),ye=r("a"),fa=l("VITS Kim et al., 2021"),ca=l(`, which is one of the
state-of-the-art TTS approaches.`),as=h(),Be=r("p"),ua=l(`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.
This means that you do not need to add a vocoder for inference, it\u2019s already \u201Cbuilt-in\u201D.`),os=h(),T(O.$$.fragment),rs=h(),Qe=r("p"),ma=l(`Let\u2019s give MMS a go, and see how we can synthesize speech in a language other than English, e.g. German.
First, we\u2019ll load the model checkpoint and the tokenizer for the correct language:`),is=h(),T(we.$$.fragment),ns=h(),X=r("p"),ya=l("You may notice that to load the MMS model you need to use "),dt=r("code"),wa=l("VitsModel"),va=l(" and "),ft=r("code"),ba=l("VitsTokenizer"),ga=l(`. This is because MMS for text-to-speech
is based on the VITS model as mentioned earlier.`),ls=h(),Ye=r("p"),Ta=l("Let\u2019s pick an example text in German, like these first two lines from a children\u2019s song:"),ps=h(),T(ve.$$.fragment),hs=h(),Le=r("p"),ka=l("To generate a waveform output, preprocess the text with the tokenizer, and pass it to the model:"),ds=h(),T(be.$$.fragment),fs=h(),De=r("p"),Ma=l("Let\u2019s listen to it:"),cs=h(),T(ge.$$.fragment),us=h(),q=r("p"),$a=l("Wunderbar! If you\u2019d like to try MMS with another language, find other suitable "),ct=r("code"),_a=l("vits"),Ea=l(" checkpoints "),Te=r("a"),Sa=l("on \u{1F917} Hub"),Ja=l("."),ms=h(),Ke=r("p"),xa=l("Now let\u2019s see how you can fine-tune a TTS model yourself!"),this.h()},l(e){const s=Ao('[data-svelte="svelte-1phssyn"]',document.head);u=i(s,"META",{name:!0,content:!0}),s.forEach(t),v=d(e),w=i(e,"H1",{class:!0});var ke=n(w);f=i(ke,"A",{id:!0,class:!0,href:!0});var ut=n(f);g=i(ut,"SPAN",{});var mt=n(g);k(S.$$.fragment,mt),mt.forEach(t),ut.forEach(t),j=d(ke),x=i(ke,"SPAN",{});var yt=n(x);I=p(yt,"Pre-trained models for text-to-speech"),yt.forEach(t),ke.forEach(t),V=d(e),b=i(e,"P",{});var ja=n(b);G=p(ja,`Compared to ASR (automatic speech recognition) and audio classification tasks, there are significantly fewer pre-trained
model checkpoints available. On the \u{1F917} Hub, you\u2019ll find close to 300 suitable checkpoints. Among
these pre-trained models we\u2019ll focus on two architectures that are readily available for you in the \u{1F917} Transformers library -
SpeechT5 and Massive Multilingual Speech (MMS). In this section, we\u2019ll explore how to use these pre-trained models in the
Transformers library for TTS.`),ja.forEach(t),Z=d(e),y=i(e,"H2",{class:!0});var ws=n(y);m=i(ws,"A",{id:!0,class:!0,href:!0});var Aa=n(m);J=i(Aa,"SPAN",{});var Fa=n(J);k(U.$$.fragment,Fa),Fa.forEach(t),Aa.forEach(t),A=d(ws),F=i(ws,"SPAN",{});var Wa=n(F);ee=p(Wa,"SpeechT5"),Wa.forEach(t),ws.forEach(t),te=d(e),se=i(e,"P",{});var Ia=n(se);ae=i(Ia,"A",{href:!0,rel:!0});var Ra=n(ae);ks=p(Ra,"SpeechT5"),Ra.forEach(t),Ms=p(Ia,` 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.`),Ia.forEach(t),wt=d(e),Me=i(e,"P",{});var za=n(Me);$s=p(za,`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.`),za.forEach(t),vt=d(e),R=i(e,"P",{});var Oe=n(R);_s=p(Oe,"This Transformer is complemented with six modal-specific (speech/text) "),ot=i(Oe,"EM",{});var Ha=n(ot);Es=p(Ha,"pre-nets"),Ha.forEach(t),Ss=p(Oe," and "),rt=i(Oe,"EM",{});var Pa=n(rt);Js=p(Pa,"post-nets"),Pa.forEach(t),xs=p(Oe,`. 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\u2019s output is then passed to a post-net that will use it to generate the output in the target modality.`),Oe.forEach(t),bt=d(e),$e=i(e,"P",{});var Xa=n($e);Is=p(Xa,"This is what the architecture looks like (image from the original paper):"),Xa.forEach(t),gt=d(e),oe=i(e,"DIV",{class:!0});var qa=n(oe);_e=i(qa,"IMG",{src:!0,alt:!0}),qa.forEach(t),Tt=d(e),Ee=i(e,"P",{});var Ca=n(Ee);Gs=p(Ca,`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.`),Ca.forEach(t),kt=d(e),Se=i(e,"P",{});var Ba=n(Se);Us=p(Ba,`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\u2019d
need the text encoder pre-net for the text inputs and the speech decoder pre- and post-nets for the speech outputs.`),Ba.forEach(t),Mt=d(e),Je=i(e,"P",{});var Qa=n(Je);Vs=p(Qa,`This approach allows to obtain several models fine-tuned for different speech tasks that all benefit from the initial
pre-training on unlabeled data.`),Qa.forEach(t),$t=d(e),k(B.$$.fragment,e),_t=d(e),xe=i(e,"P",{});var Ya=n(xe);Zs=p(Ya,"Let\u2019s see what are the pre- and post-nets that SpeechT5 uses for the TTS task specifically:"),Ya.forEach(t),Et=d(e),z=i(e,"UL",{});var et=n(z);it=i(et,"LI",{});var La=n(it);Ns=p(La,"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."),La.forEach(t),js=d(et),nt=i(et,"LI",{});var Da=n(nt);As=p(Da,"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."),Da.forEach(t),Fs=d(et),lt=i(et,"LI",{});var Ka=n(lt);Ws=p(Ka,"Speech decoder post-net: This predicts a residual to add to the output spectrogram and is used to refine the results."),Ka.forEach(t),et.forEach(t),St=d(e),Ie=i(e,"P",{});var Oa=n(Ie);Rs=p(Oa,"When combined, this is what SpeechT5 architecture for text-to-speech looks like:"),Oa.forEach(t),Jt=d(e),re=i(e,"DIV",{class:!0});var eo=n(re);Ge=i(eo,"IMG",{src:!0,alt:!0}),eo.forEach(t),xt=d(e),Q=i(e,"P",{});var vs=n(Q);zs=p(vs,`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 `),Ue=i(vs,"A",{href:!0});var to=n(Ue);Hs=p(to,"Unit 3"),to.forEach(t),Ps=p(vs,`. 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.`),vs.forEach(t),It=d(e),Ve=i(e,"P",{});var so=n(Ve);Xs=p(so,"Let\u2019s see how you could do that."),so.forEach(t),Gt=d(e),Ze=i(e,"P",{});var ao=n(Ze);qs=p(ao,`First, let\u2019s load the fine-tuned TTS SpeechT5 model from the \u{1F917} Hub, along with the processor object used for tokenization
and feature extraction:`),ao.forEach(t),Ut=d(e),k(ie.$$.fragment,e),Vt=d(e),Ne=i(e,"P",{});var oo=n(Ne);Cs=p(oo,"Next, tokenize the input text."),oo.forEach(t),Zt=d(e),k(ne.$$.fragment,e),Nt=d(e),je=i(e,"P",{});var ro=n(je);Bs=p(ro,`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\u2019s voice characteristics.`),ro.forEach(t),jt=d(e),k(Y.$$.fragment,e),At=d(e),H=i(e,"P",{});var tt=n(H);Qs=p(tt,`Let\u2019s load such a speaker embedding from a dataset on the Hub. The embeddings
were obtained from the `),le=i(tt,"A",{href:!0,rel:!0});var io=n(le);Ys=p(io,"CMU ARCTIC dataset"),io.forEach(t),Ls=p(tt,` using
`),pe=i(tt,"A",{href:!0,rel:!0});var no=n(pe);Ds=p(no,"this script"),no.forEach(t),Ks=p(tt,`, but
any X-Vector embedding should work.`),tt.forEach(t),Ft=d(e),k(he.$$.fragment,e),Wt=d(e),Ae=i(e,"P",{});var lo=n(Ae);Os=p(lo,"The speaker embedding is a tensor of shape (1, 512). This particular speaker embedding describes a female voice."),lo.forEach(t),Rt=d(e),Fe=i(e,"P",{});var po=n(Fe);ea=p(po,"At this point we already have enough inputs to generate a log mel spectrogram as an output, you can do it like this:"),po.forEach(t),zt=d(e),k(de.$$.fragment,e),Ht=d(e),We=i(e,"P",{});var ho=n(We);ta=p(ho,`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.`),ho.forEach(t),Pt=d(e),Re=i(e,"P",{});var fo=n(Re);sa=p(fo,`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, \u{1F917} Transformers offers a vocoder
based on HiFi-GAN. Its weights were kindly provided by the original authors of SpeechT5.`),fo.forEach(t),Xt=d(e),k(L.$$.fragment,e),qt=d(e),ze=i(e,"P",{});var co=n(ze);aa=p(co,"Loading the vocoder is as easy as any other \u{1F917} Transformers model."),co.forEach(t),Ct=d(e),k(fe.$$.fragment,e),Bt=d(e),He=i(e,"P",{});var uo=n(He);oa=p(uo,"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."),uo.forEach(t),Qt=d(e),k(ce.$$.fragment,e),Yt=d(e),Pe=i(e,"P",{});var mo=n(Pe);ra=p(mo,"Let\u2019s listen to the result. The sample rate used by SpeechT5 is always 16 kHz."),mo.forEach(t),Lt=d(e),k(ue.$$.fragment,e),Dt=d(e),Xe=i(e,"P",{});var yo=n(Xe);ia=p(yo,"Neat!"),yo.forEach(t),Kt=d(e),qe=i(e,"P",{});var wo=n(qe);na=p(wo,`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:`),wo.forEach(t),Ot=d(e),P=i(e,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0});var Vo=n(P);Vo.forEach(t),es=d(e),C=i(e,"H2",{class:!0});var bs=n(C);D=i(bs,"A",{id:!0,class:!0,href:!0});var vo=n(D);pt=i(vo,"SPAN",{});var bo=n(pt);k(me.$$.fragment,bo),bo.forEach(t),vo.forEach(t),la=d(bs),ht=i(bs,"SPAN",{});var go=n(ht);pa=p(go,"Massive Multilingual Speech (MMS)"),go.forEach(t),bs.forEach(t),ts=d(e),Ce=i(e,"P",{});var To=n(Ce);ha=p(To,`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.`),To.forEach(t),ss=d(e),K=i(e,"P",{});var gs=n(K);da=p(gs,"MMS for text-to-speech is based on "),ye=i(gs,"A",{href:!0,rel:!0});var ko=n(ye);fa=p(ko,"VITS Kim et al., 2021"),ko.forEach(t),ca=p(gs,`, which is one of the
state-of-the-art TTS approaches.`),gs.forEach(t),as=d(e),Be=i(e,"P",{});var Mo=n(Be);ua=p(Mo,`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.
This means that you do not need to add a vocoder for inference, it\u2019s already \u201Cbuilt-in\u201D.`),Mo.forEach(t),os=d(e),k(O.$$.fragment,e),rs=d(e),Qe=i(e,"P",{});var $o=n(Qe);ma=p($o,`Let\u2019s give MMS a go, and see how we can synthesize speech in a language other than English, e.g. German.
First, we\u2019ll load the model checkpoint and the tokenizer for the correct language:`),$o.forEach(t),is=d(e),k(we.$$.fragment,e),ns=d(e),X=i(e,"P",{});var st=n(X);ya=p(st,"You may notice that to load the MMS model you need to use "),dt=i(st,"CODE",{});var _o=n(dt);wa=p(_o,"VitsModel"),_o.forEach(t),va=p(st," and "),ft=i(st,"CODE",{});var Eo=n(ft);ba=p(Eo,"VitsTokenizer"),Eo.forEach(t),ga=p(st,`. This is because MMS for text-to-speech
is based on the VITS model as mentioned earlier.`),st.forEach(t),ls=d(e),Ye=i(e,"P",{});var So=n(Ye);Ta=p(So,"Let\u2019s pick an example text in German, like these first two lines from a children\u2019s song:"),So.forEach(t),ps=d(e),k(ve.$$.fragment,e),hs=d(e),Le=i(e,"P",{});var Jo=n(Le);ka=p(Jo,"To generate a waveform output, preprocess the text with the tokenizer, and pass it to the model:"),Jo.forEach(t),ds=d(e),k(be.$$.fragment,e),fs=d(e),De=i(e,"P",{});var xo=n(De);Ma=p(xo,"Let\u2019s listen to it:"),xo.forEach(t),cs=d(e),k(ge.$$.fragment,e),us=d(e),q=i(e,"P",{});var at=n(q);$a=p(at,"Wunderbar! If you\u2019d like to try MMS with another language, find other suitable "),ct=i(at,"CODE",{});var Io=n(ct);_a=p(Io,"vits"),Io.forEach(t),Ea=p(at," checkpoints "),Te=i(at,"A",{href:!0,rel:!0});var Go=n(Te);Sa=p(Go,"on \u{1F917} Hub"),Go.forEach(t),Ja=p(at,"."),at.forEach(t),ms=d(e),Ke=i(e,"P",{});var Uo=n(Ke);xa=p(Uo,"Now let\u2019s see how you can fine-tune a TTS model yourself!"),Uo.forEach(t),this.h()},h(){c(u,"name","hf:doc:metadata"),c(u,"content",JSON.stringify(qo)),c(f,"id","pretrained-models-for-texttospeech"),c(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(f,"href","#pretrained-models-for-texttospeech"),c(w,"class","relative group"),c(m,"id","speecht5"),c(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(m,"href","#speecht5"),c(y,"class","relative group"),c(ae,"href","https://arxiv.org/abs/2110.07205"),c(ae,"rel","nofollow"),Ga(_e.src,Va="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/speecht5/architecture.jpg")||c(_e,"src",Va),c(_e,"alt","SpeechT5 architecture from the original paper"),c(oe,"class","flex justify-center"),Ga(Ge.src,Za="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/speecht5/tts.jpg")||c(Ge,"src",Za),c(Ge,"alt","SpeechT5 architecture for TTS"),c(re,"class","flex justify-center"),c(Ue,"href","../chapter3/introduction#spectrogram-output"),c(le,"href","http://www.festvox.org/cmu_arctic/"),c(le,"rel","nofollow"),c(pe,"href","https://huggingface.co/mechanicalsea/speecht5-vc/blob/main/manifest/utils/prep_cmu_arctic_spkemb.py"),c(pe,"rel","nofollow"),Ga(P.src,Na="https://matthijs-speecht5-tts-demo.hf.space")||c(P,"src",Na),c(P,"frameborder","0"),c(P,"width","850"),c(P,"height","450"),c(D,"id","massive-multilingual-speech-mms"),c(D,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(D,"href","#massive-multilingual-speech-mms"),c(C,"class","relative group"),c(ye,"href","https://arxiv.org/pdf/2106.06103.pdf"),c(ye,"rel","nofollow"),c(Te,"href","https://huggingface.co/models?filter=vits"),c(Te,"rel","nofollow")},m(e,s){o(document.head,u),a(e,v,s),a(e,w,s),o(w,f),o(f,g),M(S,g,null),o(w,j),o(w,x),o(x,I),a(e,V,s),a(e,b,s),o(b,G),a(e,Z,s),a(e,y,s),o(y,m),o(m,J),M(U,J,null),o(y,A),o(y,F),o(F,ee),a(e,te,s),a(e,se,s),o(se,ae),o(ae,ks),o(se,Ms),a(e,wt,s),a(e,Me,s),o(Me,$s),a(e,vt,s),a(e,R,s),o(R,_s),o(R,ot),o(ot,Es),o(R,Ss),o(R,rt),o(rt,Js),o(R,xs),a(e,bt,s),a(e,$e,s),o($e,Is),a(e,gt,s),a(e,oe,s),o(oe,_e),a(e,Tt,s),a(e,Ee,s),o(Ee,Gs),a(e,kt,s),a(e,Se,s),o(Se,Us),a(e,Mt,s),a(e,Je,s),o(Je,Vs),a(e,$t,s),M(B,e,s),a(e,_t,s),a(e,xe,s),o(xe,Zs),a(e,Et,s),a(e,z,s),o(z,it),o(it,Ns),o(z,js),o(z,nt),o(nt,As),o(z,Fs),o(z,lt),o(lt,Ws),a(e,St,s),a(e,Ie,s),o(Ie,Rs),a(e,Jt,s),a(e,re,s),o(re,Ge),a(e,xt,s),a(e,Q,s),o(Q,zs),o(Q,Ue),o(Ue,Hs),o(Q,Ps),a(e,It,s),a(e,Ve,s),o(Ve,Xs),a(e,Gt,s),a(e,Ze,s),o(Ze,qs),a(e,Ut,s),M(ie,e,s),a(e,Vt,s),a(e,Ne,s),o(Ne,Cs),a(e,Zt,s),M(ne,e,s),a(e,Nt,s),a(e,je,s),o(je,Bs),a(e,jt,s),M(Y,e,s),a(e,At,s),a(e,H,s),o(H,Qs),o(H,le),o(le,Ys),o(H,Ls),o(H,pe),o(pe,Ds),o(H,Ks),a(e,Ft,s),M(he,e,s),a(e,Wt,s),a(e,Ae,s),o(Ae,Os),a(e,Rt,s),a(e,Fe,s),o(Fe,ea),a(e,zt,s),M(de,e,s),a(e,Ht,s),a(e,We,s),o(We,ta),a(e,Pt,s),a(e,Re,s),o(Re,sa),a(e,Xt,s),M(L,e,s),a(e,qt,s),a(e,ze,s),o(ze,aa),a(e,Ct,s),M(fe,e,s),a(e,Bt,s),a(e,He,s),o(He,oa),a(e,Qt,s),M(ce,e,s),a(e,Yt,s),a(e,Pe,s),o(Pe,ra),a(e,Lt,s),M(ue,e,s),a(e,Dt,s),a(e,Xe,s),o(Xe,ia),a(e,Kt,s),a(e,qe,s),o(qe,na),a(e,Ot,s),a(e,P,s),a(e,es,s),a(e,C,s),o(C,D),o(D,pt),M(me,pt,null),o(C,la),o(C,ht),o(ht,pa),a(e,ts,s),a(e,Ce,s),o(Ce,ha),a(e,ss,s),a(e,K,s),o(K,da),o(K,ye),o(ye,fa),o(K,ca),a(e,as,s),a(e,Be,s),o(Be,ua),a(e,os,s),M(O,e,s),a(e,rs,s),a(e,Qe,s),o(Qe,ma),a(e,is,s),M(we,e,s),a(e,ns,s),a(e,X,s),o(X,ya),o(X,dt),o(dt,wa),o(X,va),o(X,ft),o(ft,ba),o(X,ga),a(e,ls,s),a(e,Ye,s),o(Ye,Ta),a(e,ps,s),M(ve,e,s),a(e,hs,s),a(e,Le,s),o(Le,ka),a(e,ds,s),M(be,e,s),a(e,fs,s),a(e,De,s),o(De,Ma),a(e,cs,s),M(ge,e,s),a(e,us,s),a(e,q,s),o(q,$a),o(q,ct),o(ct,_a),o(q,Ea),o(q,Te),o(Te,Sa),o(q,Ja),a(e,ms,s),a(e,Ke,s),o(Ke,xa),ys=!0},p(e,[s]){const ke={};s&2&&(ke.$$scope={dirty:s,ctx:e}),B.$set(ke);const ut={};s&2&&(ut.$$scope={dirty:s,ctx:e}),Y.$set(ut);const mt={};s&2&&(mt.$$scope={dirty:s,ctx:e}),L.$set(mt);const yt={};s&2&&(yt.$$scope={dirty:s,ctx:e}),O.$set(yt)},i(e){ys||($(S.$$.fragment,e),$(U.$$.fragment,e),$(B.$$.fragment,e),$(ie.$$.fragment,e),$(ne.$$.fragment,e),$(Y.$$.fragment,e),$(he.$$.fragment,e),$(de.$$.fragment,e),$(L.$$.fragment,e),$(fe.$$.fragment,e),$(ce.$$.fragment,e),$(ue.$$.fragment,e),$(me.$$.fragment,e),$(O.$$.fragment,e),$(we.$$.fragment,e),$(ve.$$.fragment,e),$(be.$$.fragment,e),$(ge.$$.fragment,e),ys=!0)},o(e){_(S.$$.fragment,e),_(U.$$.fragment,e),_(B.$$.fragment,e),_(ie.$$.fragment,e),_(ne.$$.fragment,e),_(Y.$$.fragment,e),_(he.$$.fragment,e),_(de.$$.fragment,e),_(L.$$.fragment,e),_(fe.$$.fragment,e),_(ce.$$.fragment,e),_(ue.$$.fragment,e),_(me.$$.fragment,e),_(O.$$.fragment,e),_(we.$$.fragment,e),_(ve.$$.fragment,e),_(be.$$.fragment,e),_(ge.$$.fragment,e),ys=!1},d(e){t(u),e&&t(v),e&&t(w),E(S),e&&t(V),e&&t(b),e&&t(Z),e&&t(y),E(U),e&&t(te),e&&t(se),e&&t(wt),e&&t(Me),e&&t(vt),e&&t(R),e&&t(bt),e&&t($e),e&&t(gt),e&&t(oe),e&&t(Tt),e&&t(Ee),e&&t(kt),e&&t(Se),e&&t(Mt),e&&t(Je),e&&t($t),E(B,e),e&&t(_t),e&&t(xe),e&&t(Et),e&&t(z),e&&t(St),e&&t(Ie),e&&t(Jt),e&&t(re),e&&t(xt),e&&t(Q),e&&t(It),e&&t(Ve),e&&t(Gt),e&&t(Ze),e&&t(Ut),E(ie,e),e&&t(Vt),e&&t(Ne),e&&t(Zt),E(ne,e),e&&t(Nt),e&&t(je),e&&t(jt),E(Y,e),e&&t(At),e&&t(H),e&&t(Ft),E(he,e),e&&t(Wt),e&&t(Ae),e&&t(Rt),e&&t(Fe),e&&t(zt),E(de,e),e&&t(Ht),e&&t(We),e&&t(Pt),e&&t(Re),e&&t(Xt),E(L,e),e&&t(qt),e&&t(ze),e&&t(Ct),E(fe,e),e&&t(Bt),e&&t(He),e&&t(Qt),E(ce,e),e&&t(Yt),e&&t(Pe),e&&t(Lt),E(ue,e),e&&t(Dt),e&&t(Xe),e&&t(Kt),e&&t(qe),e&&t(Ot),e&&t(P),e&&t(es),e&&t(C),E(me),e&&t(ts),e&&t(Ce),e&&t(ss),e&&t(K),e&&t(as),e&&t(Be),e&&t(os),E(O,e),e&&t(rs),e&&t(Qe),e&&t(is),E(we,e),e&&t(ns),e&&t(X),e&&t(ls),e&&t(Ye),e&&t(ps),E(ve,e),e&&t(hs),e&&t(Le),e&&t(ds),E(be,e),e&&t(fs),e&&t(De),e&&t(cs),E(ge,e),e&&t(us),e&&t(q),e&&t(ms),e&&t(Ke)}}}const qo={local:"pretrained-models-for-texttospeech",sections:[{local:"speecht5",title:"SpeechT5 "},{local:"massive-multilingual-speech-mms",title:"Massive Multilingual Speech (MMS)"}],title:"Pre-trained models for text-to-speech"};function Co(W){return Fo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Do extends Zo{constructor(u){super();No(this,u,Co,Xo,jo,{})}}export{Do as default,qo as metadata};
