import{s as yn,o as hn,n as un}from"../chunks/scheduler.cd324960.js";import{S as wn,i as dn,e as p,s as a,c as M,h as Jn,a as i,d as l,b as n,f as mn,g as o,j as r,k as ea,l as Tn,m as s,n as c,t as m,o as y,p as h}from"../chunks/index.d5c3adcc.js";import{T as fn}from"../chunks/Tip.889bec11.js";import{C as Un,H as J,E as jn}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.481f2bec.js";import{C as u}from"../chunks/CodeBlock.a252a8e7.js";function bn(Yt){let w,j=`In our example we will be using approximately 40 hours of training data. If you’d like to follow along using the Google Colab free tier GPU,
you will need to reduce the amount of training data to approximately 10-15 hours, and reduce the number of training steps.`;return{c(){w=p("p"),w.textContent=j},l(d){w=i(d,"P",{"data-svelte-h":!0}),r(w)!=="svelte-jn3a6r"&&(w.textContent=j)},m(d,_t){s(d,w,_t)},p:un,d(d){d&&l(w)}}}function In(Yt){let w,j,d,_t,b,Rt,I,Xt,C,ta=`Now that you are familiar with the text-to-speech task and internal workings of the SpeechT5 model that was pre-trained
on English language data, let’s see how we can fine-tune it to another language.`,Qt,g,Nt,$,la="Make sure that you have a GPU if you want to reproduce this example. In a notebook, you can check with the following command:",At,k,Ft,T,Et,x,sa="You’ll also need some additional dependencies:",zt,Z,Ht,v,aa="Finally, don’t forget to log in to your Hugging Face account so that you could upload and share your model with the community:",qt,V,St,B,Dt,G,na=`For this example we’ll take the Dutch (<code>nl</code>) language subset of the <a href="https://huggingface.co/datasets/qmeeus/voxpopuli" rel="nofollow">VoxPopuli</a> dataset.
<a href="https://huggingface.co/datasets/qmeeus/voxpopuli" rel="nofollow">VoxPopuli</a> is a large-scale multilingual speech corpus consisting of
data sourced from 2009-2020 European Parliament event recordings. It contains labelled audio-transcription data for 15
European languages. While we will be using the Dutch language subset, feel free to pick another subset.`,Lt,_,pa=`This is an automated speech recognition (ASR) dataset, so, as mentioned before, it is not the most suitable
option for training TTS models. However, it will be good enough for this exercise.`,Pt,W,ia="Let’s load the data:",Kt,Y,Ot,R,ra="<strong>Output:</strong>",el,X,tl,Q,Ma=`20968 examples should be sufficient for fine-tuning. SpeechT5 expects audio data to have a sampling rate of 16 kHz, so
make sure the examples in the dataset meet this requirement:`,ll,N,sl,A,al,F,oa=`Let’s begin by defining the model checkpoint to use and loading the appropriate processor that contains both tokenizer,
and feature extractor that we will need to prepare the data for training:`,nl,E,pl,z,il,H,ca="First, for preparing the text, we’ll need the tokenizer part of the processor, so let’s get it:",rl,q,Ml,S,ma="Let’s take a look at an example:",ol,D,cl,L,ya="<strong>Output:</strong>",ml,P,yl,K,ha=`The dataset examples contain a <code>text</code> feature which we’ll use as the text input. It’s important to know that the SpeechT5
tokenizer doesn’t have any tokens for numbers, so if your text contains numbers, you may need to write them out as text.`,hl,O,ua=`Because SpeechT5 was trained on the English language, it may not recognize certain characters in the Dutch dataset. If
left as is, these characters will be converted to <code>&lt;unk&gt;</code> tokens. However, in Dutch, certain characters like <code>à</code> are
used to stress syllables. In order to preserve the meaning of the text, we can replace this character with a regular <code>a</code>.`,ul,ee,wa=`To identify unsupported tokens, extract all unique characters in the dataset using the <code>SpeechT5Tokenizer</code> which
works with characters as tokens. To do this, we’ll write the <code>extract_all_chars</code> mapping function that concatenates
the transcriptions from all examples into one string and converts it to a set of characters.
Make sure to set <code>batched=True</code> and <code>batch_size=-1</code> in <code>dataset.map()</code> so that all transcriptions are available at once for
the mapping function.`,wl,te,dl,le,da=`Now you have two sets of characters: one with the vocabulary from the dataset and one with the vocabulary from the tokenizer.
To identify any unsupported characters in the dataset, you can take the difference between these two sets. The resulting
set will contain the characters that are in the dataset but not in the tokenizer.`,Jl,se,Tl,ae,Ja="<strong>Output:</strong>",fl,ne,Ul,pe,Ta=`To handle the unsupported characters identified in the previous step, we can define a function that maps these characters to
valid tokens. Note that spaces are already replaced by <code>▁</code> in the tokenizer and don’t need to be handled separately.`,jl,ie,bl,re,fa="Now that we have dealt with special characters in the text, it’s time to shift the focus to the audio data.",Il,Me,Cl,oe,Ua=`The VoxPopuli dataset includes speech from multiple speakers, but how many speakers are represented in the dataset? To
determine this, we can count the number of unique speakers and the number of examples each speaker contributes to the dataset.
With a total of 20,968 examples in the dataset, this information will give us a better understanding of the distribution of
speakers and examples in the data.`,gl,ce,$l,me,ja="By plotting a histogram you can get a sense of how much data there is for each speaker.",kl,ye,xl,f,ba='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/tts_speakers_histogram.png" alt="Speakers histogram"/>',Zl,he,Ia=`The histogram reveals that approximately one-third of the speakers in the dataset have fewer than 100 examples, while
around ten speakers have more than 500 examples. To improve training efficiency and balance the dataset, we can limit
the data to speakers with between 100 and 400 examples.`,vl,ue,Vl,we,Ca="Let’s check how many speakers remain:",Bl,de,Gl,Je,ga="<strong>Output:</strong>",_l,Te,Wl,fe,$a="Let’s see how many examples are left:",Yl,Ue,Rl,je,ka="<strong>Output:</strong>",Xl,be,Ql,Ie,xa="You are left with just under 10,000 examples from approximately 40 unique speakers, which should be sufficient.",Nl,Ce,Za=`Note that some speakers with few examples may actually have more audio available if the examples are long. However,
determining the total amount of audio for each speaker requires scanning through the entire dataset, which is a
time-consuming process that involves loading and decoding each audio file. As such, we have chosen to skip this step here.`,Al,ge,Fl,$e,va=`To enable the TTS model to differentiate between multiple speakers, you’ll need to create a speaker embedding for each example.
The speaker embedding is an additional input into the model that captures a particular speaker’s voice characteristics.
To generate these speaker embeddings, use the pre-trained <a href="https://huggingface.co/speechbrain/spkrec-xvect-voxceleb" rel="nofollow">spkrec-xvect-voxceleb</a>
model from SpeechBrain.`,El,ke,Va=`Create a function <code>create_speaker_embedding()</code> that takes an input audio waveform and outputs a 512-element vector
containing the corresponding speaker embedding.`,zl,xe,Hl,Ze,Ba=`It’s important to note that the <code>speechbrain/spkrec-xvect-voxceleb</code> model was trained on English speech from the VoxCeleb
dataset, whereas the training examples in this guide are in Dutch. While we believe that this model will still generate
reasonable speaker embeddings for our Dutch dataset, this assumption may not hold true in all cases.`,ql,ve,Ga=`For optimal results, we would need to train an X-vector model on the target speech first. This will ensure that the model
is better able to capture the unique voice characteristics present in the Dutch language. If you’d like to train your own
X-vector model, you can use <a href="https://huggingface.co/mechanicalsea/speecht5-vc/blob/main/manifest/utils/prep_cmu_arctic_spkemb.py" rel="nofollow">this script</a>
as an example.`,Sl,Ve,Dl,Be,_a=`Finally, let’s process the data into the format the model expects. Create a <code>prepare_dataset</code> function that takes in a
single example and uses the <code>SpeechT5Processor</code> object to tokenize the input text and load the target audio into a log-mel spectrogram.
It should also add the speaker embeddings as an additional input.`,Ll,Ge,Pl,_e,Wa="Verify the processing is correct by looking at a single example:",Kl,We,Ol,Ye,Ya="<strong>Output:</strong>",es,Re,ts,Xe,Ra="Speaker embeddings should be a 512-element vector:",ls,Qe,ss,Ne,Xa="<strong>Output:</strong>",as,Ae,ns,Fe,Qa="The labels should be a log-mel spectrogram with 80 mel bins.",ps,Ee,is,U,Na='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/tts_logmelspectrogram_1.png" alt="Log-mel spectrogram with 80 mel bins"/>',rs,ze,Aa=`Side note: If you find this spectrogram confusing, it may be due to your familiarity with the convention of placing low frequencies
at the bottom and high frequencies at the top of a plot. However, when plotting spectrograms as an image using the matplotlib library,
the y-axis is flipped and the spectrograms appear upside down.`,Ms,He,Fa="Now we need to apply the processing function to the entire dataset. This will take between 5 and 10 minutes.",os,qe,cs,Se,Ea=`You’ll see a warning saying that some examples in the dataset are longer than the maximum input length the model can handle (600 tokens).
Remove those examples from the dataset. Here we go even further and to allow for larger batch sizes we remove anything over 200 tokens.`,ms,De,ys,Le,za="<strong>Output:</strong>",hs,Pe,us,Ke,Ha="Next, create a basic train/test split:",ws,Oe,ds,et,Js,tt,qa=`In order to combine multiple examples into a batch, you need to define a custom data collator. This collator will pad shorter sequences with padding
tokens, ensuring that all examples have the same length. For the spectrogram labels, the padded portions are replaced with
the special value <code>-100</code>. This special value instructs the model to ignore that part of the spectrogram when calculating the spectrogram loss.`,Ts,lt,fs,st,Sa=`In SpeechT5, the input to the decoder part of the model is reduced by a factor 2. In other words, it throws away every
other timestep from the target sequence. The decoder then predicts a sequence that is twice as long. Since the original
target sequence length may be odd, the data collator makes sure to round the maximum length of the batch down to be a
multiple of 2.`,Us,at,js,nt,bs,pt,Da="Load the pre-trained model from the same checkpoint as you used for loading the processor:",Is,it,Cs,rt,La=`The <code>use_cache=True</code> option is incompatible with gradient checkpointing. Disable it for training, and re-enable cache for
generation to speed-up inference time:`,gs,Mt,$s,ot,Pa=`Define the training arguments. Here we are not computing any evaluation metrics during the training process,
we’ll talk about evaluation later in this chapter. Instead, we’ll only look at the loss:`,ks,ct,xs,mt,Ka="Instantiate the <code>Trainer</code> object  and pass the model, dataset, and data collator to it.",Zs,yt,vs,ht,Oa=`And with that, we’re ready to start training! Training will take several hours. Depending on your GPU,
it is possible that you will encounter a CUDA “out-of-memory” error when you start training. In this case, you can reduce
the <code>per_device_train_batch_size</code> incrementally by factors of 2 and increase <code>gradient_accumulation_steps</code> by 2x to compensate.`,Vs,ut,Bs,wt,en="Push the final model to the 🤗 Hub:",Gs,dt,_s,Jt,Ws,Tt,tn=`Once you have fine-tuned a model, you can use it for inference! Load the model from the 🤗 Hub (make sure to use your
account name in the following code snippet):`,Ys,ft,Rs,Ut,ln="Pick an example, here we’ll take one from the test dataset. Obtain a speaker embedding.",Xs,jt,Qs,bt,sn="Define some input text and tokenize it.",Ns,It,As,Ct,an="Preprocess the input text:",Fs,gt,Es,$t,nn="Instantiate a vocoder and generate speech:",zs,kt,Hs,xt,pn="Ready to listen to the result?",qs,Zt,Ss,vt,rn=`Obtaining satisfactory results from this model on a new language can be challenging. The quality of the speaker
embeddings can be a significant factor. Since SpeechT5 was pre-trained with English x-vectors, it performs best
when using English speaker embeddings. If the synthesized speech sounds poor, try using a different speaker embedding.`,Ds,Vt,Mn=`Increasing the training duration is also likely to enhance the quality of the results. Even so, the speech clearly is Dutch instead of English, and it does
capture the voice characteristics of the speaker (compare to the original audio in the example).
Another thing to experiment with is the model’s configuration. For example, try using <code>config.reduction_factor = 1</code> to
see if this improves the results.`,Ls,Bt,on="In the next section, we’ll talk about how we evaluate text-to-speech models.",Ps,Gt,Ks,Wt,Os;return b=new Un({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),I=new J({props:{title:"Fine-tuning SpeechT5",local:"fine-tuning-speecht5",headingTag:"h1"}}),g=new J({props:{title:"House-keeping",local:"house-keeping",headingTag:"h2"}}),k=new u({props:{code:"bnZpZGlhLXNtaQ==",highlighted:"nvidia-smi",wrap:!1}}),T=new fn({props:{warning:!0,$$slots:{default:[bn]},$$scope:{ctx:Yt}}}),Z=new u({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwc291bmRmaWxlJTIwc3BlZWNoYnJhaW4lMjBhY2NlbGVyYXRl",highlighted:"pip install transformers datasets soundfile speechbrain accelerate",wrap:!1}}),V=new u({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

notebook_login()`,wrap:!1}}),B=new J({props:{title:"The dataset",local:"the-dataset",headingTag:"h2"}}),Y=new u({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTJDJTIwQXVkaW8lMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMnFtZWV1cyUyRnZveHBvcHVsaSUyMiUyQyUyMCUyMm5sJTIyJTJDJTIwc3BsaXQlM0QlMjJ0cmFpbiUyMiklMEFsZW4oZGF0YXNldCk=",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset, Audio

dataset = load_dataset(<span class="hljs-string">&quot;qmeeus/voxpopuli&quot;</span>, <span class="hljs-string">&quot;nl&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)
<span class="hljs-built_in">len</span>(dataset)`,wrap:!1}}),X=new u({props:{code:"MjA5Njg=",highlighted:"20968",wrap:!1}}),N=new u({props:{code:"ZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQuY2FzdF9jb2x1bW4oJTIyYXVkaW8lMjIlMkMlMjBBdWRpbyhzYW1wbGluZ19yYXRlJTNEMTYwMDApKQ==",highlighted:'dataset = dataset.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=<span class="hljs-number">16000</span>))',wrap:!1}}),A=new J({props:{title:"Preprocessing the data",local:"preprocessing-the-data",headingTag:"h2"}}),E=new u({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNwZWVjaFQ1UHJvY2Vzc29yJTBBJTBBY2hlY2twb2ludCUyMCUzRCUyMCUyMm1pY3Jvc29mdCUyRnNwZWVjaHQ1X3R0cyUyMiUwQXByb2Nlc3NvciUyMCUzRCUyMFNwZWVjaFQ1UHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SpeechT5Processor

checkpoint = <span class="hljs-string">&quot;microsoft/speecht5_tts&quot;</span>
processor = SpeechT5Processor.from_pretrained(checkpoint)`,wrap:!1}}),z=new J({props:{title:"Text cleanup for SpeechT5 tokenization",local:"text-cleanup-for-speecht5-tokenization",headingTag:"h3"}}),q=new u({props:{code:"dG9rZW5pemVyJTIwJTNEJTIwcHJvY2Vzc29yLnRva2VuaXplcg==",highlighted:"tokenizer = processor.tokenizer",wrap:!1}}),D=new u({props:{code:"ZGF0YXNldCU1QjAlNUQ=",highlighted:'dataset[<span class="hljs-number">0</span>]',wrap:!1}}),P=new u({props:{code:"JTdCJ2F1ZGlvX2lkJyUzQSUyMCcyMDEwMDIxMC0wOTA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HJ1ZSUyQyUwQSUyMCdhY2NlbnQnJTNBJTIwJ05vbmUnJTdE",highlighted:`{&#x27;audio_id&#x27;: &#x27;<span class="hljs-number">20100210-0900</span>-PLENARY-3-nl_<span class="hljs-number">20100210-09:06:43</span>_4&#x27;,
 &#x27;language&#x27;: <span class="hljs-number">9</span>,
 &#x27;audio&#x27;: {&#x27;path&#x27;: &#x27;/root/.cache/huggingface/datasets/downloads/extracted/02ec6a19d5b97c03e<span class="hljs-number">137925037845</span>4dbf3fa<span class="hljs-number">2972943504</span>a91c7da<span class="hljs-number">5045</span>aa26a89/train_part_0/<span class="hljs-number">20100210-0900</span>-PLENARY-3-nl_<span class="hljs-number">20100210-09:06:43</span>_4.wav&#x27;,
  &#x27;array&#x27;: array([ <span class="hljs-number">4.27246094</span>e-<span class="hljs-number">04</span>,  <span class="hljs-number">1.31225586</span>e-<span class="hljs-number">03</span>,  <span class="hljs-number">1.03759766</span>e-<span class="hljs-number">03</span>, ...,
         -<span class="hljs-number">9.15527344</span>e-<span class="hljs-number">05</span>,  <span class="hljs-number">7.62939453</span>e-<span class="hljs-number">04</span>, -<span class="hljs-number">2.44140625</span>e-<span class="hljs-number">04</span>]),
  &#x27;sampling_rate&#x27;: <span class="hljs-number">16000</span>},
 &#x27;text&#x27;: &#x27;dat kan naar mijn gevoel alleen met een brede meerderheid die wij samen zoeken.&#x27;,
 &#x27;gender&#x27;: &#x27;female&#x27;,
 &#x27;speaker_id&#x27;: &#x27;<span class="hljs-number">1122</span>&#x27;,
 &#x27;is_gold_transcript&#x27;: True,
 &#x27;accent&#x27;: &#x27;None&#x27;}`,wrap:!1}}),te=new u({props:{code:"ZGVmJTIwZXh0cmFjdF9hbGxfY2hhcnMoYmF0Y2gpJTNBJTBBJTIwJTIwJTIwJTIwYWxsX3RleHQlMjAlM0QlMjAlMjIlMjAlMjIuam9pbihiYXRjaCU1QiUyMnRleHQlMjIlNUQpJTBBJTIwJTIwJTIwJTIwdm9jYWIlMjAlM0QlMjBsaXN0KHNldChhbGxfdGV4dCkpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCJTIydm9jYWIlMjIlM0ElMjAlNUJ2b2NhYiU1RCUyQyUyMCUyMmFsbF90ZXh0JTIyJTNBJTIwJTVCYWxsX3RleHQlNUQlN0QlMEElMEElMEF2b2NhYnMlMjAlM0QlMjBkYXRhc2V0Lm1hcCglMEElMjAlMjAlMjAlMjBleHRyYWN0X2FsbF9jaGFycyUyQyUwQSUyMCUyMCUyMCUyMGJhdGNoZWQlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwYmF0Y2hfc2l6ZSUzRC0xJTJDJTBBJTIwJTIwJTIwJTIwa2VlcF9pbl9tZW1vcnklM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwcmVtb3ZlX2NvbHVtbnMlM0RkYXRhc2V0LmNvbHVtbl9uYW1lcyUyQyUwQSklMEElMEFkYXRhc2V0X3ZvY2FiJTIwJTNEJTIwc2V0KHZvY2FicyU1QiUyMnZvY2FiJTIyJTVEJTVCMCU1RCklMEF0b2tlbml6ZXJfdm9jYWIlMjAlM0QlMjAlN0JrJTIwZm9yJTIwayUyQyUyMF8lMjBpbiUyMHRva2VuaXplci5nZXRfdm9jYWIoKS5pdGVtcygpJTdE",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">extract_all_chars</span>(<span class="hljs-params">batch</span>):
    all_text = <span class="hljs-string">&quot; &quot;</span>.join(batch[<span class="hljs-string">&quot;text&quot;</span>])
    vocab = <span class="hljs-built_in">list</span>(<span class="hljs-built_in">set</span>(all_text))
    <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;vocab&quot;</span>: [vocab], <span class="hljs-string">&quot;all_text&quot;</span>: [all_text]}


vocabs = dataset.<span class="hljs-built_in">map</span>(
    extract_all_chars,
    batched=<span class="hljs-literal">True</span>,
    batch_size=-<span class="hljs-number">1</span>,
    keep_in_memory=<span class="hljs-literal">True</span>,
    remove_columns=dataset.column_names,
)

dataset_vocab = <span class="hljs-built_in">set</span>(vocabs[<span class="hljs-string">&quot;vocab&quot;</span>][<span class="hljs-number">0</span>])
tokenizer_vocab = {k <span class="hljs-keyword">for</span> k, _ <span class="hljs-keyword">in</span> tokenizer.get_vocab().items()}`,wrap:!1}}),se=new u({props:{code:"ZGF0YXNldF92b2NhYiUyMC0lMjB0b2tlbml6ZXJfdm9jYWI=",highlighted:"dataset_vocab - tokenizer_vocab",wrap:!1}}),ne=new u({props:{code:"JTdCJyUyMCclMkMlMjAnJUMzJUEwJyUyQyUyMCclQzMlQTcnJTJDJTIwJyVDMyVBOCclMkMlMjAnJUMzJUFCJyUyQyUyMCclQzMlQUQnJTJDJTIwJyVDMyVBRiclMkMlMjAnJUMzJUI2JyUyQyUyMCclQzMlQkMnJTdE",highlighted:"{&#x27; &#x27;, &#x27;à&#x27;, &#x27;ç&#x27;, &#x27;è&#x27;, &#x27;ë&#x27;, &#x27;í&#x27;, &#x27;ï&#x27;, &#x27;ö&#x27;, &#x27;ü&#x27;}",wrap:!1}}),ie=new u({props:{code:"cmVwbGFjZW1lbnRzJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwKCUyMiVDMyVBMCUyMiUyQyUyMCUyMmElMjIpJTJDJTBBJTIwJTIwJTIwJTIwKCUyMiVDMyVBNyUyMiUyQyUyMCUyMmMlMjIpJTJDJTBBJTIwJTIwJTIwJTIwKCUyMiVDMyVBOCUyMiUyQyUyMCUyMmUlMjIpJTJDJTBBJTIwJTIwJTIwJTIwKCUyMiVDMyVBQiUyMiUyQyUyMCUyMmUlMjIpJTJDJTBBJTIwJTIwJTIwJTIwKCUyMiVDMyVBRCUyMiUyQyUyMCUyMmklMjIpJTJDJTBBJTIwJTIwJTIwJTIwKCUyMiVDMyVBRiUyMiUyQyUyMCUyMmklMjIpJTJDJTBBJTIwJTIwJTIwJTIwKCUyMiVDMyVCNiUyMiUyQyUyMCUyMm8lMjIpJTJDJTBBJTIwJTIwJTIwJTIwKCUyMiVDMyVCQyUyMiUyQyUyMCUyMnUlMjIpJTJDJTBBJTVEJTBBJTBBJTBBZGVmJTIwY2xlYW51cF90ZXh0KGlucHV0cyklM0ElMEElMjAlMjAlMjAlMjBmb3IlMjBzcmMlMkMlMjBkc3QlMjBpbiUyMHJlcGxhY2VtZW50cyUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGlucHV0cyU1QiUyMnRleHQlMjIlNUQlMjAlM0QlMjBpbnB1dHMlNUIlMjJ0ZXh0JTIyJTVELnJlcGxhY2Uoc3JjJTJDJTIwZHN0KSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMGlucHV0cyUwQSUwQSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0Lm1hcChjbGVhbnVwX3RleHQp",highlighted:`replacements = [
    (<span class="hljs-string">&quot;à&quot;</span>, <span class="hljs-string">&quot;a&quot;</span>),
    (<span class="hljs-string">&quot;ç&quot;</span>, <span class="hljs-string">&quot;c&quot;</span>),
    (<span class="hljs-string">&quot;è&quot;</span>, <span class="hljs-string">&quot;e&quot;</span>),
    (<span class="hljs-string">&quot;ë&quot;</span>, <span class="hljs-string">&quot;e&quot;</span>),
    (<span class="hljs-string">&quot;í&quot;</span>, <span class="hljs-string">&quot;i&quot;</span>),
    (<span class="hljs-string">&quot;ï&quot;</span>, <span class="hljs-string">&quot;i&quot;</span>),
    (<span class="hljs-string">&quot;ö&quot;</span>, <span class="hljs-string">&quot;o&quot;</span>),
    (<span class="hljs-string">&quot;ü&quot;</span>, <span class="hljs-string">&quot;u&quot;</span>),
]


<span class="hljs-keyword">def</span> <span class="hljs-title function_">cleanup_text</span>(<span class="hljs-params">inputs</span>):
    <span class="hljs-keyword">for</span> src, dst <span class="hljs-keyword">in</span> replacements:
        inputs[<span class="hljs-string">&quot;text&quot;</span>] = inputs[<span class="hljs-string">&quot;text&quot;</span>].replace(src, dst)
    <span class="hljs-keyword">return</span> inputs


dataset = dataset.<span class="hljs-built_in">map</span>(cleanup_text)`,wrap:!1}}),Me=new J({props:{title:"Speakers",local:"speakers",headingTag:"h3"}}),ce=new u({props:{code:"ZnJvbSUyMGNvbGxlY3Rpb25zJTIwaW1wb3J0JTIwZGVmYXVsdGRpY3QlMEElMEFzcGVha2VyX2NvdW50cyUyMCUzRCUyMGRlZmF1bHRkaWN0KGludCklMEElMEFmb3IlMjBzcGVha2VyX2lkJTIwaW4lMjBkYXRhc2V0JTVCJTIyc3BlYWtlcl9pZCUyMiU1RCUzQSUwQSUyMCUyMCUyMCUyMHNwZWFrZXJfY291bnRzJTVCc3BlYWtlcl9pZCU1RCUyMCUyQiUzRCUyMDE=",highlighted:`<span class="hljs-keyword">from</span> collections <span class="hljs-keyword">import</span> defaultdict

speaker_counts = defaultdict(<span class="hljs-built_in">int</span>)

<span class="hljs-keyword">for</span> speaker_id <span class="hljs-keyword">in</span> dataset[<span class="hljs-string">&quot;speaker_id&quot;</span>]:
    speaker_counts[speaker_id] += <span class="hljs-number">1</span>`,wrap:!1}}),ye=new u({props:{code:"aW1wb3J0JTIwbWF0cGxvdGxpYi5weXBsb3QlMjBhcyUyMHBsdCUwQSUwQXBsdC5maWd1cmUoKSUwQXBsdC5oaXN0KHNwZWFrZXJfY291bnRzLnZhbHVlcygpJTJDJTIwYmlucyUzRDIwKSUwQXBsdC55bGFiZWwoJTIyU3BlYWtlcnMlMjIpJTBBcGx0LnhsYWJlbCglMjJFeGFtcGxlcyUyMiklMEFwbHQuc2hvdygp",highlighted:`<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt

plt.figure()
plt.hist(speaker_counts.values(), bins=<span class="hljs-number">20</span>)
plt.ylabel(<span class="hljs-string">&quot;Speakers&quot;</span>)
plt.xlabel(<span class="hljs-string">&quot;Examples&quot;</span>)
plt.show()`,wrap:!1}}),ue=new u({props:{code:"ZGVmJTIwc2VsZWN0X3NwZWFrZXIoc3BlYWtlcl9pZCklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjAxMDAlMjAlM0MlM0QlMjBzcGVha2VyX2NvdW50cyU1QnNwZWFrZXJfaWQlNUQlMjAlM0MlM0QlMjA0MDAlMEElMEElMEFkYXRhc2V0JTIwJTNEJTIwZGF0YXNldC5maWx0ZXIoc2VsZWN0X3NwZWFrZXIlMkMlMjBpbnB1dF9jb2x1bW5zJTNEJTVCJTIyc3BlYWtlcl9pZCUyMiU1RCk=",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">select_speaker</span>(<span class="hljs-params">speaker_id</span>):
    <span class="hljs-keyword">return</span> <span class="hljs-number">100</span> &lt;= speaker_counts[speaker_id] &lt;= <span class="hljs-number">400</span>


dataset = dataset.<span class="hljs-built_in">filter</span>(select_speaker, input_columns=[<span class="hljs-string">&quot;speaker_id&quot;</span>])`,wrap:!1}}),de=new u({props:{code:"bGVuKHNldChkYXRhc2V0JTVCJTIyc3BlYWtlcl9pZCUyMiU1RCkp",highlighted:'<span class="hljs-built_in">len</span>(<span class="hljs-built_in">set</span>(dataset[<span class="hljs-string">&quot;speaker_id&quot;</span>]))',wrap:!1}}),Te=new u({props:{code:"NDI=",highlighted:"42",wrap:!1}}),Ue=new u({props:{code:"bGVuKGRhdGFzZXQp",highlighted:'<span class="hljs-built_in">len</span>(dataset)',wrap:!1}}),be=new u({props:{code:"OTk3Mw==",highlighted:'<span class="hljs-number">9973</span>',wrap:!1}}),ge=new J({props:{title:"Speaker embeddings",local:"speaker-embeddings",headingTag:"h3"}}),xe=new u({props:{code:"aW1wb3J0JTIwb3MlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBzcGVlY2hicmFpbi5wcmV0cmFpbmVkJTIwaW1wb3J0JTIwRW5jb2RlckNsYXNzaWZpZXIlMEElMEFzcGtfbW9kZWxfbmFtZSUyMCUzRCUyMCUyMnNwZWVjaGJyYWluJTJGc3BrcmVjLXh2ZWN0LXZveGNlbGViJTIyJTBBJTBBZGV2aWNlJTIwJTNEJTIwJTIyY3VkYSUyMiUyMGlmJTIwdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSUyMGVsc2UlMjAlMjJjcHUlMjIlMEFzcGVha2VyX21vZGVsJTIwJTNEJTIwRW5jb2RlckNsYXNzaWZpZXIuZnJvbV9ocGFyYW1zKCUwQSUyMCUyMCUyMCUyMHNvdXJjZSUzRHNwa19tb2RlbF9uYW1lJTJDJTBBJTIwJTIwJTIwJTIwcnVuX29wdHMlM0QlN0IlMjJkZXZpY2UlMjIlM0ElMjBkZXZpY2UlN0QlMkMlMEElMjAlMjAlMjAlMjBzYXZlZGlyJTNEb3MucGF0aC5qb2luKCUyMiUyRnRtcCUyMiUyQyUyMHNwa19tb2RlbF9uYW1lKSUyQyUwQSklMEElMEElMEFkZWYlMjBjcmVhdGVfc3BlYWtlcl9lbWJlZGRpbmcod2F2ZWZvcm0pJTNBJTBBJTIwJTIwJTIwJTIwd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNwZWFrZXJfZW1iZWRkaW5ncyUyMCUzRCUyMHNwZWFrZXJfbW9kZWwuZW5jb2RlX2JhdGNoKHRvcmNoLnRlbnNvcih3YXZlZm9ybSkpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc3BlYWtlcl9lbWJlZGRpbmdzJTIwJTNEJTIwdG9yY2gubm4uZnVuY3Rpb25hbC5ub3JtYWxpemUoc3BlYWtlcl9lbWJlZGRpbmdzJTJDJTIwZGltJTNEMiklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzcGVha2VyX2VtYmVkZGluZ3MlMjAlM0QlMjBzcGVha2VyX2VtYmVkZGluZ3Muc3F1ZWV6ZSgpLmNwdSgpLm51bXB5KCklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBzcGVha2VyX2VtYmVkZGluZ3M=",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> speechbrain.pretrained <span class="hljs-keyword">import</span> EncoderClassifier

spk_model_name = <span class="hljs-string">&quot;speechbrain/spkrec-xvect-voxceleb&quot;</span>

device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>
speaker_model = EncoderClassifier.from_hparams(
    source=spk_model_name,
    run_opts={<span class="hljs-string">&quot;device&quot;</span>: device},
    savedir=os.path.join(<span class="hljs-string">&quot;/tmp&quot;</span>, spk_model_name),
)


<span class="hljs-keyword">def</span> <span class="hljs-title function_">create_speaker_embedding</span>(<span class="hljs-params">waveform</span>):
    <span class="hljs-keyword">with</span> torch.no_grad():
        speaker_embeddings = speaker_model.encode_batch(torch.tensor(waveform))
        speaker_embeddings = torch.nn.functional.normalize(speaker_embeddings, dim=<span class="hljs-number">2</span>)
        speaker_embeddings = speaker_embeddings.squeeze().cpu().numpy()
    <span class="hljs-keyword">return</span> speaker_embeddings`,wrap:!1}}),Ve=new J({props:{title:"Processing the dataset",local:"processing-the-dataset",headingTag:"h3"}}),Ge=new u({props:{code:"ZGVmJTIwcHJlcGFyZV9kYXRhc2V0KGV4YW1wbGUpJTNBJTBBJTIwJTIwJTIwJTIwYXVkaW8lMjAlM0QlMjBleGFtcGxlJTVCJTIyYXVkaW8lMjIlNUQlMEElMEElMjAlMjAlMjAlMjBleGFtcGxlJTIwJTNEJTIwcHJvY2Vzc29yKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHRleHQlM0RleGFtcGxlJTVCJTIydGV4dCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGF1ZGlvX3RhcmdldCUzRGF1ZGlvJTVCJTIyYXJyYXklMjIlNUQlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzYW1wbGluZ19yYXRlJTNEYXVkaW8lNUIlMjJzYW1wbGluZ19yYXRlJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuX2F0dGVudGlvbl9tYXNrJTNERmFsc2UlMkMlMEElMjAlMjAlMjAlMjApJTBBJTBBJTIwJTIwJTIwJTIwJTIzJTIwc3RyaXAlMjBvZmYlMjB0aGUlMjBiYXRjaCUyMGRpbWVuc2lvbiUwQSUyMCUyMCUyMCUyMGV4YW1wbGUlNUIlMjJsYWJlbHMlMjIlNUQlMjAlM0QlMjBleGFtcGxlJTVCJTIybGFiZWxzJTIyJTVEJTVCMCU1RCUwQSUwQSUyMCUyMCUyMCUyMCUyMyUyMHVzZSUyMFNwZWVjaEJyYWluJTIwdG8lMjBvYnRhaW4lMjB4LXZlY3RvciUwQSUyMCUyMCUyMCUyMGV4YW1wbGUlNUIlMjJzcGVha2VyX2VtYmVkZGluZ3MlMjIlNUQlMjAlM0QlMjBjcmVhdGVfc3BlYWtlcl9lbWJlZGRpbmcoYXVkaW8lNUIlMjJhcnJheSUyMiU1RCklMEElMEElMjAlMjAlMjAlMjByZXR1cm4lMjBleGFtcGxl",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">prepare_dataset</span>(<span class="hljs-params">example</span>):
    audio = example[<span class="hljs-string">&quot;audio&quot;</span>]

    example = processor(
        text=example[<span class="hljs-string">&quot;text&quot;</span>],
        audio_target=audio[<span class="hljs-string">&quot;array&quot;</span>],
        sampling_rate=audio[<span class="hljs-string">&quot;sampling_rate&quot;</span>],
        return_attention_mask=<span class="hljs-literal">False</span>,
    )

    <span class="hljs-comment"># strip off the batch dimension</span>
    example[<span class="hljs-string">&quot;labels&quot;</span>] = example[<span class="hljs-string">&quot;labels&quot;</span>][<span class="hljs-number">0</span>]

    <span class="hljs-comment"># use SpeechBrain to obtain x-vector</span>
    example[<span class="hljs-string">&quot;speaker_embeddings&quot;</span>] = create_speaker_embedding(audio[<span class="hljs-string">&quot;array&quot;</span>])

    <span class="hljs-keyword">return</span> example`,wrap:!1}}),We=new u({props:{code:"cHJvY2Vzc2VkX2V4YW1wbGUlMjAlM0QlMjBwcmVwYXJlX2RhdGFzZXQoZGF0YXNldCU1QjAlNUQpJTBBbGlzdChwcm9jZXNzZWRfZXhhbXBsZS5rZXlzKCkp",highlighted:`processed_example = prepare_dataset(dataset[<span class="hljs-number">0</span>])
<span class="hljs-built_in">list</span>(processed_example.keys())`,wrap:!1}}),Re=new u({props:{code:"JTVCJ2lucHV0X2lkcyclMkMlMjAnbGFiZWxzJyUyQyUyMCdzdG9wX2xhYmVscyclMkMlMjAnc3BlYWtlcl9lbWJlZGRpbmdzJyU1RA==",highlighted:'[<span class="hljs-symbol">&#x27;input_ids</span>&#x27;, <span class="hljs-symbol">&#x27;labels</span>&#x27;, <span class="hljs-symbol">&#x27;stop_labels</span>&#x27;, <span class="hljs-symbol">&#x27;speaker_embeddings</span>&#x27;]',wrap:!1}}),Qe=new u({props:{code:"cHJvY2Vzc2VkX2V4YW1wbGUlNUIlMjJzcGVha2VyX2VtYmVkZGluZ3MlMjIlNUQuc2hhcGU=",highlighted:'processed_example[<span class="hljs-string">&quot;speaker_embeddings&quot;</span>].shape',wrap:!1}}),Ae=new u({props:{code:"KDUxMiUyQyk=",highlighted:'(<span class="hljs-number">512</span><span class="hljs-punctuation">,</span>)',wrap:!1}}),Ee=new u({props:{code:"aW1wb3J0JTIwbWF0cGxvdGxpYi5weXBsb3QlMjBhcyUyMHBsdCUwQSUwQXBsdC5maWd1cmUoKSUwQXBsdC5pbXNob3cocHJvY2Vzc2VkX2V4YW1wbGUlNUIlMjJsYWJlbHMlMjIlNUQuVCklMEFwbHQuc2hvdygp",highlighted:`<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt

plt.figure()
plt.imshow(processed_example[<span class="hljs-string">&quot;labels&quot;</span>].T)
plt.show()`,wrap:!1}}),qe=new u({props:{code:"ZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQubWFwKHByZXBhcmVfZGF0YXNldCUyQyUyMHJlbW92ZV9jb2x1bW5zJTNEZGF0YXNldC5jb2x1bW5fbmFtZXMp",highlighted:'dataset = dataset.<span class="hljs-built_in">map</span>(prepare_dataset, remove_columns=dataset.column_names)',wrap:!1}}),De=new u({props:{code:"ZGVmJTIwaXNfbm90X3Rvb19sb25nKGlucHV0X2lkcyklM0ElMEElMjAlMjAlMjAlMjBpbnB1dF9sZW5ndGglMjAlM0QlMjBsZW4oaW5wdXRfaWRzKSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMGlucHV0X2xlbmd0aCUyMCUzQyUyMDIwMCUwQSUwQSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LmZpbHRlcihpc19ub3RfdG9vX2xvbmclMkMlMjBpbnB1dF9jb2x1bW5zJTNEJTVCJTIyaW5wdXRfaWRzJTIyJTVEKSUwQWxlbihkYXRhc2V0KQ==",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">is_not_too_long</span>(<span class="hljs-params">input_ids</span>):
    input_length = <span class="hljs-built_in">len</span>(input_ids)
    <span class="hljs-keyword">return</span> input_length &lt; <span class="hljs-number">200</span>


dataset = dataset.<span class="hljs-built_in">filter</span>(is_not_too_long, input_columns=[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-built_in">len</span>(dataset)`,wrap:!1}}),Pe=new u({props:{code:"ODI1OQ==",highlighted:'<span class="hljs-number">8259</span>',wrap:!1}}),Oe=new u({props:{code:"ZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQudHJhaW5fdGVzdF9zcGxpdCh0ZXN0X3NpemUlM0QwLjEp",highlighted:'dataset = dataset.train_test_split(test_size=<span class="hljs-number">0.1</span>)',wrap:!1}}),et=new J({props:{title:"Data collator",local:"data-collator",headingTag:"h3"}}),lt=new u({props:{code:"ZnJvbSUyMGRhdGFjbGFzc2VzJTIwaW1wb3J0JTIwZGF0YWNsYXNzJTBBZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyMEFueSUyQyUyMERpY3QlMkMlMjBMaXN0JTJDJTIwVW5pb24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UyMCUyMCUyMCUyMCUyMCUyMCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBtYXhfbGVuZ3RoJTIwJTNEJTIwbWF4KHRhcmdldF9sZW5ndGhzKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGJhdGNoJTVCJTIybGFiZWxzJTIyJTVEJTIwJTNEJTIwYmF0Y2glNUIlMjJsYWJlbHMlMjIlNUQlNUIlM0ElMkMlMjAlM0FtYXhfbGVuZ3RoJTVEJTBBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwYWxzbyUyMGFkZCUyMGluJTIwdGhlJTIwc3BlYWtlciUyMGVtYmVkZGluZ3MlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBiYXRjaCU1QiUyMnNwZWFrZXJfZW1iZWRkaW5ncyUyMiU1RCUyMCUzRCUyMHRvcmNoLnRlbnNvcihzcGVha2VyX2ZlYXR1cmVzKSUwQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMGJhdGNo",highlighted:`<span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> dataclass
<span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> <span class="hljs-type">Any</span>, <span class="hljs-type">Dict</span>, <span class="hljs-type">List</span>, <span class="hljs-type">Union</span>


<span class="hljs-meta">@dataclass</span>
<span class="hljs-keyword">class</span> <span class="hljs-title class_">TTSDataCollatorWithPadding</span>:
    processor: <span class="hljs-type">Any</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__call__</span>(<span class="hljs-params">
        self, features: <span class="hljs-type">List</span>[<span class="hljs-type">Dict</span>[<span class="hljs-built_in">str</span>, <span class="hljs-type">Union</span>[<span class="hljs-type">List</span>[<span class="hljs-built_in">int</span>], torch.Tensor]]]
    </span>) -&gt; <span class="hljs-type">Dict</span>[<span class="hljs-built_in">str</span>, torch.Tensor]:
        input_ids = [{<span class="hljs-string">&quot;input_ids&quot;</span>: feature[<span class="hljs-string">&quot;input_ids&quot;</span>]} <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> features]
        label_features = [{<span class="hljs-string">&quot;input_values&quot;</span>: feature[<span class="hljs-string">&quot;labels&quot;</span>]} <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> features]
        speaker_features = [feature[<span class="hljs-string">&quot;speaker_embeddings&quot;</span>] <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> features]

        <span class="hljs-comment"># collate the inputs and targets into a batch</span>
        batch = processor.pad(
            input_ids=input_ids, labels=label_features, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
        )

        <span class="hljs-comment"># replace padding with -100 to ignore loss correctly</span>
        batch[<span class="hljs-string">&quot;labels&quot;</span>] = batch[<span class="hljs-string">&quot;labels&quot;</span>].masked_fill(
            batch.decoder_attention_mask.unsqueeze(-<span class="hljs-number">1</span>).ne(<span class="hljs-number">1</span>), -<span class="hljs-number">100</span>
        )

        <span class="hljs-comment"># not used during fine-tuning</span>
        <span class="hljs-keyword">del</span> batch[<span class="hljs-string">&quot;decoder_attention_mask&quot;</span>]

        <span class="hljs-comment"># round down target lengths to multiple of reduction factor</span>
        <span class="hljs-keyword">if</span> model.config.reduction_factor &gt; <span class="hljs-number">1</span>:
            target_lengths = torch.tensor(
                [<span class="hljs-built_in">len</span>(feature[<span class="hljs-string">&quot;input_values&quot;</span>]) <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> label_features]
            )
            target_lengths = target_lengths.new(
                [
                    length - length % model.config.reduction_factor
                    <span class="hljs-keyword">for</span> length <span class="hljs-keyword">in</span> target_lengths
                ]
            )
            max_length = <span class="hljs-built_in">max</span>(target_lengths)
            batch[<span class="hljs-string">&quot;labels&quot;</span>] = batch[<span class="hljs-string">&quot;labels&quot;</span>][:, :max_length]

        <span class="hljs-comment"># also add in the speaker embeddings</span>
        batch[<span class="hljs-string">&quot;speaker_embeddings&quot;</span>] = torch.tensor(speaker_features)

        <span class="hljs-keyword">return</span> batch`,wrap:!1}}),at=new u({props:{code:"ZGF0YV9jb2xsYXRvciUyMCUzRCUyMFRUU0RhdGFDb2xsYXRvcldpdGhQYWRkaW5nKHByb2Nlc3NvciUzRHByb2Nlc3Nvcik=",highlighted:"data_collator = TTSDataCollatorWithPadding(processor=processor)",wrap:!1}}),nt=new J({props:{title:"Train the model",local:"train-the-model",headingTag:"h2"}}),it=new u({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNwZWVjaFQ1Rm9yVGV4dFRvU3BlZWNoJTBBJTBBbW9kZWwlMjAlM0QlMjBTcGVlY2hUNUZvclRleHRUb1NwZWVjaC5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> SpeechT5ForTextToSpeech

model = SpeechT5ForTextToSpeech.from_pretrained(checkpoint)`,wrap:!1}}),Mt=new u({props:{code:"ZnJvbSUyMGZ1bmN0b29scyUyMGltcG9ydCUyMHBhcnRpYWwlMEElMEElMjMlMjBkaXNhYmxlJTIwY2FjaGUlMjBkdXJpbmclMjB0cmFpbmluZyUyMHNpbmNlJTIwaXQncyUyMGluY29tcGF0aWJsZSUyMHdpdGglMjBncmFkaWVudCUyMGNoZWNrcG9pbnRpbmclMEFtb2RlbC5jb25maWcudXNlX2NhY2hlJTIwJTNEJTIwRmFsc2UlMEElMEElMjMlMjBzZXQlMjBsYW5ndWFnZSUyMGFuZCUyMHRhc2slMjBmb3IlMjBnZW5lcmF0aW9uJTIwYW5kJTIwcmUtZW5hYmxlJTIwY2FjaGUlMEFtb2RlbC5nZW5lcmF0ZSUyMCUzRCUyMHBhcnRpYWwobW9kZWwuZ2VuZXJhdGUlMkMlMjB1c2VfY2FjaGUlM0RUcnVlKQ==",highlighted:`<span class="hljs-keyword">from</span> functools <span class="hljs-keyword">import</span> partial

<span class="hljs-comment"># disable cache during training since it&#x27;s incompatible with gradient checkpointing</span>
model.config.use_cache = <span class="hljs-literal">False</span>

<span class="hljs-comment"># set language and task for generation and re-enable cache</span>
model.generate = partial(model.generate, use_cache=<span class="hljs-literal">True</span>)`,wrap:!1}}),ct=new u({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNlcTJTZXFUcmFpbmluZ0FyZ3VtZW50cyUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBTZXEyU2VxVHJhaW5pbmdBcmd1bWVudHMoJTBBJTIwJTIwJTIwJTIwb3V0cHV0X2RpciUzRCUyMnNwZWVjaHQ1X2ZpbmV0dW5lZF92b3hwb3B1bGlfbmwlMjIlMkMlMjAlMjAlMjMlMjBjaGFuZ2UlMjB0byUyMGElMjByZXBvJTIwbmFtZSUyMG9mJTIweW91ciUyMGNob2ljZSUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUzRDQlMkMlMEElMjAlMjAlMjAlMjBncmFkaWVudF9hY2N1bXVsYXRpb25fc3RlcHMlM0Q4JTJDJTBBJTIwJTIwJTIwJTIwbGVhcm5pbmdfcmF0ZSUzRDFlLTUlMkMlMEElMjAlMjAlMjAlMjB3YXJtdXBfc3RlcHMlM0Q1MDAlMkMlMEElMjAlMjAlMjAlMjBtYXhfc3RlcHMlM0Q0MDAwJTJDJTBBJTIwJTIwJTIwJTIwZ3JhZGllbnRfY2hlY2twb2ludGluZyUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBmcDE2JTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfc3RyYXRlZ3klM0QlMjJzdGVwcyUyMiUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNEMiUyQyUwQSUyMCUyMCUyMCUyMHNhdmVfc3RlcHMlM0QxMDAwJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9zdGVwcyUzRDEwMDAlMkMlMEElMjAlMjAlMjAlMjBsb2dnaW5nX3N0ZXBzJTNEMjUlMkMlMEElMjAlMjAlMjAlMjByZXBvcnRfdG8lM0QlNUIlMjJ0ZW5zb3Jib2FyZCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGxvYWRfYmVzdF9tb2RlbF9hdF9lbmQlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwZ3JlYXRlcl9pc19iZXR0ZXIlM0RGYWxzZSUyQyUwQSUyMCUyMCUyMCUyMGxhYmVsX25hbWVzJTNEJTVCJTIybGFiZWxzJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwcHVzaF90b19odWIlM0RUcnVlJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Seq2SeqTrainingArguments

training_args = Seq2SeqTrainingArguments(
    output_dir=<span class="hljs-string">&quot;speecht5_finetuned_voxpopuli_nl&quot;</span>,  <span class="hljs-comment"># change to a repo name of your choice</span>
    per_device_train_batch_size=<span class="hljs-number">4</span>,
    gradient_accumulation_steps=<span class="hljs-number">8</span>,
    learning_rate=<span class="hljs-number">1e-5</span>,
    warmup_steps=<span class="hljs-number">500</span>,
    max_steps=<span class="hljs-number">4000</span>,
    gradient_checkpointing=<span class="hljs-literal">True</span>,
    fp16=<span class="hljs-literal">True</span>,
    eval_strategy=<span class="hljs-string">&quot;steps&quot;</span>,
    per_device_eval_batch_size=<span class="hljs-number">2</span>,
    save_steps=<span class="hljs-number">1000</span>,
    eval_steps=<span class="hljs-number">1000</span>,
    logging_steps=<span class="hljs-number">25</span>,
    report_to=[<span class="hljs-string">&quot;tensorboard&quot;</span>],
    load_best_model_at_end=<span class="hljs-literal">True</span>,
    greater_is_better=<span class="hljs-literal">False</span>,
    label_names=[<span class="hljs-string">&quot;labels&quot;</span>],
    push_to_hub=<span class="hljs-literal">True</span>,
)`,wrap:!1}}),yt=new u({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNlcTJTZXFUcmFpbmVyJTBBJTBBdHJhaW5lciUyMCUzRCUyMFNlcTJTZXFUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMGFyZ3MlM0R0cmFpbmluZ19hcmdzJTJDJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0Rtb2RlbCUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0RkYXRhc2V0JTVCJTIydHJhaW4lMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBldmFsX2RhdGFzZXQlM0RkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGRhdGFfY29sbGF0b3IlM0RkYXRhX2NvbGxhdG9yJTJDJTBBJTIwJTIwJTIwJTIwdG9rZW5pemVyJTNEcHJvY2Vzc29yJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Seq2SeqTrainer

trainer = Seq2SeqTrainer(
    args=training_args,
    model=model,
    train_dataset=dataset[<span class="hljs-string">&quot;train&quot;</span>],
    eval_dataset=dataset[<span class="hljs-string">&quot;test&quot;</span>],
    data_collator=data_collator,
    tokenizer=processor,
)`,wrap:!1}}),ut=new u({props:{code:"dHJhaW5lci50cmFpbigp",highlighted:"trainer.train()",wrap:!1}}),dt=new u({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:"trainer.push_to_hub()",wrap:!1}}),Jt=new J({props:{title:"Inference",local:"inference",headingTag:"h2"}}),ft=new u({props:{code:"bW9kZWwlMjAlM0QlMjBTcGVlY2hUNUZvclRleHRUb1NwZWVjaC5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyWU9VUl9BQ0NPVU5UJTJGc3BlZWNodDVfZmluZXR1bmVkX3ZveHBvcHVsaV9ubCUyMiUwQSk=",highlighted:`model = SpeechT5ForTextToSpeech.from_pretrained(
    <span class="hljs-string">&quot;YOUR_ACCOUNT/speecht5_finetuned_voxpopuli_nl&quot;</span>
)`,wrap:!1}}),jt=new u({props:{code:"ZXhhbXBsZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCMzA0JTVEJTBBc3BlYWtlcl9lbWJlZGRpbmdzJTIwJTNEJTIwdG9yY2gudGVuc29yKGV4YW1wbGUlNUIlMjJzcGVha2VyX2VtYmVkZGluZ3MlMjIlNUQpLnVuc3F1ZWV6ZSgwKQ==",highlighted:`example = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-number">304</span>]
speaker_embeddings = torch.tensor(example[<span class="hljs-string">&quot;speaker_embeddings&quot;</span>]).unsqueeze(<span class="hljs-number">0</span>)`,wrap:!1}}),It=new u({props:{code:"dGV4dCUyMCUzRCUyMCUyMmhhbGxvJTIwYWxsZW1hYWwlMkMlMjBpayUyMHByYWF0JTIwbmVkZXJsYW5kcy4lMjBncm9ldGplcyUyMGFhbiUyMGllZGVyZWVuISUyMg==",highlighted:'text = <span class="hljs-string">&quot;hallo allemaal, ik praat nederlands. groetjes aan iedereen!&quot;</span>',wrap:!1}}),gt=new u({props:{code:"aW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0R0ZXh0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMik=",highlighted:'inputs = processor(text=text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)',wrap:!1}}),kt=new u({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFNwZWVjaFQ1SGlmaUdhbiUwQSUwQXZvY29kZXIlMjAlM0QlMjBTcGVlY2hUNUhpZmlHYW4uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRnNwZWVjaHQ1X2hpZmlnYW4lMjIpJTBBc3BlZWNoJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGVfc3BlZWNoKGlucHV0cyU1QiUyMmlucHV0X2lkcyUyMiU1RCUyQyUyMHNwZWFrZXJfZW1iZWRkaW5ncyUyQyUyMHZvY29kZXIlM0R2b2NvZGVyKQ==",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>)
speech = model.generate_speech(inputs[<span class="hljs-string">&quot;input_ids&quot;</span>], speaker_embeddings, vocoder=vocoder)`,wrap:!1}}),Zt=new u({props:{code:"ZnJvbSUyMElQeXRob24uZGlzcGxheSUyMGltcG9ydCUyMEF1ZGlvJTBBJTBBQXVkaW8oc3BlZWNoLm51bXB5KCklMkMlMjByYXRlJTNEMTYwMDAp",highlighted:`<span class="hljs-keyword">from</span> IPython.display <span class="hljs-keyword">import</span> Audio

Audio(speech.numpy(), rate=<span class="hljs-number">16000</span>)`,wrap:!1}}),Gt=new jn({props:{source:"https://github.com/huggingface/audio-transformers-course/blob/main/chapters/en/chapter6/fine-tuning.mdx"}}),{c(){w=p("meta"),j=a(),d=p("p"),_t=a(),M(b.$$.fragment),Rt=a(),M(I.$$.fragment),Xt=a(),C=p("p"),C.textContent=ta,Qt=a(),M(g.$$.fragment),Nt=a(),$=p("p"),$.textContent=la,At=a(),M(k.$$.fragment),Ft=a(),M(T.$$.fragment),Et=a(),x=p("p"),x.textContent=sa,zt=a(),M(Z.$$.fragment),Ht=a(),v=p("p"),v.textContent=aa,qt=a(),M(V.$$.fragment),St=a(),M(B.$$.fragment),Dt=a(),G=p("p"),G.innerHTML=na,Lt=a(),_=p("p"),_.textContent=pa,Pt=a(),W=p("p"),W.textContent=ia,Kt=a(),M(Y.$$.fragment),Ot=a(),R=p("p"),R.innerHTML=ra,el=a(),M(X.$$.fragment),tl=a(),Q=p("p"),Q.textContent=Ma,ll=a(),M(N.$$.fragment),sl=a(),M(A.$$.fragment),al=a(),F=p("p"),F.textContent=oa,nl=a(),M(E.$$.fragment),pl=a(),M(z.$$.fragment),il=a(),H=p("p"),H.textContent=ca,rl=a(),M(q.$$.fragment),Ml=a(),S=p("p"),S.textContent=ma,ol=a(),M(D.$$.fragment),cl=a(),L=p("p"),L.innerHTML=ya,ml=a(),M(P.$$.fragment),yl=a(),K=p("p"),K.innerHTML=ha,hl=a(),O=p("p"),O.innerHTML=ua,ul=a(),ee=p("p"),ee.innerHTML=wa,wl=a(),M(te.$$.fragment),dl=a(),le=p("p"),le.textContent=da,Jl=a(),M(se.$$.fragment),Tl=a(),ae=p("p"),ae.innerHTML=Ja,fl=a(),M(ne.$$.fragment),Ul=a(),pe=p("p"),pe.innerHTML=Ta,jl=a(),M(ie.$$.fragment),bl=a(),re=p("p"),re.textContent=fa,Il=a(),M(Me.$$.fragment),Cl=a(),oe=p("p"),oe.textContent=Ua,gl=a(),M(ce.$$.fragment),$l=a(),me=p("p"),me.textContent=ja,kl=a(),M(ye.$$.fragment),xl=a(),f=p("div"),f.innerHTML=ba,Zl=a(),he=p("p"),he.textContent=Ia,vl=a(),M(ue.$$.fragment),Vl=a(),we=p("p"),we.textContent=Ca,Bl=a(),M(de.$$.fragment),Gl=a(),Je=p("p"),Je.innerHTML=ga,_l=a(),M(Te.$$.fragment),Wl=a(),fe=p("p"),fe.textContent=$a,Yl=a(),M(Ue.$$.fragment),Rl=a(),je=p("p"),je.innerHTML=ka,Xl=a(),M(be.$$.fragment),Ql=a(),Ie=p("p"),Ie.textContent=xa,Nl=a(),Ce=p("p"),Ce.textContent=Za,Al=a(),M(ge.$$.fragment),Fl=a(),$e=p("p"),$e.innerHTML=va,El=a(),ke=p("p"),ke.innerHTML=Va,zl=a(),M(xe.$$.fragment),Hl=a(),Ze=p("p"),Ze.innerHTML=Ba,ql=a(),ve=p("p"),ve.innerHTML=Ga,Sl=a(),M(Ve.$$.fragment),Dl=a(),Be=p("p"),Be.innerHTML=_a,Ll=a(),M(Ge.$$.fragment),Pl=a(),_e=p("p"),_e.textContent=Wa,Kl=a(),M(We.$$.fragment),Ol=a(),Ye=p("p"),Ye.innerHTML=Ya,es=a(),M(Re.$$.fragment),ts=a(),Xe=p("p"),Xe.textContent=Ra,ls=a(),M(Qe.$$.fragment),ss=a(),Ne=p("p"),Ne.innerHTML=Xa,as=a(),M(Ae.$$.fragment),ns=a(),Fe=p("p"),Fe.textContent=Qa,ps=a(),M(Ee.$$.fragment),is=a(),U=p("div"),U.innerHTML=Na,rs=a(),ze=p("p"),ze.textContent=Aa,Ms=a(),He=p("p"),He.textContent=Fa,os=a(),M(qe.$$.fragment),cs=a(),Se=p("p"),Se.textContent=Ea,ms=a(),M(De.$$.fragment),ys=a(),Le=p("p"),Le.innerHTML=za,hs=a(),M(Pe.$$.fragment),us=a(),Ke=p("p"),Ke.textContent=Ha,ws=a(),M(Oe.$$.fragment),ds=a(),M(et.$$.fragment),Js=a(),tt=p("p"),tt.innerHTML=qa,Ts=a(),M(lt.$$.fragment),fs=a(),st=p("p"),st.textContent=Sa,Us=a(),M(at.$$.fragment),js=a(),M(nt.$$.fragment),bs=a(),pt=p("p"),pt.textContent=Da,Is=a(),M(it.$$.fragment),Cs=a(),rt=p("p"),rt.innerHTML=La,gs=a(),M(Mt.$$.fragment),$s=a(),ot=p("p"),ot.textContent=Pa,ks=a(),M(ct.$$.fragment),xs=a(),mt=p("p"),mt.innerHTML=Ka,Zs=a(),M(yt.$$.fragment),vs=a(),ht=p("p"),ht.innerHTML=Oa,Vs=a(),M(ut.$$.fragment),Bs=a(),wt=p("p"),wt.textContent=en,Gs=a(),M(dt.$$.fragment),_s=a(),M(Jt.$$.fragment),Ws=a(),Tt=p("p"),Tt.textContent=tn,Ys=a(),M(ft.$$.fragment),Rs=a(),Ut=p("p"),Ut.textContent=ln,Xs=a(),M(jt.$$.fragment),Qs=a(),bt=p("p"),bt.textContent=sn,Ns=a(),M(It.$$.fragment),As=a(),Ct=p("p"),Ct.textContent=an,Fs=a(),M(gt.$$.fragment),Es=a(),$t=p("p"),$t.textContent=nn,zs=a(),M(kt.$$.fragment),Hs=a(),xt=p("p"),xt.textContent=pn,qs=a(),M(Zt.$$.fragment),Ss=a(),vt=p("p"),vt.textContent=rn,Ds=a(),Vt=p("p"),Vt.innerHTML=Mn,Ls=a(),Bt=p("p"),Bt.textContent=on,Ps=a(),M(Gt.$$.fragment),Ks=a(),Wt=p("p"),this.h()},l(e){const t=Jn("svelte-u9bgzb",document.head);w=i(t,"META",{name:!0,content:!0}),t.forEach(l),j=n(e),d=i(e,"P",{}),mn(d).forEach(l),_t=n(e),o(b.$$.fragment,e),Rt=n(e),o(I.$$.fragment,e),Xt=n(e),C=i(e,"P",{"data-svelte-h":!0}),r(C)!=="svelte-6isf2f"&&(C.textContent=ta),Qt=n(e),o(g.$$.fragment,e),Nt=n(e),$=i(e,"P",{"data-svelte-h":!0}),r($)!=="svelte-1pl1dgp"&&($.textContent=la),At=n(e),o(k.$$.fragment,e),Ft=n(e),o(T.$$.fragment,e),Et=n(e),x=i(e,"P",{"data-svelte-h":!0}),r(x)!=="svelte-9u3xmt"&&(x.textContent=sa),zt=n(e),o(Z.$$.fragment,e),Ht=n(e),v=i(e,"P",{"data-svelte-h":!0}),r(v)!=="svelte-1lsy5mj"&&(v.textContent=aa),qt=n(e),o(V.$$.fragment,e),St=n(e),o(B.$$.fragment,e),Dt=n(e),G=i(e,"P",{"data-svelte-h":!0}),r(G)!=="svelte-2wr3l4"&&(G.innerHTML=na),Lt=n(e),_=i(e,"P",{"data-svelte-h":!0}),r(_)!=="svelte-1p30ok7"&&(_.textContent=pa),Pt=n(e),W=i(e,"P",{"data-svelte-h":!0}),r(W)!=="svelte-1soaqfm"&&(W.textContent=ia),Kt=n(e),o(Y.$$.fragment,e),Ot=n(e),R=i(e,"P",{"data-svelte-h":!0}),r(R)!=="svelte-1mvdyro"&&(R.innerHTML=ra),el=n(e),o(X.$$.fragment,e),tl=n(e),Q=i(e,"P",{"data-svelte-h":!0}),r(Q)!=="svelte-1xdebij"&&(Q.textContent=Ma),ll=n(e),o(N.$$.fragment,e),sl=n(e),o(A.$$.fragment,e),al=n(e),F=i(e,"P",{"data-svelte-h":!0}),r(F)!=="svelte-1k7tad6"&&(F.textContent=oa),nl=n(e),o(E.$$.fragment,e),pl=n(e),o(z.$$.fragment,e),il=n(e),H=i(e,"P",{"data-svelte-h":!0}),r(H)!=="svelte-a1pl49"&&(H.textContent=ca),rl=n(e),o(q.$$.fragment,e),Ml=n(e),S=i(e,"P",{"data-svelte-h":!0}),r(S)!=="svelte-17epgem"&&(S.textContent=ma),ol=n(e),o(D.$$.fragment,e),cl=n(e),L=i(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-1mvdyro"&&(L.innerHTML=ya),ml=n(e),o(P.$$.fragment,e),yl=n(e),K=i(e,"P",{"data-svelte-h":!0}),r(K)!=="svelte-18cwafp"&&(K.innerHTML=ha),hl=n(e),O=i(e,"P",{"data-svelte-h":!0}),r(O)!=="svelte-1qiuc1m"&&(O.innerHTML=ua),ul=n(e),ee=i(e,"P",{"data-svelte-h":!0}),r(ee)!=="svelte-19dff1r"&&(ee.innerHTML=wa),wl=n(e),o(te.$$.fragment,e),dl=n(e),le=i(e,"P",{"data-svelte-h":!0}),r(le)!=="svelte-fefaym"&&(le.textContent=da),Jl=n(e),o(se.$$.fragment,e),Tl=n(e),ae=i(e,"P",{"data-svelte-h":!0}),r(ae)!=="svelte-1mvdyro"&&(ae.innerHTML=Ja),fl=n(e),o(ne.$$.fragment,e),Ul=n(e),pe=i(e,"P",{"data-svelte-h":!0}),r(pe)!=="svelte-akzhx6"&&(pe.innerHTML=Ta),jl=n(e),o(ie.$$.fragment,e),bl=n(e),re=i(e,"P",{"data-svelte-h":!0}),r(re)!=="svelte-hhu8o3"&&(re.textContent=fa),Il=n(e),o(Me.$$.fragment,e),Cl=n(e),oe=i(e,"P",{"data-svelte-h":!0}),r(oe)!=="svelte-1edo483"&&(oe.textContent=Ua),gl=n(e),o(ce.$$.fragment,e),$l=n(e),me=i(e,"P",{"data-svelte-h":!0}),r(me)!=="svelte-1hah56a"&&(me.textContent=ja),kl=n(e),o(ye.$$.fragment,e),xl=n(e),f=i(e,"DIV",{class:!0,"data-svelte-h":!0}),r(f)!=="svelte-1uufiik"&&(f.innerHTML=ba),Zl=n(e),he=i(e,"P",{"data-svelte-h":!0}),r(he)!=="svelte-1ujf40"&&(he.textContent=Ia),vl=n(e),o(ue.$$.fragment,e),Vl=n(e),we=i(e,"P",{"data-svelte-h":!0}),r(we)!=="svelte-g2dd32"&&(we.textContent=Ca),Bl=n(e),o(de.$$.fragment,e),Gl=n(e),Je=i(e,"P",{"data-svelte-h":!0}),r(Je)!=="svelte-1mvdyro"&&(Je.innerHTML=ga),_l=n(e),o(Te.$$.fragment,e),Wl=n(e),fe=i(e,"P",{"data-svelte-h":!0}),r(fe)!=="svelte-hbes5t"&&(fe.textContent=$a),Yl=n(e),o(Ue.$$.fragment,e),Rl=n(e),je=i(e,"P",{"data-svelte-h":!0}),r(je)!=="svelte-1mvdyro"&&(je.innerHTML=ka),Xl=n(e),o(be.$$.fragment,e),Ql=n(e),Ie=i(e,"P",{"data-svelte-h":!0}),r(Ie)!=="svelte-oizlk1"&&(Ie.textContent=xa),Nl=n(e),Ce=i(e,"P",{"data-svelte-h":!0}),r(Ce)!=="svelte-1n0u7fp"&&(Ce.textContent=Za),Al=n(e),o(ge.$$.fragment,e),Fl=n(e),$e=i(e,"P",{"data-svelte-h":!0}),r($e)!=="svelte-1xdfpy2"&&($e.innerHTML=va),El=n(e),ke=i(e,"P",{"data-svelte-h":!0}),r(ke)!=="svelte-7nncma"&&(ke.innerHTML=Va),zl=n(e),o(xe.$$.fragment,e),Hl=n(e),Ze=i(e,"P",{"data-svelte-h":!0}),r(Ze)!=="svelte-1mtxkxr"&&(Ze.innerHTML=Ba),ql=n(e),ve=i(e,"P",{"data-svelte-h":!0}),r(ve)!=="svelte-15ol8sg"&&(ve.innerHTML=Ga),Sl=n(e),o(Ve.$$.fragment,e),Dl=n(e),Be=i(e,"P",{"data-svelte-h":!0}),r(Be)!=="svelte-1tlidee"&&(Be.innerHTML=_a),Ll=n(e),o(Ge.$$.fragment,e),Pl=n(e),_e=i(e,"P",{"data-svelte-h":!0}),r(_e)!=="svelte-17mzfft"&&(_e.textContent=Wa),Kl=n(e),o(We.$$.fragment,e),Ol=n(e),Ye=i(e,"P",{"data-svelte-h":!0}),r(Ye)!=="svelte-1mvdyro"&&(Ye.innerHTML=Ya),es=n(e),o(Re.$$.fragment,e),ts=n(e),Xe=i(e,"P",{"data-svelte-h":!0}),r(Xe)!=="svelte-1mqg4ck"&&(Xe.textContent=Ra),ls=n(e),o(Qe.$$.fragment,e),ss=n(e),Ne=i(e,"P",{"data-svelte-h":!0}),r(Ne)!=="svelte-1mvdyro"&&(Ne.innerHTML=Xa),as=n(e),o(Ae.$$.fragment,e),ns=n(e),Fe=i(e,"P",{"data-svelte-h":!0}),r(Fe)!=="svelte-f7g58h"&&(Fe.textContent=Qa),ps=n(e),o(Ee.$$.fragment,e),is=n(e),U=i(e,"DIV",{class:!0,"data-svelte-h":!0}),r(U)!=="svelte-j4o1b8"&&(U.innerHTML=Na),rs=n(e),ze=i(e,"P",{"data-svelte-h":!0}),r(ze)!=="svelte-1t9vz0y"&&(ze.textContent=Aa),Ms=n(e),He=i(e,"P",{"data-svelte-h":!0}),r(He)!=="svelte-7crb3r"&&(He.textContent=Fa),os=n(e),o(qe.$$.fragment,e),cs=n(e),Se=i(e,"P",{"data-svelte-h":!0}),r(Se)!=="svelte-wvyh3r"&&(Se.textContent=Ea),ms=n(e),o(De.$$.fragment,e),ys=n(e),Le=i(e,"P",{"data-svelte-h":!0}),r(Le)!=="svelte-1mvdyro"&&(Le.innerHTML=za),hs=n(e),o(Pe.$$.fragment,e),us=n(e),Ke=i(e,"P",{"data-svelte-h":!0}),r(Ke)!=="svelte-12gx63x"&&(Ke.textContent=Ha),ws=n(e),o(Oe.$$.fragment,e),ds=n(e),o(et.$$.fragment,e),Js=n(e),tt=i(e,"P",{"data-svelte-h":!0}),r(tt)!=="svelte-rsy2my"&&(tt.innerHTML=qa),Ts=n(e),o(lt.$$.fragment,e),fs=n(e),st=i(e,"P",{"data-svelte-h":!0}),r(st)!=="svelte-u623yc"&&(st.textContent=Sa),Us=n(e),o(at.$$.fragment,e),js=n(e),o(nt.$$.fragment,e),bs=n(e),pt=i(e,"P",{"data-svelte-h":!0}),r(pt)!=="svelte-1kkriue"&&(pt.textContent=Da),Is=n(e),o(it.$$.fragment,e),Cs=n(e),rt=i(e,"P",{"data-svelte-h":!0}),r(rt)!=="svelte-1fpvhw6"&&(rt.innerHTML=La),gs=n(e),o(Mt.$$.fragment,e),$s=n(e),ot=i(e,"P",{"data-svelte-h":!0}),r(ot)!=="svelte-1af5qye"&&(ot.textContent=Pa),ks=n(e),o(ct.$$.fragment,e),xs=n(e),mt=i(e,"P",{"data-svelte-h":!0}),r(mt)!=="svelte-1yq1u47"&&(mt.innerHTML=Ka),Zs=n(e),o(yt.$$.fragment,e),vs=n(e),ht=i(e,"P",{"data-svelte-h":!0}),r(ht)!=="svelte-98ddde"&&(ht.innerHTML=Oa),Vs=n(e),o(ut.$$.fragment,e),Bs=n(e),wt=i(e,"P",{"data-svelte-h":!0}),r(wt)!=="svelte-hefgo2"&&(wt.textContent=en),Gs=n(e),o(dt.$$.fragment,e),_s=n(e),o(Jt.$$.fragment,e),Ws=n(e),Tt=i(e,"P",{"data-svelte-h":!0}),r(Tt)!=="svelte-vqys4o"&&(Tt.textContent=tn),Ys=n(e),o(ft.$$.fragment,e),Rs=n(e),Ut=i(e,"P",{"data-svelte-h":!0}),r(Ut)!=="svelte-kiuzrb"&&(Ut.textContent=ln),Xs=n(e),o(jt.$$.fragment,e),Qs=n(e),bt=i(e,"P",{"data-svelte-h":!0}),r(bt)!=="svelte-1sn5mu7"&&(bt.textContent=sn),Ns=n(e),o(It.$$.fragment,e),As=n(e),Ct=i(e,"P",{"data-svelte-h":!0}),r(Ct)!=="svelte-1sf6bxe"&&(Ct.textContent=an),Fs=n(e),o(gt.$$.fragment,e),Es=n(e),$t=i(e,"P",{"data-svelte-h":!0}),r($t)!=="svelte-1kfdmvn"&&($t.textContent=nn),zs=n(e),o(kt.$$.fragment,e),Hs=n(e),xt=i(e,"P",{"data-svelte-h":!0}),r(xt)!=="svelte-jp0xjb"&&(xt.textContent=pn),qs=n(e),o(Zt.$$.fragment,e),Ss=n(e),vt=i(e,"P",{"data-svelte-h":!0}),r(vt)!=="svelte-yji0sl"&&(vt.textContent=rn),Ds=n(e),Vt=i(e,"P",{"data-svelte-h":!0}),r(Vt)!=="svelte-6lmfh0"&&(Vt.innerHTML=Mn),Ls=n(e),Bt=i(e,"P",{"data-svelte-h":!0}),r(Bt)!=="svelte-bv2cz9"&&(Bt.textContent=on),Ps=n(e),o(Gt.$$.fragment,e),Ks=n(e),Wt=i(e,"P",{}),mn(Wt).forEach(l),this.h()},h(){ea(w,"name","hf:doc:metadata"),ea(w,"content",Cn),ea(f,"class","flex justify-center"),ea(U,"class","flex justify-center")},m(e,t){Tn(document.head,w),s(e,j,t),s(e,d,t),s(e,_t,t),c(b,e,t),s(e,Rt,t),c(I,e,t),s(e,Xt,t),s(e,C,t),s(e,Qt,t),c(g,e,t),s(e,Nt,t),s(e,$,t),s(e,At,t),c(k,e,t),s(e,Ft,t),c(T,e,t),s(e,Et,t),s(e,x,t),s(e,zt,t),c(Z,e,t),s(e,Ht,t),s(e,v,t),s(e,qt,t),c(V,e,t),s(e,St,t),c(B,e,t),s(e,Dt,t),s(e,G,t),s(e,Lt,t),s(e,_,t),s(e,Pt,t),s(e,W,t),s(e,Kt,t),c(Y,e,t),s(e,Ot,t),s(e,R,t),s(e,el,t),c(X,e,t),s(e,tl,t),s(e,Q,t),s(e,ll,t),c(N,e,t),s(e,sl,t),c(A,e,t),s(e,al,t),s(e,F,t),s(e,nl,t),c(E,e,t),s(e,pl,t),c(z,e,t),s(e,il,t),s(e,H,t),s(e,rl,t),c(q,e,t),s(e,Ml,t),s(e,S,t),s(e,ol,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De,e,t),s(e,ys,t),s(e,Le,t),s(e,hs,t),c(Pe,e,t),s(e,us,t),s(e,Ke,t),s(e,ws,t),c(Oe,e,t),s(e,ds,t),c(et,e,t),s(e,Js,t),s(e,tt,t),s(e,Ts,t),c(lt,e,t),s(e,fs,t),s(e,st,t),s(e,Us,t),c(at,e,t),s(e,js,t),c(nt,e,t),s(e,bs,t),s(e,pt,t),s(e,Is,t),c(it,e,t),s(e,Cs,t),s(e,rt,t),s(e,gs,t),c(Mt,e,t),s(e,$s,t),s(e,ot,t),s(e,ks,t),c(ct,e,t),s(e,xs,t),s(e,mt,t),s(e,Zs,t),c(yt,e,t),s(e,vs,t),s(e,ht,t),s(e,Vs,t),c(ut,e,t),s(e,Bs,t),s(e,wt,t),s(e,Gs,t),c(dt,e,t),s(e,_s,t),c(Jt,e,t),s(e,Ws,t),s(e,Tt,t),s(e,Ys,t),c(ft,e,t),s(e,Rs,t),s(e,Ut,t),s(e,Xs,t),c(jt,e,t),s(e,Qs,t),s(e,bt,t),s(e,Ns,t),c(It,e,t),s(e,As,t),s(e,Ct,t),s(e,Fs,t),c(gt,e,t),s(e,Es,t),s(e,$t,t),s(e,zs,t),c(kt,e,t),s(e,Hs,t),s(e,xt,t),s(e,qs,t),c(Zt,e,t),s(e,Ss,t),s(e,vt,t),s(e,Ds,t),s(e,Vt,t),s(e,Ls,t),s(e,Bt,t),s(e,Ps,t),c(Gt,e,t),s(e,Ks,t),s(e,Wt,t),Os=!0},p(e,[t]){const cn={};t&2&&(cn.$$scope={dirty:t,ctx:e}),T.$set(cn)},i(e){Os||(m(b.$$.fragment,e),m(I.$$.fragment,e),m(g.$$.fragment,e),m(k.$$.fragment,e),m(T.$$.fragment,e),m(Z.$$.fragment,e),m(V.$$.fragment,e),m(B.$$.fragment,e),m(Y.$$.fragment,e),m(X.$$.fragment,e),m(N.$$.fragment,e),m(A.$$.fragment,e),m(E.$$.fragment,e),m(z.$$.fragment,e),m(q.$$.fragment,e),m(D.$$.fragment,e),m(P.$$.fragment,e),m(te.$$.fragment,e),m(se.$$.fragment,e),m(ne.$$.fragment,e),m(ie.$$.fragment,e),m(Me.$$.fragment,e),m(ce.$$.fragment,e),m(ye.$$.fragment,e),m(ue.$$.fragment,e),m(de.$$.fragment,e),m(Te.$$.fragment,e),m(Ue.$$.fragment,e),m(be.$$.fragment,e),m(ge.$$.fragment,e),m(xe.$$.fragment,e),m(Ve.$$.fragment,e),m(Ge.$$.fragment,e),m(We.$$.fragment,e),m(Re.$$.fragment,e),m(Qe.$$.fragment,e),m(Ae.$$.fragment,e),m(Ee.$$.fragment,e),m(qe.$$.fragment,e),m(De.$$.fragment,e),m(Pe.$$.fragment,e),m(Oe.$$.fragment,e),m(et.$$.fragment,e),m(lt.$$.fragment,e),m(at.$$.fragment,e),m(nt.$$.fragment,e),m(it.$$.fragment,e),m(Mt.$$.fragment,e),m(ct.$$.fragment,e),m(yt.$$.fragment,e),m(ut.$$.fragment,e),m(dt.$$.fragment,e),m(Jt.$$.fragment,e),m(ft.$$.fragment,e),m(jt.$$.fragment,e),m(It.$$.fragment,e),m(gt.$$.fragment,e),m(kt.$$.fragment,e),m(Zt.$$.fragment,e),m(Gt.$$.fragment,e),Os=!0)},o(e){y(b.$$.fragment,e),y(I.$$.fragment,e),y(g.$$.fragment,e),y(k.$$.fragment,e),y(T.$$.fragment,e),y(Z.$$.fragment,e),y(V.$$.fragment,e),y(B.$$.fragment,e),y(Y.$$.fragment,e),y(X.$$.fragment,e),y(N.$$.fragment,e),y(A.$$.fragment,e),y(E.$$.fragment,e),y(z.$$.fragment,e),y(q.$$.fragment,e),y(D.$$.fragment,e),y(P.$$.fragment,e),y(te.$$.fragment,e),y(se.$$.fragment,e),y(ne.$$.fragment,e),y(ie.$$.fragment,e),y(Me.$$.fragment,e),y(ce.$$.fragment,e),y(ye.$$.fragment,e),y(ue.$$.fragment,e),y(de.$$.fragment,e),y(Te.$$.fragment,e),y(Ue.$$.fragment,e),y(be.$$.fragment,e),y(ge.$$.fragment,e),y(xe.$$.fragment,e),y(Ve.$$.fragment,e),y(Ge.$$.fragment,e),y(We.$$.fragment,e),y(Re.$$.fragment,e),y(Qe.$$.fragment,e),y(Ae.$$.fragment,e),y(Ee.$$.fragment,e),y(qe.$$.fragment,e),y(De.$$.fragment,e),y(Pe.$$.fragment,e),y(Oe.$$.fragment,e),y(et.$$.fragment,e),y(lt.$$.fragment,e),y(at.$$.fragment,e),y(nt.$$.fragment,e),y(it.$$.fragment,e),y(Mt.$$.fragment,e),y(ct.$$.fragment,e),y(yt.$$.fragment,e),y(ut.$$.fragment,e),y(dt.$$.fragment,e),y(Jt.$$.fragment,e),y(ft.$$.fragment,e),y(jt.$$.fragment,e),y(It.$$.fragment,e),y(gt.$$.fragment,e),y(kt.$$.fragment,e),y(Zt.$$.fragment,e),y(Gt.$$.fragment,e),Os=!1},d(e){e&&(l(j),l(d),l(_t),l(Rt),l(Xt),l(C),l(Qt),l(Nt),l($),l(At),l(Ft),l(Et),l(x),l(zt),l(Ht),l(v),l(qt),l(St),l(Dt),l(G),l(Lt),l(_),l(Pt),l(W),l(Kt),l(Ot),l(R),l(el),l(tl),l(Q),l(ll),l(sl),l(al),l(F),l(nl),l(pl),l(il),l(H),l(rl),l(Ml),l(S),l(ol),l(cl),l(L),l(ml),l(yl),l(K),l(hl),l(O),l(ul),l(ee),l(wl),l(dl),l(le),l(Jl),l(Tl),l(ae),l(fl),l(Ul),l(pe),l(jl),l(bl),l(re),l(Il),l(Cl),l(oe),l(gl),l($l),l(me),l(kl),l(xl),l(f),l(Zl),l(he),l(vl),l(Vl),l(we),l(Bl),l(Gl),l(Je),l(_l),l(Wl),l(fe),l(Yl),l(Rl),l(je),l(Xl),l(Ql),l(Ie),l(Nl),l(Ce),l(Al),l(Fl),l($e),l(El),l(ke),l(zl),l(Hl),l(Ze),l(ql),l(ve),l(Sl),l(Dl),l(Be),l(Ll),l(Pl),l(_e),l(Kl),l(Ol),l(Ye),l(es),l(ts),l(Xe),l(ls),l(ss),l(Ne),l(as),l(ns),l(Fe),l(ps),l(is),l(U),l(rs),l(ze),l(Ms),l(He),l(os),l(cs),l(Se),l(ms),l(ys),l(Le),l(hs),l(us),l(Ke),l(ws),l(ds),l(Js),l(tt),l(Ts),l(fs),l(st),l(Us),l(js),l(bs),l(pt),l(Is),l(Cs),l(rt),l(gs),l($s),l(ot),l(ks),l(xs),l(mt),l(Zs),l(vs),l(ht),l(Vs),l(Bs),l(wt),l(Gs),l(_s),l(Ws),l(Tt),l(Ys),l(Rs),l(Ut),l(Xs),l(Qs),l(bt),l(Ns),l(As),l(Ct),l(Fs),l(Es),l($t),l(zs),l(Hs),l(xt),l(qs),l(Ss),l(vt),l(Ds),l(Vt),l(Ls),l(Bt),l(Ps),l(Ks),l(Wt)),l(w),h(b,e),h(I,e),h(g,e),h(k,e),h(T,e),h(Z,e),h(V,e),h(B,e),h(Y,e),h(X,e),h(N,e),h(A,e),h(E,e),h(z,e),h(q,e),h(D,e),h(P,e),h(te,e),h(se,e),h(ne,e),h(ie,e),h(Me,e),h(ce,e),h(ye,e),h(ue,e),h(de,e),h(Te,e),h(Ue,e),h(be,e),h(ge,e),h(xe,e),h(Ve,e),h(Ge,e),h(We,e),h(Re,e),h(Qe,e),h(Ae,e),h(Ee,e),h(qe,e),h(De,e),h(Pe,e),h(Oe,e),h(et,e),h(lt,e),h(at,e),h(nt,e),h(it,e),h(Mt,e),h(ct,e),h(yt,e),h(ut,e),h(dt,e),h(Jt,e),h(ft,e),h(jt,e),h(It,e),h(gt,e),h(kt,e),h(Zt,e),h(Gt,e)}}}const Cn='{"title":"Fine-tuning SpeechT5","local":"fine-tuning-speecht5","sections":[{"title":"House-keeping","local":"house-keeping","sections":[],"depth":2},{"title":"The dataset","local":"the-dataset","sections":[],"depth":2},{"title":"Preprocessing the data","local":"preprocessing-the-data","sections":[{"title":"Text cleanup for SpeechT5 tokenization","local":"text-cleanup-for-speecht5-tokenization","sections":[],"depth":3},{"title":"Speakers","local":"speakers","sections":[],"depth":3},{"title":"Speaker embeddings","local":"speaker-embeddings","sections":[],"depth":3},{"title":"Processing the dataset","local":"processing-the-dataset","sections":[],"depth":3},{"title":"Data collator","local":"data-collator","sections":[],"depth":3}],"depth":2},{"title":"Train the model","local":"train-the-model","sections":[],"depth":2},{"title":"Inference","local":"inference","sections":[],"depth":2}],"depth":1}';function gn(Yt){return hn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Vn extends wn{constructor(w){super(),dn(this,w,gn,In,yn,{})}}export{Vn as component};
