import{s as kl,a as xl,o as Jl,n as yt}from"../chunks/scheduler.cd324960.js";import{S as Ul,i as _l,e as i,s as l,c as m,h as Il,a as o,d as s,b as a,f as Cl,g as h,j as r,k as N,l as jl,m as n,n as f,t as y,o as w,p as M,q as Zl,r as Hl}from"../chunks/index.d5c3adcc.js";import{T as ft}from"../chunks/Tip.889bec11.js";import{C as Gl,H as an,E as Bl}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.8072ce1f.js";import{C as T}from"../chunks/CodeBlock.2a6d4252.js";function Vl(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(u){p=o(u,"P",{"data-svelte-h":!0}),r(p)!=="svelte-186t2pn"&&(p.textContent=v)},m(u,c){n(u,p,c)},p:yt,d(u){u&&s(p)}}}function Sl(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:`,u,c,g="<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>",$,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,u=l(),c=i("ul"),c.innerHTML=g,$=l(),b=i("p"),b.innerHTML=J},l(d){p=o(d,"P",{"data-svelte-h":!0}),r(p)!=="svelte-mdrkn0"&&(p.textContent=v),u=a(d),c=o(d,"UL",{"data-svelte-h":!0}),r(c)!=="svelte-1hi7sgd"&&(c.innerHTML=g),$=a(d),b=o(d,"P",{"data-svelte-h":!0}),r(b)!=="svelte-1jxhw7z"&&(b.innerHTML=J)},m(d,C){n(d,p,C),n(d,u,C),n(d,c,C),n(d,$,C),n(d,b,C)},p:yt,d(d){d&&(s(p),s(u),s(c),s($),s(b))}}}function Wl(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.`,u,c,g=`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.`,$,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,u=l(),c=i("p"),c.textContent=g,$=l(),b=i("p"),b.innerHTML=J},l(d){p=o(d,"P",{"data-svelte-h":!0}),r(p)!=="svelte-1netc3w"&&(p.innerHTML=v),u=a(d),c=o(d,"P",{"data-svelte-h":!0}),r(c)!=="svelte-1c62h2f"&&(c.textContent=g),$=a(d),b=o(d,"P",{"data-svelte-h":!0}),r(b)!=="svelte-guovqp"&&(b.innerHTML=J)},m(d,C){n(d,p,C),n(d,u,C),n(d,c,C),n(d,$,C),n(d,b,C)},p:yt,d(d){d&&(s(p),s(u),s(c),s($),s(b))}}}function zl(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(u){p=o(u,"P",{"data-svelte-h":!0}),r(p)!=="svelte-19jzp61"&&(p.innerHTML=v)},m(u,c){n(u,p,c)},p:yt,d(u){u&&s(p)}}}function Rl(k){let p,v,u;return v=new T({props:{code:"cGlwJTIwaW5zdGFsbCUyMGdpdCUyQmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmh1Z2dpbmdmYWNlJTJGdHJhbnNmb3JtZXJzLmdpdA==",highlighted:"pip install git+https://github.com/huggingface/transformers.git",wrap:!1}}),{c(){p=Zl(`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=Hl(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,g){n(c,p,g),f(v,c,g),u=!0},p:yt,i(c){u||(y(v.$$.fragment,c),u=!0)},o(c){w(v.$$.fragment,c),u=!1},d(c){c&&s(p),M(v,c)}}}function Xl(k){let p,v,u,c,g,$,b,J,d,C=`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.`,wt,L,Mt,Q,on=`<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.`,vt,F,rn=`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.`,bt,E,pn=`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.`,Tt,q,cn="This is what the architecture looks like (image from the original paper):",gt,U,dn='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/speecht5/architecture.jpg" alt="SpeechT5 architecture from the original paper"/>',$t,Y,un=`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.`,Ct,P,mn=`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.`,kt,A,hn=`This approach allows to obtain several models fine-tuned for different speech tasks that all benefit from the initial
pre-training on unlabeled data.`,xt,_,Jt,D,fn="Let’s see what are the pre- and post-nets that SpeechT5 uses for the TTS task specifically:",Ut,K,yn="<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>",_t,O,wn="When combined, this is what SpeechT5 architecture for text-to-speech looks like:",It,I,Mn='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/speecht5/tts.jpg" alt="SpeechT5 architecture for TTS"/>',jt,ee,vn=`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.`,Zt,te,bn="Let’s see how you could do that.",Ht,se,Tn=`First, let’s load the fine-tuned TTS SpeechT5 model from the 🤗 Hub, along with the processor object used for tokenization
and feature extraction:`,Gt,ne,Bt,le,gn="Next, tokenize the input text.",Vt,ae,St,ie,$n=`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.`,Wt,j,zt,oe,Cn=`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.`,Rt,re,Xt,pe,kn="The speaker embedding is a tensor of shape (1, 512). This particular speaker embedding describes a female voice.",Nt,ce,xn="At this point we already have enough inputs to generate a log mel spectrogram as an output, you can do it like this:",Lt,de,Qt,ue,Jn=`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.`,Ft,me,Un=`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.`,Et,Z,qt,he,_n="Loading the vocoder is as easy as any other 🤗 Transformers model.",Yt,fe,Pt,ye,In="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.",At,we,Dt,Me,jn="Let’s listen to the result. The sample rate used by SpeechT5 is always 16 kHz.",Kt,ve,Ot,be,Zn="Neat!",es,Te,Hn=`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:`,ts,x,Gn="",Bn,ss,ge,ns,$e,Vn='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>.',ls,Ce,Sn='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.',as,ke,Wn="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.",is,xe,zn="To be more specific, Bark is made of 4 main models:",os,Je,Rn="<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>",rs,Ue,Xn="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.",ps,_e,Nn="Bark is an highly-controllable text-to-speech model, meaning you can use with various settings, as we are going to see.",cs,Ie,Ln="Before everything, load the model and its processor.",ds,je,Qn="The processor role here is two-sides:",us,Ze,Fn="<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>",ms,He,hs,Ge,En='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.',fs,Be,ys,H,qn=`<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.`,ws,Ve,Yn='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.',Ms,Se,vs,G,Pn=`<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.`,bs,We,An="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>.",Ts,ze,gs,B,Dn=`<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.`,$s,Re,Kn="Bark can even generate music. You can help by adding ♪ musical notes ♪ around your words.",Cs,Xe,ks,V,On=`<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.`,xs,Ne,el=`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.`,Js,Le,tl="Let’s try generating a few examples:",Us,Qe,_s,Fe,sl="Let’s listen to the outputs one by one.",Is,Ee,nl="First one:",js,qe,Zs,S,ll=`<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.`,Hs,Ye,al="Second one:",Gs,Pe,Bs,W,il=`<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.`,Vs,Ae,ol="Third one:",Ss,De,Ws,z,rl=`<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.`,zs,R,Rs,Ke,Xs,Oe,pl=`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.`,Ns,et,cl=`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.`,Ls,tt,dl=`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.`,Qs,X,Fs,st,ul=`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:`,Es,nt,qs,lt,ml=`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.`,Ys,at,hl="Let’s pick an example text in German, like these first two lines from a children’s song:",Ps,it,As,ot,fl="To generate a waveform output, preprocess the text with the tokenizer, and pass it to the model:",Ds,rt,Ks,pt,yl="Let’s listen to it:",Os,ct,en,dt,wl='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>.',tn,ut,Ml="Now let’s see how you can fine-tune a TTS model yourself!",sn,mt,nn,ht,ln;return g=new Gl({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),b=new an({props:{title:"Pre-trained models for text-to-speech",local:"pre-trained-models-for-text-to-speech",headingTag:"h1"}}),L=new an({props:{title:"SpeechT5",local:"speecht5",headingTag:"h2"}}),_=new ft({props:{$$slots:{default:[Vl]},$$scope:{ctx:k}}}),ne=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}}),ae=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 ft({props:{$$slots:{default:[Sl]},$$scope:{ctx:k}}}),re=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}}),de=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 ft({props:{$$slots:{default:[Wl]},$$scope:{ctx:k}}}),fe=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}}),we=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}}),ve=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}}),ge=new an({props:{title:"Bark",local:"bark",headingTag:"h2"}}),He=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}}),Be=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}}),Se=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}}),ze=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}}),Xe=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}}),Qe=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}}),qe=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}}),Pe=new T({props:{code:"QXVkaW8oc3BlZWNoX291dHB1dCU1QjElNUQlMkMlMjByYXRlJTNEc2FtcGxpbmdfcmF0ZSk=",highlighted:'Audio(speech_output[<span class="hljs-number">1</span>], rate=sampling_rate)',wrap:!1}}),De=new T({props:{code:"QXVkaW8oc3BlZWNoX291dHB1dCU1QjIlNUQlMkMlMjByYXRlJTNEc2FtcGxpbmdfcmF0ZSk=",highlighted:'Audio(speech_output[<span class="hljs-number">2</span>], rate=sampling_rate)',wrap:!1}}),R=new ft({props:{$$slots:{default:[zl]},$$scope:{ctx:k}}}),Ke=new an({props:{title:"Massive Multilingual Speech (MMS)",local:"massive-multilingual-speech-mms",headingTag:"h2"}}),X=new ft({props:{warning:!0,$$slots:{default:[Rl]},$$scope:{ctx:k}}}),nt=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}}),it=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}}),rt=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}}),ct=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}}),mt=new Bl({props:{source:"https://github.com/huggingface/audio-transformers-course/blob/main/chapters/en/chapter6/pre-trained_models.mdx"}}),{c(){p=i("meta"),v=l(),u=i("p"),c=l(),m(g.$$.fragment),$=l(),m(b.$$.fragment),J=l(),d=i("p"),d.textContent=C,wt=l(),m(L.$$.fragment),Mt=l(),Q=i("p"),Q.innerHTML=on,vt=l(),F=i("p"),F.textContent=rn,bt=l(),E=i("p"),E.innerHTML=pn,Tt=l(),q=i("p"),q.textContent=cn,gt=l(),U=i("div"),U.innerHTML=dn,$t=l(),Y=i("p"),Y.textContent=un,Ct=l(),P=i("p"),P.textContent=mn,kt=l(),A=i("p"),A.textContent=hn,xt=l(),m(_.$$.fragment),Jt=l(),D=i("p"),D.textContent=fn,Ut=l(),K=i("ul"),K.innerHTML=yn,_t=l(),O=i("p"),O.textContent=wn,It=l(),I=i("div"),I.innerHTML=Mn,jt=l(),ee=i("p"),ee.innerHTML=vn,Zt=l(),te=i("p"),te.textContent=bn,Ht=l(),se=i("p"),se.textContent=Tn,Gt=l(),m(ne.$$.fragment),Bt=l(),le=i("p"),le.textContent=gn,Vt=l(),m(ae.$$.fragment),St=l(),ie=i("p"),ie.textContent=$n,Wt=l(),m(j.$$.fragment),zt=l(),oe=i("p"),oe.innerHTML=Cn,Rt=l(),m(re.$$.fragment),Xt=l(),pe=i("p"),pe.textContent=kn,Nt=l(),ce=i("p"),ce.textContent=xn,Lt=l(),m(de.$$.fragment),Qt=l(),ue=i("p"),ue.textContent=Jn,Ft=l(),me=i("p"),me.textContent=Un,Et=l(),m(Z.$$.fragment),qt=l(),he=i("p"),he.textContent=_n,Yt=l(),m(fe.$$.fragment),Pt=l(),ye=i("p"),ye.textContent=In,At=l(),m(we.$$.fragment),Dt=l(),Me=i("p"),Me.textContent=jn,Kt=l(),m(ve.$$.fragment),Ot=l(),be=i("p"),be.textContent=Zn,es=l(),Te=i("p"),Te.textContent=Hn,ts=l(),x=i("iframe"),x.innerHTML=Gn,ss=l(),m(ge.$$.fragment),ns=l(),$e=i("p"),$e.innerHTML=Vn,ls=l(),Ce=i("p"),Ce.innerHTML=Sn,as=l(),ke=i("p"),ke.innerHTML=Wn,is=l(),xe=i("p"),xe.textContent=zn,os=l(),Je=i("ul"),Je.innerHTML=Rn,rs=l(),Ue=i("p"),Ue.textContent=Xn,ps=l(),_e=i("p"),_e.textContent=Nn,cs=l(),Ie=i("p"),Ie.textContent=Ln,ds=l(),je=i("p"),je.textContent=Qn,us=l(),Ze=i("ol"),Ze.innerHTML=Fn,ms=l(),m(He.$$.fragment),hs=l(),Ge=i("p"),Ge.innerHTML=En,fs=l(),m(Be.$$.fragment),ys=l(),H=i("audio"),H.innerHTML=qn,ws=l(),Ve=i("p"),Ve.innerHTML=Yn,Ms=l(),m(Se.$$.fragment),vs=l(),G=i("audio"),G.innerHTML=Pn,bs=l(),We=i("p"),We.innerHTML=An,Ts=l(),m(ze.$$.fragment),gs=l(),B=i("audio"),B.innerHTML=Dn,$s=l(),Re=i("p"),Re.textContent=Kn,Cs=l(),m(Xe.$$.fragment),ks=l(),V=i("audio"),V.innerHTML=On,xs=l(),Ne=i("p"),Ne.textContent=el,Js=l(),Le=i("p"),Le.textContent=tl,Us=l(),m(Qe.$$.fragment),_s=l(),Fe=i("p"),Fe.textContent=sl,Is=l(),Ee=i("p"),Ee.textContent=nl,js=l(),m(qe.$$.fragment),Zs=l(),S=i("audio"),S.innerHTML=ll,Hs=l(),Ye=i("p"),Ye.textContent=al,Gs=l(),m(Pe.$$.fragment),Bs=l(),W=i("audio"),W.innerHTML=il,Vs=l(),Ae=i("p"),Ae.textContent=ol,Ss=l(),m(De.$$.fragment),Ws=l(),z=i("audio"),z.innerHTML=rl,zs=l(),m(R.$$.fragment),Rs=l(),m(Ke.$$.fragment),Xs=l(),Oe=i("p"),Oe.textContent=pl,Ns=l(),et=i("p"),et.innerHTML=cl,Ls=l(),tt=i("p"),tt.textContent=dl,Qs=l(),m(X.$$.fragment),Fs=l(),st=i("p"),st.textContent=ul,Es=l(),m(nt.$$.fragment),qs=l(),lt=i("p"),lt.innerHTML=ml,Ys=l(),at=i("p"),at.textContent=hl,Ps=l(),m(it.$$.fragment),As=l(),ot=i("p"),ot.textContent=fl,Ds=l(),m(rt.$$.fragment),Ks=l(),pt=i("p"),pt.textContent=yl,Os=l(),m(ct.$$.fragment),en=l(),dt=i("p"),dt.innerHTML=wl,tn=l(),ut=i("p"),ut.textContent=Ml,sn=l(),m(mt.$$.fragment),nn=l(),ht=i("p"),this.h()},l(e){const t=Il("svelte-u9bgzb",document.head);p=o(t,"META",{name:!0,content:!0}),t.forEach(s),v=a(e),u=o(e,"P",{}),Cl(u).forEach(s),c=a(e),h(g.$$.fragment,e),$=a(e),h(b.$$.fragment,e),J=a(e),d=o(e,"P",{"data-svelte-h":!0}),r(d)!=="svelte-1daxplp"&&(d.textContent=C),wt=a(e),h(L.$$.fragment,e),Mt=a(e),Q=o(e,"P",{"data-svelte-h":!0}),r(Q)!=="svelte-yag015"&&(Q.innerHTML=on),vt=a(e),F=o(e,"P",{"data-svelte-h":!0}),r(F)!=="svelte-c9tc8d"&&(F.textContent=rn),bt=a(e),E=o(e,"P",{"data-svelte-h":!0}),r(E)!=="svelte-13972z8"&&(E.innerHTML=pn),Tt=a(e),q=o(e,"P",{"data-svelte-h":!0}),r(q)!=="svelte-wr8kuz"&&(q.textContent=cn),gt=a(e),U=o(e,"DIV",{class:!0,"data-svelte-h":!0}),r(U)!=="svelte-1j5439p"&&(U.innerHTML=dn),$t=a(e),Y=o(e,"P",{"data-svelte-h":!0}),r(Y)!=="svelte-1kbr6z9"&&(Y.textContent=un),Ct=a(e),P=o(e,"P",{"data-svelte-h":!0}),r(P)!=="svelte-fdwn9q"&&(P.textContent=mn),kt=a(e),A=o(e,"P",{"data-svelte-h":!0}),r(A)!=="svelte-165k5vk"&&(A.textContent=hn),xt=a(e),h(_.$$.fragment,e),Jt=a(e),D=o(e,"P",{"data-svelte-h":!0}),r(D)!=="svelte-n345q3"&&(D.textContent=fn),Ut=a(e),K=o(e,"UL",{"data-svelte-h":!0}),r(K)!=="svelte-jd8qh8"&&(K.innerHTML=yn),_t=a(e),O=o(e,"P",{"data-svelte-h":!0}),r(O)!=="svelte-81isp3"&&(O.textContent=wn),It=a(e),I=o(e,"DIV",{class:!0,"data-svelte-h":!0}),r(I)!=="svelte-sze2fn"&&(I.innerHTML=Mn),jt=a(e),ee=o(e,"P",{"data-svelte-h":!0}),r(ee)!=="svelte-1x4m0vh"&&(ee.innerHTML=vn),Zt=a(e),te=o(e,"P",{"data-svelte-h":!0}),r(te)!=="svelte-mpoa3m"&&(te.textContent=bn),Ht=a(e),se=o(e,"P",{"data-svelte-h":!0}),r(se)!=="svelte-1rb9653"&&(se.textContent=Tn),Gt=a(e),h(ne.$$.fragment,e),Bt=a(e),le=o(e,"P",{"data-svelte-h":!0}),r(le)!=="svelte-swfq00"&&(le.textContent=gn),Vt=a(e),h(ae.$$.fragment,e),St=a(e),ie=o(e,"P",{"data-svelte-h":!0}),r(ie)!=="svelte-74c7oy"&&(ie.textContent=$n),Wt=a(e),h(j.$$.fragment,e),zt=a(e),oe=o(e,"P",{"data-svelte-h":!0}),r(oe)!=="svelte-jz5sfv"&&(oe.innerHTML=Cn),Rt=a(e),h(re.$$.fragment,e),Xt=a(e),pe=o(e,"P",{"data-svelte-h":!0}),r(pe)!=="svelte-f6dlnz"&&(pe.textContent=kn),Nt=a(e),ce=o(e,"P",{"data-svelte-h":!0}),r(ce)!=="svelte-1awgz3s"&&(ce.textContent=xn),Lt=a(e),h(de.$$.fragment,e),Qt=a(e),ue=o(e,"P",{"data-svelte-h":!0}),r(ue)!=="svelte-jpr5s4"&&(ue.textContent=Jn),Ft=a(e),me=o(e,"P",{"data-svelte-h":!0}),r(me)!=="svelte-ftado2"&&(me.textContent=Un),Et=a(e),h(Z.$$.fragment,e),qt=a(e),he=o(e,"P",{"data-svelte-h":!0}),r(he)!=="svelte-44n2yf"&&(he.textContent=_n),Yt=a(e),h(fe.$$.fragment,e),Pt=a(e),ye=o(e,"P",{"data-svelte-h":!0}),r(ye)!=="svelte-1kphbin"&&(ye.textContent=In),At=a(e),h(we.$$.fragment,e),Dt=a(e),Me=o(e,"P",{"data-svelte-h":!0}),r(Me)!=="svelte-19xs0zc"&&(Me.textContent=jn),Kt=a(e),h(ve.$$.fragment,e),Ot=a(e),be=o(e,"P",{"data-svelte-h":!0}),r(be)!=="svelte-1r9io3v"&&(be.textContent=Zn),es=a(e),Te=o(e,"P",{"data-svelte-h":!0}),r(Te)!=="svelte-1h3brza"&&(Te.textContent=Hn),ts=a(e),x=o(e,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0,"data-svelte-h":!0}),r(x)!=="svelte-k7mwvh"&&(x.innerHTML=Gn),ss=a(e),h(ge.$$.fragment,e),ns=a(e),$e=o(e,"P",{"data-svelte-h":!0}),r($e)!=="svelte-luezb9"&&($e.innerHTML=Vn),ls=a(e),Ce=o(e,"P",{"data-svelte-h":!0}),r(Ce)!=="svelte-td1jzt"&&(Ce.innerHTML=Sn),as=a(e),ke=o(e,"P",{"data-svelte-h":!0}),r(ke)!=="svelte-ayk4yt"&&(ke.innerHTML=Wn),is=a(e),xe=o(e,"P",{"data-svelte-h":!0}),r(xe)!=="svelte-1bbb3eg"&&(xe.textContent=zn),os=a(e),Je=o(e,"UL",{"data-svelte-h":!0}),r(Je)!=="svelte-1ho1l4x"&&(Je.innerHTML=Rn),rs=a(e),Ue=o(e,"P",{"data-svelte-h":!0}),r(Ue)!=="svelte-birews"&&(Ue.textContent=Xn),ps=a(e),_e=o(e,"P",{"data-svelte-h":!0}),r(_e)!=="svelte-mr83a0"&&(_e.textContent=Nn),cs=a(e),Ie=o(e,"P",{"data-svelte-h":!0}),r(Ie)!=="svelte-hrck43"&&(Ie.textContent=Ln),ds=a(e),je=o(e,"P",{"data-svelte-h":!0}),r(je)!=="svelte-hgto8u"&&(je.textContent=Qn),us=a(e),Ze=o(e,"OL",{"data-svelte-h":!0}),r(Ze)!=="svelte-1d9lyek"&&(Ze.innerHTML=Fn),ms=a(e),h(He.$$.fragment,e),hs=a(e),Ge=o(e,"P",{"data-svelte-h":!0}),r(Ge)!=="svelte-1ep51cg"&&(Ge.innerHTML=En),fs=a(e),h(Be.$$.fragment,e),ys=a(e),H=o(e,"AUDIO",{"data-svelte-h":!0}),r(H)!=="svelte-1dcfkqn"&&(H.innerHTML=qn),ws=a(e),Ve=o(e,"P",{"data-svelte-h":!0}),r(Ve)!=="svelte-1ezu4yu"&&(Ve.innerHTML=Yn),Ms=a(e),h(Se.$$.fragment,e),vs=a(e),G=o(e,"AUDIO",{"data-svelte-h":!0}),r(G)!=="svelte-1mf2amh"&&(G.innerHTML=Pn),bs=a(e),We=o(e,"P",{"data-svelte-h":!0}),r(We)!=="svelte-1sw314w"&&(We.innerHTML=An),Ts=a(e),h(ze.$$.fragment,e),gs=a(e),B=o(e,"AUDIO",{"data-svelte-h":!0}),r(B)!=="svelte-18uewve"&&(B.innerHTML=Dn),$s=a(e),Re=o(e,"P",{"data-svelte-h":!0}),r(Re)!=="svelte-17xea6o"&&(Re.textContent=Kn),Cs=a(e),h(Xe.$$.fragment,e),ks=a(e),V=o(e,"AUDIO",{"data-svelte-h":!0}),r(V)!=="svelte-xst92l"&&(V.innerHTML=On),xs=a(e),Ne=o(e,"P",{"data-svelte-h":!0}),r(Ne)!=="svelte-q2c458"&&(Ne.textContent=el),Js=a(e),Le=o(e,"P",{"data-svelte-h":!0}),r(Le)!=="svelte-1gu4p56"&&(Le.textContent=tl),Us=a(e),h(Qe.$$.fragment,e),_s=a(e),Fe=o(e,"P",{"data-svelte-h":!0}),r(Fe)!=="svelte-dtoew1"&&(Fe.textContent=sl),Is=a(e),Ee=o(e,"P",{"data-svelte-h":!0}),r(Ee)!=="svelte-8xc0ic"&&(Ee.textContent=nl),js=a(e),h(qe.$$.fragment,e),Zs=a(e),S=o(e,"AUDIO",{"data-svelte-h":!0}),r(S)!=="svelte-v3niu0"&&(S.innerHTML=ll),Hs=a(e),Ye=o(e,"P",{"data-svelte-h":!0}),r(Ye)!=="svelte-kbivly"&&(Ye.textContent=al),Gs=a(e),h(Pe.$$.fragment,e),Bs=a(e),W=o(e,"AUDIO",{"data-svelte-h":!0}),r(W)!=="svelte-1x1ywin"&&(W.innerHTML=il),Vs=a(e),Ae=o(e,"P",{"data-svelte-h":!0}),r(Ae)!=="svelte-a5t5uz"&&(Ae.textContent=ol),Ss=a(e),h(De.$$.fragment,e),Ws=a(e),z=o(e,"AUDIO",{"data-svelte-h":!0}),r(z)!=="svelte-69zylm"&&(z.innerHTML=rl),zs=a(e),h(R.$$.fragment,e),Rs=a(e),h(Ke.$$.fragment,e),Xs=a(e),Oe=o(e,"P",{"data-svelte-h":!0}),r(Oe)!=="svelte-1sn7aa3"&&(Oe.textContent=pl),Ns=a(e),et=o(e,"P",{"data-svelte-h":!0}),r(et)!=="svelte-11mw9ju"&&(et.innerHTML=cl),Ls=a(e),tt=o(e,"P",{"data-svelte-h":!0}),r(tt)!=="svelte-5uuyg0"&&(tt.textContent=dl),Qs=a(e),h(X.$$.fragment,e),Fs=a(e),st=o(e,"P",{"data-svelte-h":!0}),r(st)!=="svelte-7htp4h"&&(st.textContent=ul),Es=a(e),h(nt.$$.fragment,e),qs=a(e),lt=o(e,"P",{"data-svelte-h":!0}),r(lt)!=="svelte-1s5fwe"&&(lt.innerHTML=ml),Ys=a(e),at=o(e,"P",{"data-svelte-h":!0}),r(at)!=="svelte-cy5yeb"&&(at.textContent=hl),Ps=a(e),h(it.$$.fragment,e),As=a(e),ot=o(e,"P",{"data-svelte-h":!0}),r(ot)!=="svelte-1hq1hkh"&&(ot.textContent=fl),Ds=a(e),h(rt.$$.fragment,e),Ks=a(e),pt=o(e,"P",{"data-svelte-h":!0}),r(pt)!=="svelte-cmwyek"&&(pt.textContent=yl),Os=a(e),h(ct.$$.fragment,e),en=a(e),dt=o(e,"P",{"data-svelte-h":!0}),r(dt)!=="svelte-159l1h7"&&(dt.innerHTML=wl),tn=a(e),ut=o(e,"P",{"data-svelte-h":!0}),r(ut)!=="svelte-ul4o7z"&&(ut.textContent=Ml),sn=a(e),h(mt.$$.fragment,e),nn=a(e),ht=o(e,"P",{}),Cl(ht).forEach(s),this.h()},h(){N(p,"name","hf:doc:metadata"),N(p,"content",Nl),N(U,"class","flex justify-center"),N(I,"class","flex justify-center"),xl(x.src,Bn="https://matthijs-speecht5-tts-demo.hf.space")||N(x,"src",Bn),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){jl(document.head,p),n(e,v,t),n(e,u,t),n(e,c,t),f(g,e,t),n(e,$,t),f(b,e,t),n(e,J,t),n(e,d,t),n(e,wt,t),f(L,e,t),n(e,Mt,t),n(e,Q,t),n(e,vt,t),n(e,F,t),n(e,bt,t),n(e,E,t),n(e,Tt,t),n(e,q,t),n(e,gt,t),n(e,U,t),n(e,$t,t),n(e,Y,t),n(e,Ct,t),n(e,P,t),n(e,kt,t),n(e,A,t),n(e,xt,t),f(_,e,t),n(e,Jt,t),n(e,D,t),n(e,Ut,t),n(e,K,t),n(e,_t,t),n(e,O,t),n(e,It,t),n(e,I,t),n(e,jt,t),n(e,ee,t),n(e,Zt,t),n(e,te,t),n(e,Ht,t),n(e,se,t),n(e,Gt,t),f(ne,e,t),n(e,Bt,t),n(e,le,t),n(e,Vt,t),f(ae,e,t),n(e,St,t),n(e,ie,t),n(e,Wt,t),f(j,e,t),n(e,zt,t),n(e,oe,t),n(e,Rt,t),f(re,e,t),n(e,Xt,t),n(e,pe,t),n(e,Nt,t),n(e,ce,t),n(e,Lt,t),f(de,e,t),n(e,Qt,t),n(e,ue,t),n(e,Ft,t),n(e,me,t),n(e,Et,t),f(Z,e,t),n(e,qt,t),n(e,he,t),n(e,Yt,t),f(fe,e,t),n(e,Pt,t),n(e,ye,t),n(e,At,t),f(we,e,t),n(e,Dt,t),n(e,Me,t),n(e,Kt,t),f(ve,e,t),n(e,Ot,t),n(e,be,t),n(e,es,t),n(e,Te,t),n(e,ts,t),n(e,x,t),n(e,ss,t),f(ge,e,t),n(e,ns,t),n(e,$e,t),n(e,ls,t),n(e,Ce,t),n(e,as,t),n(e,ke,t),n(e,is,t),n(e,xe,t),n(e,os,t),n(e,Je,t),n(e,rs,t),n(e,Ue,t),n(e,ps,t),n(e,_e,t),n(e,cs,t),n(e,Ie,t),n(e,ds,t),n(e,je,t),n(e,us,t),n(e,Ze,t),n(e,ms,t),f(He,e,t),n(e,hs,t),n(e,Ge,t),n(e,fs,t),f(Be,e,t),n(e,ys,t),n(e,H,t),n(e,ws,t),n(e,Ve,t),n(e,Ms,t),f(Se,e,t),n(e,vs,t),n(e,G,t),n(e,bs,t),n(e,We,t),n(e,Ts,t),f(ze,e,t),n(e,gs,t),n(e,B,t),n(e,$s,t),n(e,Re,t),n(e,Cs,t),f(Xe,e,t),n(e,ks,t),n(e,V,t),n(e,xs,t),n(e,Ne,t),n(e,Js,t),n(e,Le,t),n(e,Us,t),f(Qe,e,t),n(e,_s,t),n(e,Fe,t),n(e,Is,t),n(e,Ee,t),n(e,js,t),f(qe,e,t),n(e,Zs,t),n(e,S,t),n(e,Hs,t),n(e,Ye,t),n(e,Gs,t),f(Pe,e,t),n(e,Bs,t),n(e,W,t),n(e,Vs,t),n(e,Ae,t),n(e,Ss,t),f(De,e,t),n(e,Ws,t),n(e,z,t),n(e,zs,t),f(R,e,t),n(e,Rs,t),f(Ke,e,t),n(e,Xs,t),n(e,Oe,t),n(e,Ns,t),n(e,et,t),n(e,Ls,t),n(e,tt,t),n(e,Qs,t),f(X,e,t),n(e,Fs,t),n(e,st,t),n(e,Es,t),f(nt,e,t),n(e,qs,t),n(e,lt,t),n(e,Ys,t),n(e,at,t),n(e,Ps,t),f(it,e,t),n(e,As,t),n(e,ot,t),n(e,Ds,t),f(rt,e,t),n(e,Ks,t),n(e,pt,t),n(e,Os,t),f(ct,e,t),n(e,en,t),n(e,dt,t),n(e,tn,t),n(e,ut,t),n(e,sn,t),f(mt,e,t),n(e,nn,t),n(e,ht,t),ln=!0},p(e,[t]){const vl={};t&2&&(vl.$$scope={dirty:t,ctx:e}),_.$set(vl);const bl={};t&2&&(bl.$$scope={dirty:t,ctx:e}),j.$set(bl);const Tl={};t&2&&(Tl.$$scope={dirty:t,ctx:e}),Z.$set(Tl);const gl={};t&2&&(gl.$$scope={dirty:t,ctx:e}),R.$set(gl);const $l={};t&2&&($l.$$scope={dirty:t,ctx:e}),X.$set($l)},i(e){ln||(y(g.$$.fragment,e),y(b.$$.fragment,e),y(L.$$.fragment,e),y(_.$$.fragment,e),y(ne.$$.fragment,e),y(ae.$$.fragment,e),y(j.$$.fragment,e),y(re.$$.fragment,e),y(de.$$.fragment,e),y(Z.$$.fragment,e),y(fe.$$.fragment,e),y(we.$$.fragment,e),y(ve.$$.fragment,e),y(ge.$$.fragment,e),y(He.$$.fragment,e),y(Be.$$.fragment,e),y(Se.$$.fragment,e),y(ze.$$.fragment,e),y(Xe.$$.fragment,e),y(Qe.$$.fragment,e),y(qe.$$.fragment,e),y(Pe.$$.fragment,e),y(De.$$.fragment,e),y(R.$$.fragment,e),y(Ke.$$.fragment,e),y(X.$$.fragment,e),y(nt.$$.fragment,e),y(it.$$.fragment,e),y(rt.$$.fragment,e),y(ct.$$.fragment,e),y(mt.$$.fragment,e),ln=!0)},o(e){w(g.$$.fragment,e),w(b.$$.fragment,e),w(L.$$.fragment,e),w(_.$$.fragment,e),w(ne.$$.fragment,e),w(ae.$$.fragment,e),w(j.$$.fragment,e),w(re.$$.fragment,e),w(de.$$.fragment,e),w(Z.$$.fragment,e),w(fe.$$.fragment,e),w(we.$$.fragment,e),w(ve.$$.fragment,e),w(ge.$$.fragment,e),w(He.$$.fragment,e),w(Be.$$.fragment,e),w(Se.$$.fragment,e),w(ze.$$.fragment,e),w(Xe.$$.fragment,e),w(Qe.$$.fragment,e),w(qe.$$.fragment,e),w(Pe.$$.fragment,e),w(De.$$.fragment,e),w(R.$$.fragment,e),w(Ke.$$.fragment,e),w(X.$$.fragment,e),w(nt.$$.fragment,e),w(it.$$.fragment,e),w(rt.$$.fragment,e),w(ct.$$.fragment,e),w(mt.$$.fragment,e),ln=!1},d(e){e&&(s(v),s(u),s(c),s($),s(J),s(d),s(wt),s(Mt),s(Q),s(vt),s(F),s(bt),s(E),s(Tt),s(q),s(gt),s(U),s($t),s(Y),s(Ct),s(P),s(kt),s(A),s(xt),s(Jt),s(D),s(Ut),s(K),s(_t),s(O),s(It),s(I),s(jt),s(ee),s(Zt),s(te),s(Ht),s(se),s(Gt),s(Bt),s(le),s(Vt),s(St),s(ie),s(Wt),s(zt),s(oe),s(Rt),s(Xt),s(pe),s(Nt),s(ce),s(Lt),s(Qt),s(ue),s(Ft),s(me),s(Et),s(qt),s(he),s(Yt),s(Pt),s(ye),s(At),s(Dt),s(Me),s(Kt),s(Ot),s(be),s(es),s(Te),s(ts),s(x),s(ss),s(ns),s($e),s(ls),s(Ce),s(as),s(ke),s(is),s(xe),s(os),s(Je),s(rs),s(Ue),s(ps),s(_e),s(cs),s(Ie),s(ds),s(je),s(us),s(Ze),s(ms),s(hs),s(Ge),s(fs),s(ys),s(H),s(ws),s(Ve),s(Ms),s(vs),s(G),s(bs),s(We),s(Ts),s(gs),s(B),s($s),s(Re),s(Cs),s(ks),s(V),s(xs),s(Ne),s(Js),s(Le),s(Us),s(_s),s(Fe),s(Is),s(Ee),s(js),s(Zs),s(S),s(Hs),s(Ye),s(Gs),s(Bs),s(W),s(Vs),s(Ae),s(Ss),s(Ws),s(z),s(zs),s(Rs),s(Xs),s(Oe),s(Ns),s(et),s(Ls),s(tt),s(Qs),s(Fs),s(st),s(Es),s(qs),s(lt),s(Ys),s(at),s(Ps),s(As),s(ot),s(Ds),s(Ks),s(pt),s(Os),s(en),s(dt),s(tn),s(ut),s(sn),s(nn),s(ht)),s(p),M(g,e),M(b,e),M(L,e),M(_,e),M(ne,e),M(ae,e),M(j,e),M(re,e),M(de,e),M(Z,e),M(fe,e),M(we,e),M(ve,e),M(ge,e),M(He,e),M(Be,e),M(Se,e),M(ze,e),M(Xe,e),M(Qe,e),M(qe,e),M(Pe,e),M(De,e),M(R,e),M(Ke,e),M(X,e),M(nt,e),M(it,e),M(rt,e),M(ct,e),M(mt,e)}}}const Nl='{"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 Ll(k){return Jl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pl extends Ul{constructor(p){super(),_l(this,p,Ll,Xl,kl,{})}}export{Pl as component};
