import{s as je,o as be,n as Hs}from"../chunks/scheduler.9bc65507.js";import{S as we,i as Je,g as c,s as n,r as h,A as Te,h as m,f as e,c as p,j as Me,u as d,x as b,k as ye,y as Ue,a,v as u,d as M,t as y,w as f,m as $e,n as _e}from"../chunks/index.707bf1b6.js";import{T as Ht}from"../chunks/Tip.c2ecdbf4.js";import{Y as Ce}from"../chunks/Youtube.e1129c6f.js";import{C as T}from"../chunks/CodeBlock.54a9f38d.js";import{D as ve}from"../chunks/DocNotebookDropdown.3e6b3817.js";import{F as fe,M as ge}from"../chunks/Markdown.fef84341.js";import{H as Bs}from"../chunks/Heading.342b1fa6.js";function Ie(v){let l,g,r='<a href="../model_doc/data2vec-audio">Data2VecAudio</a>, <a href="../model_doc/hubert">Hubert</a>, <a href="../model_doc/mctct">M-CTC-T</a>, <a href="../model_doc/sew">SEW</a>, <a href="../model_doc/sew-d">SEW-D</a>, <a href="../model_doc/unispeech">UniSpeech</a>, <a href="../model_doc/unispeech-sat">UniSpeechSat</a>, <a href="../model_doc/wav2vec2">Wav2Vec2</a>, <a href="../model_doc/wav2vec2-conformer">Wav2Vec2-Conformer</a>, <a href="../model_doc/wavlm">WavLM</a>';return{c(){l=$e(`The task illustrated in this tutorial is supported by the following model architectures:

`),g=c("p"),g.innerHTML=r},l(j){l=_e(j,`The task illustrated in this tutorial is supported by the following model architectures:

`),g=m(j,"P",{"data-svelte-h":!0}),b(g)!=="svelte-1xfq5e"&&(g.innerHTML=r)},m(j,w){a(j,l,w),a(j,g,w)},p:Hs,d(j){j&&(e(l),e(g))}}}function ke(v){let l,g='If you aren’t familiar with finetuning a model with the <a href="/docs/transformers/v4.36.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>, take a look at the basic tutorial <a href="../training#train-with-pytorch-trainer">here</a>!';return{c(){l=c("p"),l.innerHTML=g},l(r){l=m(r,"P",{"data-svelte-h":!0}),b(l)!=="svelte-f2f9bk"&&(l.innerHTML=g)},m(r,j){a(r,l,j)},p:Hs,d(r){r&&e(l)}}}function Re(v){let l,g,r,j='You’re ready to start training your model now! Load Wav2Vec2 with <a href="/docs/transformers/v4.36.0/en/model_doc/auto#transformers.AutoModelForCTC">AutoModelForCTC</a>. Specify the reduction to apply with the <code>ctc_loss_reduction</code> parameter. It is often better to use the average instead of the default summation:',w,C,R,k,I="At this point, only three steps remain:",Z,U,X='<li>Define your training hyperparameters in <a href="/docs/transformers/v4.36.0/en/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>. The only required parameter is <code>output_dir</code> which specifies where to save your model. You’ll push this model to the Hub by setting <code>push_to_hub=True</code> (you need to be signed in to Hugging Face to upload your model). At the end of each epoch, the <a href="/docs/transformers/v4.36.0/en/main_classes/trainer#transformers.Trainer">Trainer</a> will evaluate the WER and save the training checkpoint.</li> <li>Pass the training arguments to <a href="/docs/transformers/v4.36.0/en/main_classes/trainer#transformers.Trainer">Trainer</a> along with the model, dataset, tokenizer, data collator, and <code>compute_metrics</code> function.</li> <li>Call <a href="/docs/transformers/v4.36.0/en/main_classes/trainer#transformers.Trainer.train">train()</a> to finetune your model.</li>',x,$,G,i,_='Once training is completed, share your model to the Hub with the <a href="/docs/transformers/v4.36.0/en/main_classes/trainer#transformers.Trainer.push_to_hub">push_to_hub()</a> method so everyone can use your model:',E,B,W;return l=new Ht({props:{$$slots:{default:[ke]},$$scope:{ctx:v}}}),C=new T({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNUQyUyQyUyMFRyYWluaW5nQXJndW1lbnRzJTJDJTIwVHJhaW5lciUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ1RDLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UlMjIlMkMlMEElMjAlMjAlMjAlMjBjdGNfbG9zc19yZWR1Y3Rpb24lM0QlMjJtZWFuJTIyJTJDJTBBJTIwJTIwJTIwJTIwcGFkX3Rva2VuX2lkJTNEcHJvY2Vzc29yLnRva2VuaXplci5wYWRfdG9rZW5faWQlMkMlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCTC, TrainingArguments, Trainer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCTC.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;facebook/wav2vec2-base&quot;</span>,
<span class="hljs-meta">... </span>    ctc_loss_reduction=<span class="hljs-string">&quot;mean&quot;</span>,
<span class="hljs-meta">... </span>    pad_token_id=processor.tokenizer.pad_token_id,
<span class="hljs-meta">... </span>)`,wrap:!1}}),$=new T({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJteV9hd2Vzb21lX2Fzcl9taW5kX21vZGVsJTIyJTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNEOCUyQyUwQSUyMCUyMCUyMCUyMGdyYWRpZW50X2FjY3VtdWxhdGlvbl9zdGVwcyUzRDIlMkMlMEElMjAlMjAlMjAlMjBsZWFybmluZ19yYXRlJTNEMWUtNSUyQyUwQSUyMCUyMCUyMCUyMHdhcm11cF9zdGVwcyUzRDUwMCUyQyUwQSUyMCUyMCUyMCUyMG1heF9zdGVwcyUzRDIwMDAlMkMlMEElMjAlMjAlMjAlMjBncmFkaWVudF9jaGVja3BvaW50aW5nJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGZwMTYlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwZ3JvdXBfYnlfbGVuZ3RoJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGV2YWx1YXRpb25fc3RyYXRlZ3klM0QlMjJzdGVwcyUyMiUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNEOCUyQyUwQSUyMCUyMCUyMCUyMHNhdmVfc3RlcHMlM0QxMDAwJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9zdGVwcyUzRDEwMDAlMkMlMEElMjAlMjAlMjAlMjBsb2dnaW5nX3N0ZXBzJTNEMjUlMkMlMEElMjAlMjAlMjAlMjBsb2FkX2Jlc3RfbW9kZWxfYXRfZW5kJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMG1ldHJpY19mb3JfYmVzdF9tb2RlbCUzRCUyMndlciUyMiUyQyUwQSUyMCUyMCUyMCUyMGdyZWF0ZXJfaXNfYmV0dGVyJTNERmFsc2UlMkMlMEElMjAlMjAlMjAlMjBwdXNoX3RvX2h1YiUzRFRydWUlMkMlMEEpJTBBJTBBdHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0Rtb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGFyZ3MlM0R0cmFpbmluZ19hcmdzJTJDJTBBJTIwJTIwJTIwJTIwdHJhaW5fZGF0YXNldCUzRGVuY29kZWRfbWluZHMlNUIlMjJ0cmFpbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRGVuY29kZWRfbWluZHMlNUIlMjJ0ZXN0JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwdG9rZW5pemVyJTNEcHJvY2Vzc29yJTJDJTBBJTIwJTIwJTIwJTIwZGF0YV9jb2xsYXRvciUzRGRhdGFfY29sbGF0b3IlMkMlMEElMjAlMjAlMjAlMjBjb21wdXRlX21ldHJpY3MlM0Rjb21wdXRlX21ldHJpY3MlMkMlMEEpJTBBJTBBdHJhaW5lci50cmFpbigp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;my_awesome_asr_mind_model&quot;</span>,
<span class="hljs-meta">... </span>    per_device_train_batch_size=<span class="hljs-number">8</span>,
<span class="hljs-meta">... </span>    gradient_accumulation_steps=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>    learning_rate=<span class="hljs-number">1e-5</span>,
<span class="hljs-meta">... </span>    warmup_steps=<span class="hljs-number">500</span>,
<span class="hljs-meta">... </span>    max_steps=<span class="hljs-number">2000</span>,
<span class="hljs-meta">... </span>    gradient_checkpointing=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    fp16=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    group_by_length=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    evaluation_strategy=<span class="hljs-string">&quot;steps&quot;</span>,
<span class="hljs-meta">... </span>    per_device_eval_batch_size=<span class="hljs-number">8</span>,
<span class="hljs-meta">... </span>    save_steps=<span class="hljs-number">1000</span>,
<span class="hljs-meta">... </span>    eval_steps=<span class="hljs-number">1000</span>,
<span class="hljs-meta">... </span>    logging_steps=<span class="hljs-number">25</span>,
<span class="hljs-meta">... </span>    load_best_model_at_end=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    metric_for_best_model=<span class="hljs-string">&quot;wer&quot;</span>,
<span class="hljs-meta">... </span>    greater_is_better=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>    push_to_hub=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=encoded_minds[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    eval_dataset=encoded_minds[<span class="hljs-string">&quot;test&quot;</span>],
<span class="hljs-meta">... </span>    tokenizer=processor,
<span class="hljs-meta">... </span>    data_collator=data_collator,
<span class="hljs-meta">... </span>    compute_metrics=compute_metrics,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()`,wrap:!1}}),B=new T({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()',wrap:!1}}),{c(){h(l.$$.fragment),g=n(),r=c("p"),r.innerHTML=j,w=n(),h(C.$$.fragment),R=n(),k=c("p"),k.textContent=I,Z=n(),U=c("ol"),U.innerHTML=X,x=n(),h($.$$.fragment),G=n(),i=c("p"),i.innerHTML=_,E=n(),h(B.$$.fragment)},l(o){d(l.$$.fragment,o),g=p(o),r=m(o,"P",{"data-svelte-h":!0}),b(r)!=="svelte-vhn5x8"&&(r.innerHTML=j),w=p(o),d(C.$$.fragment,o),R=p(o),k=m(o,"P",{"data-svelte-h":!0}),b(k)!=="svelte-l42k0i"&&(k.textContent=I),Z=p(o),U=m(o,"OL",{"data-svelte-h":!0}),b(U)!=="svelte-hv2q82"&&(U.innerHTML=X),x=p(o),d($.$$.fragment,o),G=p(o),i=m(o,"P",{"data-svelte-h":!0}),b(i)!=="svelte-1xu9352"&&(i.innerHTML=_),E=p(o),d(B.$$.fragment,o)},m(o,J){u(l,o,J),a(o,g,J),a(o,r,J),a(o,w,J),u(C,o,J),a(o,R,J),a(o,k,J),a(o,Z,J),a(o,U,J),a(o,x,J),u($,o,J),a(o,G,J),a(o,i,J),a(o,E,J),u(B,o,J),W=!0},p(o,J){const Xs={};J&2&&(Xs.$$scope={dirty:J,ctx:o}),l.$set(Xs)},i(o){W||(M(l.$$.fragment,o),M(C.$$.fragment,o),M($.$$.fragment,o),M(B.$$.fragment,o),W=!0)},o(o){y(l.$$.fragment,o),y(C.$$.fragment,o),y($.$$.fragment,o),y(B.$$.fragment,o),W=!1},d(o){o&&(e(g),e(r),e(w),e(R),e(k),e(Z),e(U),e(x),e(G),e(i),e(E)),f(l,o),f(C,o),f($,o),f(B,o)}}}function Ze(v){let l,g;return l=new ge({props:{$$slots:{default:[Re]},$$scope:{ctx:v}}}),{c(){h(l.$$.fragment)},l(r){d(l.$$.fragment,r)},m(r,j){u(l,r,j),g=!0},p(r,j){const w={};j&2&&(w.$$scope={dirty:j,ctx:r}),l.$set(w)},i(r){g||(M(l.$$.fragment,r),g=!0)},o(r){y(l.$$.fragment,r),g=!1},d(r){f(l,r)}}}function xe(v){let l,g='For a more in-depth example of how to finetune a model for automatic speech recognition, take a look at this blog <a href="https://huggingface.co/blog/fine-tune-wav2vec2-english" rel="nofollow">post</a> for English ASR and this <a href="https://huggingface.co/blog/fine-tune-xlsr-wav2vec2" rel="nofollow">post</a> for multilingual ASR.';return{c(){l=c("p"),l.innerHTML=g},l(r){l=m(r,"P",{"data-svelte-h":!0}),b(l)!=="svelte-1jxkvde"&&(l.innerHTML=g)},m(r,j){a(r,l,j)},p:Hs,d(r){r&&e(l)}}}function We(v){let l,g="The transcription is decent, but it could be better! Try finetuning your model on more examples to get even better results!";return{c(){l=c("p"),l.textContent=g},l(r){l=m(r,"P",{"data-svelte-h":!0}),b(l)!=="svelte-1a2d12i"&&(l.textContent=g)},m(r,j){a(r,l,j)},p:Hs,d(r){r&&e(l)}}}function Ge(v){let l,g="Load a processor to preprocess the audio file and transcription and return the <code>input</code> as PyTorch tensors:",r,j,w,C,R="Pass your inputs to the model and return the logits:",k,I,Z,U,X="Get the predicted <code>input_ids</code> with the highest probability, and use the processor to decode the predicted <code>input_ids</code> back into text:",x,$,G;return j=new T({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzdGV2aGxpdSUyRm15X2F3ZXNvbWVfYXNyX21pbmRfbW9kZWwlMjIpJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGRhdGFzZXQlNUIwJTVEJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJhcnJheSUyMiU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;stevhliu/my_awesome_asr_mind_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)`,wrap:!1}}),I=new T({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNUQyUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ1RDLmZyb21fcHJldHJhaW5lZCglMjJzdGV2aGxpdSUyRm15X2F3ZXNvbWVfYXNyX21pbmRfbW9kZWwlMjIpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCTC

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCTC.from_pretrained(<span class="hljs-string">&quot;stevhliu/my_awesome_asr_mind_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits`,wrap:!1}}),$=new T({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFwcmVkaWN0ZWRfaWRzJTIwJTNEJTIwdG9yY2guYXJnbWF4KGxvZ2l0cyUyQyUyMGRpbSUzRC0xKSUwQXRyYW5zY3JpcHRpb24lMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKHByZWRpY3RlZF9pZHMpJTBBdHJhbnNjcmlwdGlvbg==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_ids = torch.argmax(logits, dim=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.batch_decode(predicted_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription
[<span class="hljs-string">&#x27;I WOUL LIKE O SET UP JOINT ACOUNT WTH Y PARTNER&#x27;</span>]`,wrap:!1}}),{c(){l=c("p"),l.innerHTML=g,r=n(),h(j.$$.fragment),w=n(),C=c("p"),C.textContent=R,k=n(),h(I.$$.fragment),Z=n(),U=c("p"),U.innerHTML=X,x=n(),h($.$$.fragment)},l(i){l=m(i,"P",{"data-svelte-h":!0}),b(l)!=="svelte-apwwja"&&(l.innerHTML=g),r=p(i),d(j.$$.fragment,i),w=p(i),C=m(i,"P",{"data-svelte-h":!0}),b(C)!=="svelte-1at92g"&&(C.textContent=R),k=p(i),d(I.$$.fragment,i),Z=p(i),U=m(i,"P",{"data-svelte-h":!0}),b(U)!=="svelte-1hxzj8m"&&(U.innerHTML=X),x=p(i),d($.$$.fragment,i)},m(i,_){a(i,l,_),a(i,r,_),u(j,i,_),a(i,w,_),a(i,C,_),a(i,k,_),u(I,i,_),a(i,Z,_),a(i,U,_),a(i,x,_),u($,i,_),G=!0},p:Hs,i(i){G||(M(j.$$.fragment,i),M(I.$$.fragment,i),M($.$$.fragment,i),G=!0)},o(i){y(j.$$.fragment,i),y(I.$$.fragment,i),y($.$$.fragment,i),G=!1},d(i){i&&(e(l),e(r),e(w),e(C),e(k),e(Z),e(U),e(x)),f(j,i),f(I,i),f($,i)}}}function Be(v){let l,g;return l=new ge({props:{$$slots:{default:[Ge]},$$scope:{ctx:v}}}),{c(){h(l.$$.fragment)},l(r){d(l.$$.fragment,r)},m(r,j){u(l,r,j),g=!0},p(r,j){const w={};j&2&&(w.$$scope={dirty:j,ctx:r}),l.$set(w)},i(r){g||(M(l.$$.fragment,r),g=!0)},o(r){y(l.$$.fragment,r),g=!1},d(r){f(l,r)}}}function Xe(v){let l,g,r,j,w,C,R,k,I,Z,U,X="Automatic speech recognition (ASR) converts a speech signal to text, mapping a sequence of audio inputs to text outputs. Virtual assistants like Siri and Alexa use ASR models to help users everyday, and there are many other useful user-facing applications like live captioning and note-taking during meetings.",x,$,G="This guide will show you how to:",i,_,E='<li>Finetune <a href="https://huggingface.co/facebook/wav2vec2-base" rel="nofollow">Wav2Vec2</a> on the <a href="https://huggingface.co/datasets/PolyAI/minds14" rel="nofollow">MInDS-14</a> dataset to transcribe audio to text.</li> <li>Use your finetuned model for inference.</li>',B,W,o,J,Xs="Before you begin, make sure you have all the necessary libraries installed:",Ys,Q,Ns,z,Yt="We encourage you to login to your Hugging Face account so you can upload and share your model with the community. When prompted, enter your token to login:",Es,A,Qs,F,zs,q,Nt='Start by loading a smaller subset of the <a href="https://huggingface.co/datasets/PolyAI/minds14" rel="nofollow">MInDS-14</a> dataset from the 🤗 Datasets library. This’ll give you a chance to experiment and make sure everything works before spending more time training on the full dataset.',As,S,Fs,L,Et="Split the dataset’s <code>train</code> split into a train and test set with the <code>~Dataset.train_test_split</code> method:",qs,P,Ss,D,Qt="Then take a look at the dataset:",Ls,K,Ps,O,zt='While the dataset contains a lot of useful information, like <code>lang_id</code> and <code>english_transcription</code>, you’ll focus on the <code>audio</code> and <code>transcription</code> in this guide. Remove the other columns with the <a href="https://huggingface.co/docs/datasets/v2.15.0/en/package_reference/main_classes#datasets.Dataset.remove_columns" rel="nofollow">remove_columns</a> method:',Ds,ss,Ks,ts,At="Take a look at the example again:",Os,es,st,as,Ft="There are two fields:",tt,ls,qt="<li><code>audio</code>: a 1-dimensional <code>array</code> of the speech signal that must be called to load and resample the audio file.</li> <li><code>transcription</code>: the target text.</li>",et,ns,at,ps,St="The next step is to load a Wav2Vec2 processor to process the audio signal:",lt,rs,nt,os,Lt='The MInDS-14 dataset has a sampling rate of 8000kHz (you can find this information in its <a href="https://huggingface.co/datasets/PolyAI/minds14" rel="nofollow">dataset card</a>), which means you’ll need to resample the dataset to 16000kHz to use the pretrained Wav2Vec2 model:',pt,is,rt,cs,Pt="As you can see in the <code>transcription</code> above, the text contains a mix of upper and lowercase characters. The Wav2Vec2 tokenizer is only trained on uppercase characters so you’ll need to make sure the text matches the tokenizer’s vocabulary:",ot,ms,it,hs,Dt="Now create a preprocessing function that:",ct,ds,Kt="<li>Calls the <code>audio</code> column to load and resample the audio file.</li> <li>Extracts the <code>input_values</code> from the audio file and tokenize the <code>transcription</code> column with the processor.</li>",mt,us,ht,Ms,Ot='To apply the preprocessing function over the entire dataset, use 🤗 Datasets <a href="https://huggingface.co/docs/datasets/v2.15.0/en/package_reference/main_classes#datasets.Dataset.map" rel="nofollow">map</a> function. You can speed up <code>map</code> by increasing the number of processes with the <code>num_proc</code> parameter. Remove the columns you don’t need with the <a href="https://huggingface.co/docs/datasets/v2.15.0/en/package_reference/main_classes#datasets.Dataset.remove_columns" rel="nofollow">remove_columns</a> method:',dt,ys,ut,fs,se='🤗 Transformers doesn’t have a data collator for ASR, so you’ll need to adapt the <a href="/docs/transformers/v4.36.0/en/main_classes/data_collator#transformers.DataCollatorWithPadding">DataCollatorWithPadding</a> to create a batch of examples. It’ll also dynamically pad your text and labels to the length of the longest element in its batch (instead of the entire dataset) so they are a uniform length. While it is possible to pad your text in the <code>tokenizer</code> function by setting <code>padding=True</code>, dynamic padding is more efficient.',Mt,gs,te="Unlike other data collators, this specific data collator needs to apply a different padding method to <code>input_values</code> and <code>labels</code>:",yt,js,ft,bs,ee="Now instantiate your <code>DataCollatorForCTCWithPadding</code>:",gt,ws,jt,Js,bt,Ts,ae='Including a metric during training is often helpful for evaluating your model’s performance. You can quickly load a evaluation method with the 🤗 <a href="https://huggingface.co/docs/evaluate/index" rel="nofollow">Evaluate</a> library. For this task, load the <a href="https://huggingface.co/spaces/evaluate-metric/wer" rel="nofollow">word error rate</a> (WER) metric (see the 🤗 Evaluate <a href="https://huggingface.co/docs/evaluate/a_quick_tour" rel="nofollow">quick tour</a> to learn more about how to load and compute a metric):',wt,Us,Jt,$s,le="Then create a function that passes your predictions and labels to <code>compute</code> to calculate the WER:",Tt,_s,Ut,Cs,ne="Your <code>compute_metrics</code> function is ready to go now, and you’ll return to it when you setup your training.",$t,vs,_t,V,Ct,H,vt,Is,It,ks,pe="Great, now that you’ve finetuned a model, you can use it for inference!",kt,Rs,re="Load an audio file you’d like to run inference on. Remember to resample the sampling rate of the audio file to match the sampling rate of the model if you need to!",Rt,Zs,Zt,xs,oe='The simplest way to try out your finetuned model for inference is to use it in a <a href="/docs/transformers/v4.36.0/en/main_classes/pipelines#transformers.pipeline">pipeline()</a>. Instantiate a <code>pipeline</code> for automatic speech recognition with your model, and pass your audio file to it:',xt,Ws,Wt,Y,Gt,Gs,ie="You can also manually replicate the results of the <code>pipeline</code> if you’d like:",Bt,N,Xt,Vs,Vt;return w=new Bs({props:{title:"Automatic speech recognition",local:"automatic-speech-recognition",headingTag:"h1"}}),R=new ve({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/asr.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/pytorch/asr.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/tensorflow/asr.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/asr.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/pytorch/asr.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/tensorflow/asr.ipynb"}]}}),I=new Ce({props:{id:"TksaY_FDgnk"}}),W=new Ht({props:{$$slots:{default:[Ie]},$$scope:{ctx:v}}}),Q=new T({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGUlMjBqaXdlcg==",highlighted:"pip install transformers datasets evaluate jiwer",wrap:!1}}),A=new T({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

<span class="hljs-meta">&gt;&gt;&gt; </span>notebook_login()`,wrap:!1}}),F=new Bs({props:{title:"Load MInDS-14 dataset",local:"load-minds-14-dataset",headingTag:"h2"}}),S=new T({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTJDJTIwQXVkaW8lMEElMEFtaW5kcyUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJQb2x5QUklMkZtaW5kczE0JTIyJTJDJTIwbmFtZSUzRCUyMmVuLVVTJTIyJTJDJTIwc3BsaXQlM0QlMjJ0cmFpbiU1QiUzQTEwMCU1RCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset, Audio

<span class="hljs-meta">&gt;&gt;&gt; </span>minds = load_dataset(<span class="hljs-string">&quot;PolyAI/minds14&quot;</span>, name=<span class="hljs-string">&quot;en-US&quot;</span>, split=<span class="hljs-string">&quot;train[:100]&quot;</span>)`,wrap:!1}}),P=new T({props:{code:"bWluZHMlMjAlM0QlMjBtaW5kcy50cmFpbl90ZXN0X3NwbGl0KHRlc3Rfc2l6ZSUzRDAuMik=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>minds = minds.train_test_split(test_size=<span class="hljs-number">0.2</span>)',wrap:!1}}),K=new T({props:{code:"bWluZHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>minds
DatasetDict({
    train: Dataset({
        features: [<span class="hljs-string">&#x27;path&#x27;</span>, <span class="hljs-string">&#x27;audio&#x27;</span>, <span class="hljs-string">&#x27;transcription&#x27;</span>, <span class="hljs-string">&#x27;english_transcription&#x27;</span>, <span class="hljs-string">&#x27;intent_class&#x27;</span>, <span class="hljs-string">&#x27;lang_id&#x27;</span>],
        num_rows: <span class="hljs-number">16</span>
    })
    test: Dataset({
        features: [<span class="hljs-string">&#x27;path&#x27;</span>, <span class="hljs-string">&#x27;audio&#x27;</span>, <span class="hljs-string">&#x27;transcription&#x27;</span>, <span class="hljs-string">&#x27;english_transcription&#x27;</span>, <span class="hljs-string">&#x27;intent_class&#x27;</span>, <span class="hljs-string">&#x27;lang_id&#x27;</span>],
        num_rows: <span class="hljs-number">4</span>
    })
})`,wrap:!1}}),ss=new T({props:{code:"bWluZHMlMjAlM0QlMjBtaW5kcy5yZW1vdmVfY29sdW1ucyglNUIlMjJlbmdsaXNoX3RyYW5zY3JpcHRpb24lMjIlMkMlMjAlMjJpbnRlbnRfY2xhc3MlMjIlMkMlMjAlMjJsYW5nX2lkJTIyJTVEKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>minds = minds.remove_columns([<span class="hljs-string">&quot;english_transcription&quot;</span>, <span class="hljs-string">&quot;intent_class&quot;</span>, <span class="hljs-string">&quot;lang_id&quot;</span>])',wrap:!1}}),es=new T({props:{code:"bWluZHMlNUIlMjJ0cmFpbiUyMiU1RCU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>minds[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;audio&#x27;</span>: {<span class="hljs-string">&#x27;array&#x27;</span>: array([-<span class="hljs-number">0.00024414</span>,  <span class="hljs-number">0.</span>        ,  <span class="hljs-number">0.</span>        , ...,  <span class="hljs-number">0.00024414</span>,
          <span class="hljs-number">0.00024414</span>,  <span class="hljs-number">0.00024414</span>], dtype=float32),
  <span class="hljs-string">&#x27;path&#x27;</span>: <span class="hljs-string">&#x27;/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~APP_ERROR/602ba9e2963e11ccd901cd4f.wav&#x27;</span>,
  <span class="hljs-string">&#x27;sampling_rate&#x27;</span>: <span class="hljs-number">8000</span>},
 <span class="hljs-string">&#x27;path&#x27;</span>: <span class="hljs-string">&#x27;/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~APP_ERROR/602ba9e2963e11ccd901cd4f.wav&#x27;</span>,
 <span class="hljs-string">&#x27;transcription&#x27;</span>: <span class="hljs-string">&quot;hi I&#x27;m trying to use the banking app on my phone and currently my checking and savings account balance is not refreshing&quot;</span>}`,wrap:!1}}),ns=new Bs({props:{title:"Preprocess",local:"preprocess",headingTag:"h2"}}),rs=new T({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base&quot;</span>)`,wrap:!1}}),is=new T({props:{code:"bWluZHMlMjAlM0QlMjBtaW5kcy5jYXN0X2NvbHVtbiglMjJhdWRpbyUyMiUyQyUyMEF1ZGlvKHNhbXBsaW5nX3JhdGUlM0QxNl8wMDApKSUwQW1pbmRzJTVCJTIydHJhaW4lMjIlNUQlNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>minds = minds.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=<span class="hljs-number">16_000</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>minds[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;audio&#x27;</span>: {<span class="hljs-string">&#x27;array&#x27;</span>: array([-<span class="hljs-number">2.38064706e-04</span>, -<span class="hljs-number">1.58618059e-04</span>, -<span class="hljs-number">5.43987835e-06</span>, ...,
          <span class="hljs-number">2.78103951e-04</span>,  <span class="hljs-number">2.38446111e-04</span>,  <span class="hljs-number">1.18740834e-04</span>], dtype=float32),
  <span class="hljs-string">&#x27;path&#x27;</span>: <span class="hljs-string">&#x27;/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~APP_ERROR/602ba9e2963e11ccd901cd4f.wav&#x27;</span>,
  <span class="hljs-string">&#x27;sampling_rate&#x27;</span>: <span class="hljs-number">16000</span>},
 <span class="hljs-string">&#x27;path&#x27;</span>: <span class="hljs-string">&#x27;/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~APP_ERROR/602ba9e2963e11ccd901cd4f.wav&#x27;</span>,
 <span class="hljs-string">&#x27;transcription&#x27;</span>: <span class="hljs-string">&quot;hi I&#x27;m trying to use the banking app on my phone and currently my checking and savings account balance is not refreshing&quot;</span>}`,wrap:!1}}),ms=new T({props:{code:"ZGVmJTIwdXBwZXJjYXNlKGV4YW1wbGUpJTNBJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCJTIydHJhbnNjcmlwdGlvbiUyMiUzQSUyMGV4YW1wbGUlNUIlMjJ0cmFuc2NyaXB0aW9uJTIyJTVELnVwcGVyKCklN0QlMEElMEElMEFtaW5kcyUyMCUzRCUyMG1pbmRzLm1hcCh1cHBlcmNhc2Up",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">uppercase</span>(<span class="hljs-params">example</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;transcription&quot;</span>: example[<span class="hljs-string">&quot;transcription&quot;</span>].upper()}


<span class="hljs-meta">&gt;&gt;&gt; </span>minds = minds.<span class="hljs-built_in">map</span>(uppercase)`,wrap:!1}}),us=new T({props:{code:"ZGVmJTIwcHJlcGFyZV9kYXRhc2V0KGJhdGNoKSUzQSUwQSUyMCUyMCUyMCUyMGF1ZGlvJTIwJTNEJTIwYmF0Y2glNUIlMjJhdWRpbyUyMiU1RCUwQSUyMCUyMCUyMCUyMGJhdGNoJTIwJTNEJTIwcHJvY2Vzc29yKGF1ZGlvJTVCJTIyYXJyYXklMjIlNUQlMkMlMjBzYW1wbGluZ19yYXRlJTNEYXVkaW8lNUIlMjJzYW1wbGluZ19yYXRlJTIyJTVEJTJDJTIwdGV4dCUzRGJhdGNoJTVCJTIydHJhbnNjcmlwdGlvbiUyMiU1RCklMEElMjAlMjAlMjAlMjBiYXRjaCU1QiUyMmlucHV0X2xlbmd0aCUyMiU1RCUyMCUzRCUyMGxlbihiYXRjaCU1QiUyMmlucHV0X3ZhbHVlcyUyMiU1RCU1QjAlNUQpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2g=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">prepare_dataset</span>(<span class="hljs-params">batch</span>):
<span class="hljs-meta">... </span>    audio = batch[<span class="hljs-string">&quot;audio&quot;</span>]
<span class="hljs-meta">... </span>    batch = processor(audio[<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=audio[<span class="hljs-string">&quot;sampling_rate&quot;</span>], text=batch[<span class="hljs-string">&quot;transcription&quot;</span>])
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;input_length&quot;</span>] = <span class="hljs-built_in">len</span>(batch[<span class="hljs-string">&quot;input_values&quot;</span>][<span class="hljs-number">0</span>])
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch`,wrap:!1}}),ys=new T({props:{code:"ZW5jb2RlZF9taW5kcyUyMCUzRCUyMG1pbmRzLm1hcChwcmVwYXJlX2RhdGFzZXQlMkMlMjByZW1vdmVfY29sdW1ucyUzRG1pbmRzLmNvbHVtbl9uYW1lcyU1QiUyMnRyYWluJTIyJTVEJTJDJTIwbnVtX3Byb2MlM0Q0KQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>encoded_minds = minds.<span class="hljs-built_in">map</span>(prepare_dataset, remove_columns=minds.column_names[<span class="hljs-string">&quot;train&quot;</span>], num_proc=<span class="hljs-number">4</span>)',wrap:!1}}),js=new T({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFmcm9tJTIwZGF0YWNsYXNzZXMlMjBpbXBvcnQlMjBkYXRhY2xhc3MlMkMlMjBmaWVsZCUwQWZyb20lMjB0eXBpbmclMjBpbXBvcnQlMjBBbnklMkMlMjBEaWN0JTJDJTIwTGlzdCUyQyUyME9wdGlvbmFsJTJDJTIwVW5pb24lMEElMEElMEElNDBkYXRhY2xhc3MlMEFjbGFzcyUyMERhdGFDb2xsYXRvckNUQ1dpdGhQYWRkaW5nJTNBJTBBJTIwJTIwJTIwJTIwcHJvY2Vzc29yJTNBJTIwQXV0b1Byb2Nlc3NvciUwQSUyMCUyMCUyMCUyMHBhZGRpbmclM0ElMjBVbmlvbiU1QmJvb2wlMkMlMjBzdHIlNUQlMjAlM0QlMjAlMjJsb25nZXN0JTIyJTBBJTBBJTIwJTIwJTIwJTIwZGVmJTIwX19jYWxsX18oc2VsZiUyQyUyMGZlYXR1cmVzJTNBJTIwTGlzdCU1QkRpY3QlNUJzdHIlMkMlMjBVbmlvbiU1Qkxpc3QlNUJpbnQlNUQlMkMlMjB0b3JjaC5UZW5zb3IlNUQlNUQlNUQpJTIwLSUzRSUyMERpY3QlNUJzdHIlMkMlMjB0b3JjaC5UZW5zb3IlNUQlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBzcGxpdCUyMGlucHV0cyUyMGFuZCUyMGxhYmVscyUyMHNpbmNlJTIwdGhleSUyMGhhdmUlMjB0byUyMGJlJTIwb2YlMjBkaWZmZXJlbnQlMjBsZW5ndGhzJTIwYW5kJTIwbmVlZCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMyUyMGRpZmZlcmVudCUyMHBhZGRpbmclMjBtZXRob2RzJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaW5wdXRfZmVhdHVyZXMlMjAlM0QlMjAlNUIlN0IlMjJpbnB1dF92YWx1ZXMlMjIlM0ElMjBmZWF0dXJlJTVCJTIyaW5wdXRfdmFsdWVzJTIyJTVEJTVCMCU1RCU3RCUyMGZvciUyMGZlYXR1cmUlMjBpbiUyMGZlYXR1cmVzJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbGFiZWxfZmVhdHVyZXMlMjAlM0QlMjAlNUIlN0IlMjJpbnB1dF9pZHMlMjIlM0ElMjBmZWF0dXJlJTVCJTIybGFiZWxzJTIyJTVEJTdEJTIwZm9yJTIwZmVhdHVyZSUyMGluJTIwZmVhdHVyZXMlNUQlMEElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBiYXRjaCUyMCUzRCUyMHNlbGYucHJvY2Vzc29yLnBhZChpbnB1dF9mZWF0dXJlcyUyQyUyMHBhZGRpbmclM0RzZWxmLnBhZGRpbmclMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxhYmVsc19iYXRjaCUyMCUzRCUyMHNlbGYucHJvY2Vzc29yLnBhZChsYWJlbHMlM0RsYWJlbF9mZWF0dXJlcyUyQyUyMHBhZGRpbmclM0RzZWxmLnBhZGRpbmclMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMyUyMHJlcGxhY2UlMjBwYWRkaW5nJTIwd2l0aCUyMC0xMDAlMjB0byUyMGlnbm9yZSUyMGxvc3MlMjBjb3JyZWN0bHklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsYWJlbHMlMjAlM0QlMjBsYWJlbHNfYmF0Y2glNUIlMjJpbnB1dF9pZHMlMjIlNUQubWFza2VkX2ZpbGwobGFiZWxzX2JhdGNoLmF0dGVudGlvbl9tYXNrLm5lKDEpJTJDJTIwLTEwMCklMEElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBiYXRjaCU1QiUyMmxhYmVscyUyMiU1RCUyMCUzRCUyMGxhYmVscyUwQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMGJhdGNo",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> dataclass, field
<span class="hljs-meta">&gt;&gt;&gt; </span><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">Optional</span>, <span class="hljs-type">Union</span>


<span class="hljs-meta">&gt;&gt;&gt; </span>@dataclass
<span class="hljs-meta">... </span><span class="hljs-keyword">class</span> <span class="hljs-title class_">DataCollatorCTCWithPadding</span>:
<span class="hljs-meta">... </span>    processor: AutoProcessor
<span class="hljs-meta">... </span>    padding: <span class="hljs-type">Union</span>[<span class="hljs-built_in">bool</span>, <span class="hljs-built_in">str</span>] = <span class="hljs-string">&quot;longest&quot;</span>

<span class="hljs-meta">... </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]:
<span class="hljs-meta">... </span>        <span class="hljs-comment"># split inputs and labels since they have to be of different lengths and need</span>
<span class="hljs-meta">... </span>        <span class="hljs-comment"># different padding methods</span>
<span class="hljs-meta">... </span>        input_features = [{<span class="hljs-string">&quot;input_values&quot;</span>: feature[<span class="hljs-string">&quot;input_values&quot;</span>][<span class="hljs-number">0</span>]} <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> features]
<span class="hljs-meta">... </span>        label_features = [{<span class="hljs-string">&quot;input_ids&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]

<span class="hljs-meta">... </span>        batch = self.processor.pad(input_features, padding=self.padding, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">... </span>        labels_batch = self.processor.pad(labels=label_features, padding=self.padding, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">... </span>        batch[<span class="hljs-string">&quot;labels&quot;</span>] = labels

<span class="hljs-meta">... </span>        <span class="hljs-keyword">return</span> batch`,wrap:!1}}),ws=new T({props:{code:"ZGF0YV9jb2xsYXRvciUyMCUzRCUyMERhdGFDb2xsYXRvckNUQ1dpdGhQYWRkaW5nKHByb2Nlc3NvciUzRHByb2Nlc3NvciUyQyUyMHBhZGRpbmclM0QlMjJsb25nZXN0JTIyKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorCTCWithPadding(processor=processor, padding=<span class="hljs-string">&quot;longest&quot;</span>)',wrap:!1}}),Js=new Bs({props:{title:"Evaluate",local:"evaluate",headingTag:"h2"}}),Us=new T({props:{code:"aW1wb3J0JTIwZXZhbHVhdGUlMEElMEF3ZXIlMjAlM0QlMjBldmFsdWF0ZS5sb2FkKCUyMndlciUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> evaluate

<span class="hljs-meta">&gt;&gt;&gt; </span>wer = evaluate.load(<span class="hljs-string">&quot;wer&quot;</span>)`,wrap:!1}}),_s=new T({props:{code:"aW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBJTBBZGVmJTIwY29tcHV0ZV9tZXRyaWNzKHByZWQpJTNBJTBBJTIwJTIwJTIwJTIwcHJlZF9sb2dpdHMlMjAlM0QlMjBwcmVkLnByZWRpY3Rpb25zJTBBJTIwJTIwJTIwJTIwcHJlZF9pZHMlMjAlM0QlMjBucC5hcmdtYXgocHJlZF9sb2dpdHMlMkMlMjBheGlzJTNELTEpJTBBJTBBJTIwJTIwJTIwJTIwcHJlZC5sYWJlbF9pZHMlNUJwcmVkLmxhYmVsX2lkcyUyMCUzRCUzRCUyMC0xMDAlNUQlMjAlM0QlMjBwcm9jZXNzb3IudG9rZW5pemVyLnBhZF90b2tlbl9pZCUwQSUwQSUyMCUyMCUyMCUyMHByZWRfc3RyJTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShwcmVkX2lkcyklMEElMjAlMjAlMjAlMjBsYWJlbF9zdHIlMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKHByZWQubGFiZWxfaWRzJTJDJTIwZ3JvdXBfdG9rZW5zJTNERmFsc2UpJTBBJTBBJTIwJTIwJTIwJTIwd2VyJTIwJTNEJTIwd2VyLmNvbXB1dGUocHJlZGljdGlvbnMlM0RwcmVkX3N0ciUyQyUyMHJlZmVyZW5jZXMlM0RsYWJlbF9zdHIpJTBBJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCJTIyd2VyJTIyJTNBJTIwd2VyJTdE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">compute_metrics</span>(<span class="hljs-params">pred</span>):
<span class="hljs-meta">... </span>    pred_logits = pred.predictions
<span class="hljs-meta">... </span>    pred_ids = np.argmax(pred_logits, axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">... </span>    pred.label_ids[pred.label_ids == -<span class="hljs-number">100</span>] = processor.tokenizer.pad_token_id

<span class="hljs-meta">... </span>    pred_str = processor.batch_decode(pred_ids)
<span class="hljs-meta">... </span>    label_str = processor.batch_decode(pred.label_ids, group_tokens=<span class="hljs-literal">False</span>)

<span class="hljs-meta">... </span>    wer = wer.compute(predictions=pred_str, references=label_str)

<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;wer&quot;</span>: wer}`,wrap:!1}}),vs=new Bs({props:{title:"Train",local:"train",headingTag:"h2"}}),V=new fe({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[Ze]},$$scope:{ctx:v}}}),H=new Ht({props:{$$slots:{default:[xe]},$$scope:{ctx:v}}}),Is=new Bs({props:{title:"Inference",local:"inference",headingTag:"h2"}}),Zs=new T({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTJDJTIwQXVkaW8lMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMlBvbHlBSSUyRm1pbmRzMTQlMjIlMkMlMjAlMjJlbi1VUyUyMiUyQyUyMHNwbGl0JTNEJTIydHJhaW4lMjIpJTBBZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQuY2FzdF9jb2x1bW4oJTIyYXVkaW8lMjIlMkMlMjBBdWRpbyhzYW1wbGluZ19yYXRlJTNEMTYwMDApKSUwQXNhbXBsaW5nX3JhdGUlMjAlM0QlMjBkYXRhc2V0LmZlYXR1cmVzJTVCJTIyYXVkaW8lMjIlNUQuc2FtcGxpbmdfcmF0ZSUwQWF1ZGlvX2ZpbGUlMjAlM0QlMjBkYXRhc2V0JTVCMCU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIycGF0aCUyMiU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset, Audio

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;PolyAI/minds14&quot;</span>, <span class="hljs-string">&quot;en-US&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=<span class="hljs-number">16000</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate
<span class="hljs-meta">&gt;&gt;&gt; </span>audio_file = dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;path&quot;</span>]`,wrap:!1}}),Ws=new T({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBdHJhbnNjcmliZXIlMjAlM0QlMjBwaXBlbGluZSglMjJhdXRvbWF0aWMtc3BlZWNoLXJlY29nbml0aW9uJTIyJTJDJTIwbW9kZWwlM0QlMjJzdGV2aGxpdSUyRm15X2F3ZXNvbWVfYXNyX21pbmRzX21vZGVsJTIyKSUwQXRyYW5zY3JpYmVyKGF1ZGlvX2ZpbGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>transcriber = pipeline(<span class="hljs-string">&quot;automatic-speech-recognition&quot;</span>, model=<span class="hljs-string">&quot;stevhliu/my_awesome_asr_minds_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcriber(audio_file)
{<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;I WOUD LIKE O SET UP JOINT ACOUNT WTH Y PARTNER&#x27;</span>}`,wrap:!1}}),Y=new Ht({props:{$$slots:{default:[We]},$$scope:{ctx:v}}}),N=new fe({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[Be]},$$scope:{ctx:v}}}),{c(){l=c("meta"),g=n(),r=c("p"),j=n(),h(w.$$.fragment),C=n(),h(R.$$.fragment),k=n(),h(I.$$.fragment),Z=n(),U=c("p"),U.textContent=X,x=n(),$=c("p"),$.textContent=G,i=n(),_=c("ol"),_.innerHTML=E,B=n(),h(W.$$.fragment),o=n(),J=c("p"),J.textContent=Xs,Ys=n(),h(Q.$$.fragment),Ns=n(),z=c("p"),z.textContent=Yt,Es=n(),h(A.$$.fragment),Qs=n(),h(F.$$.fragment),zs=n(),q=c("p"),q.innerHTML=Nt,As=n(),h(S.$$.fragment),Fs=n(),L=c("p"),L.innerHTML=Et,qs=n(),h(P.$$.fragment),Ss=n(),D=c("p"),D.textContent=Qt,Ls=n(),h(K.$$.fragment),Ps=n(),O=c("p"),O.innerHTML=zt,Ds=n(),h(ss.$$.fragment),Ks=n(),ts=c("p"),ts.textContent=At,Os=n(),h(es.$$.fragment),st=n(),as=c("p"),as.textContent=Ft,tt=n(),ls=c("ul"),ls.innerHTML=qt,et=n(),h(ns.$$.fragment),at=n(),ps=c("p"),ps.textContent=St,lt=n(),h(rs.$$.fragment),nt=n(),os=c("p"),os.innerHTML=Lt,pt=n(),h(is.$$.fragment),rt=n(),cs=c("p"),cs.innerHTML=Pt,ot=n(),h(ms.$$.fragment),it=n(),hs=c("p"),hs.textContent=Dt,ct=n(),ds=c("ol"),ds.innerHTML=Kt,mt=n(),h(us.$$.fragment),ht=n(),Ms=c("p"),Ms.innerHTML=Ot,dt=n(),h(ys.$$.fragment),ut=n(),fs=c("p"),fs.innerHTML=se,Mt=n(),gs=c("p"),gs.innerHTML=te,yt=n(),h(js.$$.fragment),ft=n(),bs=c("p"),bs.innerHTML=ee,gt=n(),h(ws.$$.fragment),jt=n(),h(Js.$$.fragment),bt=n(),Ts=c("p"),Ts.innerHTML=ae,wt=n(),h(Us.$$.fragment),Jt=n(),$s=c("p"),$s.innerHTML=le,Tt=n(),h(_s.$$.fragment),Ut=n(),Cs=c("p"),Cs.innerHTML=ne,$t=n(),h(vs.$$.fragment),_t=n(),h(V.$$.fragment),Ct=n(),h(H.$$.fragment),vt=n(),h(Is.$$.fragment),It=n(),ks=c("p"),ks.textContent=pe,kt=n(),Rs=c("p"),Rs.textContent=re,Rt=n(),h(Zs.$$.fragment),Zt=n(),xs=c("p"),xs.innerHTML=oe,xt=n(),h(Ws.$$.fragment),Wt=n(),h(Y.$$.fragment),Gt=n(),Gs=c("p"),Gs.innerHTML=ie,Bt=n(),h(N.$$.fragment),Xt=n(),Vs=c("p"),this.h()},l(s){const t=Te("svelte-u9bgzb",document.head);l=m(t,"META",{name:!0,content:!0}),t.forEach(e),g=p(s),r=m(s,"P",{}),Me(r).forEach(e),j=p(s),d(w.$$.fragment,s),C=p(s),d(R.$$.fragment,s),k=p(s),d(I.$$.fragment,s),Z=p(s),U=m(s,"P",{"data-svelte-h":!0}),b(U)!=="svelte-jaigob"&&(U.textContent=X),x=p(s),$=m(s,"P",{"data-svelte-h":!0}),b($)!=="svelte-1aff4p7"&&($.textContent=G),i=p(s),_=m(s,"OL",{"data-svelte-h":!0}),b(_)!=="svelte-swvwb8"&&(_.innerHTML=E),B=p(s),d(W.$$.fragment,s),o=p(s),J=m(s,"P",{"data-svelte-h":!0}),b(J)!=="svelte-1c9nexd"&&(J.textContent=Xs),Ys=p(s),d(Q.$$.fragment,s),Ns=p(s),z=m(s,"P",{"data-svelte-h":!0}),b(z)!=="svelte-k76o1m"&&(z.textContent=Yt),Es=p(s),d(A.$$.fragment,s),Qs=p(s),d(F.$$.fragment,s),zs=p(s),q=m(s,"P",{"data-svelte-h":!0}),b(q)!=="svelte-17q5vds"&&(q.innerHTML=Nt),As=p(s),d(S.$$.fragment,s),Fs=p(s),L=m(s,"P",{"data-svelte-h":!0}),b(L)!=="svelte-1mnfdd3"&&(L.innerHTML=Et),qs=p(s),d(P.$$.fragment,s),Ss=p(s),D=m(s,"P",{"data-svelte-h":!0}),b(D)!=="svelte-2twqg0"&&(D.textContent=Qt),Ls=p(s),d(K.$$.fragment,s),Ps=p(s),O=m(s,"P",{"data-svelte-h":!0}),b(O)!=="svelte-tbsdf8"&&(O.innerHTML=zt),Ds=p(s),d(ss.$$.fragment,s),Ks=p(s),ts=m(s,"P",{"data-svelte-h":!0}),b(ts)!=="svelte-kucdg1"&&(ts.textContent=At),Os=p(s),d(es.$$.fragment,s),st=p(s),as=m(s,"P",{"data-svelte-h":!0}),b(as)!=="svelte-bf7elb"&&(as.textContent=Ft),tt=p(s),ls=m(s,"UL",{"data-svelte-h":!0}),b(ls)!=="svelte-k1dj8f"&&(ls.innerHTML=qt),et=p(s),d(ns.$$.fragment,s),at=p(s),ps=m(s,"P",{"data-svelte-h":!0}),b(ps)!=="svelte-1u4mmu7"&&(ps.textContent=St),lt=p(s),d(rs.$$.fragment,s),nt=p(s),os=m(s,"P",{"data-svelte-h":!0}),b(os)!=="svelte-yrxfgz"&&(os.innerHTML=Lt),pt=p(s),d(is.$$.fragment,s),rt=p(s),cs=m(s,"P",{"data-svelte-h":!0}),b(cs)!=="svelte-w66yza"&&(cs.innerHTML=Pt),ot=p(s),d(ms.$$.fragment,s),it=p(s),hs=m(s,"P",{"data-svelte-h":!0}),b(hs)!=="svelte-8cflje"&&(hs.textContent=Dt),ct=p(s),ds=m(s,"OL",{"data-svelte-h":!0}),b(ds)!=="svelte-1ydcdgg"&&(ds.innerHTML=Kt),mt=p(s),d(us.$$.fragment,s),ht=p(s),Ms=m(s,"P",{"data-svelte-h":!0}),b(Ms)!=="svelte-12024ga"&&(Ms.innerHTML=Ot),dt=p(s),d(ys.$$.fragment,s),ut=p(s),fs=m(s,"P",{"data-svelte-h":!0}),b(fs)!=="svelte-jpuoo1"&&(fs.innerHTML=se),Mt=p(s),gs=m(s,"P",{"data-svelte-h":!0}),b(gs)!=="svelte-ik80vf"&&(gs.innerHTML=te),yt=p(s),d(js.$$.fragment,s),ft=p(s),bs=m(s,"P",{"data-svelte-h":!0}),b(bs)!=="svelte-hven70"&&(bs.innerHTML=ee),gt=p(s),d(ws.$$.fragment,s),jt=p(s),d(Js.$$.fragment,s),bt=p(s),Ts=m(s,"P",{"data-svelte-h":!0}),b(Ts)!=="svelte-od28ug"&&(Ts.innerHTML=ae),wt=p(s),d(Us.$$.fragment,s),Jt=p(s),$s=m(s,"P",{"data-svelte-h":!0}),b($s)!=="svelte-e7o2au"&&($s.innerHTML=le),Tt=p(s),d(_s.$$.fragment,s),Ut=p(s),Cs=m(s,"P",{"data-svelte-h":!0}),b(Cs)!=="svelte-183aynn"&&(Cs.innerHTML=ne),$t=p(s),d(vs.$$.fragment,s),_t=p(s),d(V.$$.fragment,s),Ct=p(s),d(H.$$.fragment,s),vt=p(s),d(Is.$$.fragment,s),It=p(s),ks=m(s,"P",{"data-svelte-h":!0}),b(ks)!=="svelte-633ppb"&&(ks.textContent=pe),kt=p(s),Rs=m(s,"P",{"data-svelte-h":!0}),b(Rs)!=="svelte-1j24vrm"&&(Rs.textContent=re),Rt=p(s),d(Zs.$$.fragment,s),Zt=p(s),xs=m(s,"P",{"data-svelte-h":!0}),b(xs)!=="svelte-1893zx"&&(xs.innerHTML=oe),xt=p(s),d(Ws.$$.fragment,s),Wt=p(s),d(Y.$$.fragment,s),Gt=p(s),Gs=m(s,"P",{"data-svelte-h":!0}),b(Gs)!=="svelte-1njl8vm"&&(Gs.innerHTML=ie),Bt=p(s),d(N.$$.fragment,s),Xt=p(s),Vs=m(s,"P",{}),Me(Vs).forEach(e),this.h()},h(){ye(l,"name","hf:doc:metadata"),ye(l,"content",Ve)},m(s,t){Ue(document.head,l),a(s,g,t),a(s,r,t),a(s,j,t),u(w,s,t),a(s,C,t),u(R,s,t),a(s,k,t),u(I,s,t),a(s,Z,t),a(s,U,t),a(s,x,t),a(s,$,t),a(s,i,t),a(s,_,t),a(s,B,t),u(W,s,t),a(s,o,t),a(s,J,t),a(s,Ys,t),u(Q,s,t),a(s,Ns,t),a(s,z,t),a(s,Es,t),u(A,s,t),a(s,Qs,t),u(F,s,t),a(s,zs,t),a(s,q,t),a(s,As,t),u(S,s,t),a(s,Fs,t),a(s,L,t),a(s,qs,t),u(P,s,t),a(s,Ss,t),a(s,D,t),a(s,Ls,t),u(K,s,t),a(s,Ps,t),a(s,O,t),a(s,Ds,t),u(ss,s,t),a(s,Ks,t),a(s,ts,t),a(s,Os,t),u(es,s,t),a(s,st,t),a(s,as,t),a(s,tt,t),a(s,ls,t),a(s,et,t),u(ns,s,t),a(s,at,t),a(s,ps,t),a(s,lt,t),u(rs,s,t),a(s,nt,t),a(s,os,t),a(s,pt,t),u(is,s,t),a(s,rt,t),a(s,cs,t),a(s,ot,t),u(ms,s,t),a(s,it,t),a(s,hs,t),a(s,ct,t),a(s,ds,t),a(s,mt,t),u(us,s,t),a(s,ht,t),a(s,Ms,t),a(s,dt,t),u(ys,s,t),a(s,ut,t),a(s,fs,t),a(s,Mt,t),a(s,gs,t),a(s,yt,t),u(js,s,t),a(s,ft,t),a(s,bs,t),a(s,gt,t),u(ws,s,t),a(s,jt,t),u(Js,s,t),a(s,bt,t),a(s,Ts,t),a(s,wt,t),u(Us,s,t),a(s,Jt,t),a(s,$s,t),a(s,Tt,t),u(_s,s,t),a(s,Ut,t),a(s,Cs,t),a(s,$t,t),u(vs,s,t),a(s,_t,t),u(V,s,t),a(s,Ct,t),u(H,s,t),a(s,vt,t),u(Is,s,t),a(s,It,t),a(s,ks,t),a(s,kt,t),a(s,Rs,t),a(s,Rt,t),u(Zs,s,t),a(s,Zt,t),a(s,xs,t),a(s,xt,t),u(Ws,s,t),a(s,Wt,t),u(Y,s,t),a(s,Gt,t),a(s,Gs,t),a(s,Bt,t),u(N,s,t),a(s,Xt,t),a(s,Vs,t),Vt=!0},p(s,[t]){const ce={};t&2&&(ce.$$scope={dirty:t,ctx:s}),W.$set(ce);const me={};t&2&&(me.$$scope={dirty:t,ctx:s}),V.$set(me);const he={};t&2&&(he.$$scope={dirty:t,ctx:s}),H.$set(he);const de={};t&2&&(de.$$scope={dirty:t,ctx:s}),Y.$set(de);const ue={};t&2&&(ue.$$scope={dirty:t,ctx:s}),N.$set(ue)},i(s){Vt||(M(w.$$.fragment,s),M(R.$$.fragment,s),M(I.$$.fragment,s),M(W.$$.fragment,s),M(Q.$$.fragment,s),M(A.$$.fragment,s),M(F.$$.fragment,s),M(S.$$.fragment,s),M(P.$$.fragment,s),M(K.$$.fragment,s),M(ss.$$.fragment,s),M(es.$$.fragment,s),M(ns.$$.fragment,s),M(rs.$$.fragment,s),M(is.$$.fragment,s),M(ms.$$.fragment,s),M(us.$$.fragment,s),M(ys.$$.fragment,s),M(js.$$.fragment,s),M(ws.$$.fragment,s),M(Js.$$.fragment,s),M(Us.$$.fragment,s),M(_s.$$.fragment,s),M(vs.$$.fragment,s),M(V.$$.fragment,s),M(H.$$.fragment,s),M(Is.$$.fragment,s),M(Zs.$$.fragment,s),M(Ws.$$.fragment,s),M(Y.$$.fragment,s),M(N.$$.fragment,s),Vt=!0)},o(s){y(w.$$.fragment,s),y(R.$$.fragment,s),y(I.$$.fragment,s),y(W.$$.fragment,s),y(Q.$$.fragment,s),y(A.$$.fragment,s),y(F.$$.fragment,s),y(S.$$.fragment,s),y(P.$$.fragment,s),y(K.$$.fragment,s),y(ss.$$.fragment,s),y(es.$$.fragment,s),y(ns.$$.fragment,s),y(rs.$$.fragment,s),y(is.$$.fragment,s),y(ms.$$.fragment,s),y(us.$$.fragment,s),y(ys.$$.fragment,s),y(js.$$.fragment,s),y(ws.$$.fragment,s),y(Js.$$.fragment,s),y(Us.$$.fragment,s),y(_s.$$.fragment,s),y(vs.$$.fragment,s),y(V.$$.fragment,s),y(H.$$.fragment,s),y(Is.$$.fragment,s),y(Zs.$$.fragment,s),y(Ws.$$.fragment,s),y(Y.$$.fragment,s),y(N.$$.fragment,s),Vt=!1},d(s){s&&(e(g),e(r),e(j),e(C),e(k),e(Z),e(U),e(x),e($),e(i),e(_),e(B),e(o),e(J),e(Ys),e(Ns),e(z),e(Es),e(Qs),e(zs),e(q),e(As),e(Fs),e(L),e(qs),e(Ss),e(D),e(Ls),e(Ps),e(O),e(Ds),e(Ks),e(ts),e(Os),e(st),e(as),e(tt),e(ls),e(et),e(at),e(ps),e(lt),e(nt),e(os),e(pt),e(rt),e(cs),e(ot),e(it),e(hs),e(ct),e(ds),e(mt),e(ht),e(Ms),e(dt),e(ut),e(fs),e(Mt),e(gs),e(yt),e(ft),e(bs),e(gt),e(jt),e(bt),e(Ts),e(wt),e(Jt),e($s),e(Tt),e(Ut),e(Cs),e($t),e(_t),e(Ct),e(vt),e(It),e(ks),e(kt),e(Rs),e(Rt),e(Zt),e(xs),e(xt),e(Wt),e(Gt),e(Gs),e(Bt),e(Xt),e(Vs)),e(l),f(w,s),f(R,s),f(I,s),f(W,s),f(Q,s),f(A,s),f(F,s),f(S,s),f(P,s),f(K,s),f(ss,s),f(es,s),f(ns,s),f(rs,s),f(is,s),f(ms,s),f(us,s),f(ys,s),f(js,s),f(ws,s),f(Js,s),f(Us,s),f(_s,s),f(vs,s),f(V,s),f(H,s),f(Is,s),f(Zs,s),f(Ws,s),f(Y,s),f(N,s)}}}const Ve='{"title":"Automatic speech recognition","local":"automatic-speech-recognition","sections":[{"title":"Load MInDS-14 dataset","local":"load-minds-14-dataset","sections":[],"depth":2},{"title":"Preprocess","local":"preprocess","sections":[],"depth":2},{"title":"Evaluate","local":"evaluate","sections":[],"depth":2},{"title":"Train","local":"train","sections":[],"depth":2},{"title":"Inference","local":"inference","sections":[],"depth":2}],"depth":1}';function He(v){return be(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Se extends we{constructor(l){super(),Je(this,l,He,Xe,je,{})}}export{Se as component};
