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