import{s as D,n as X,o as O}from"../chunks/scheduler.f7e1785c.js";import{S as Q,i as V,g as l,s as a,r as P,A as K,h as r,f as s,c as i,j as Z,u as k,x as g,k as Y,y as ee,a as n,v as B,d as W,t as j,w as F}from"../chunks/index.9f8f0838.js";import{C as te}from"../chunks/CodeBlock.b3510e34.js";import{H as se,E as ne}from"../chunks/EditOnGithub.5a9bb8c5.js";function ae(L){let o,v,y,x,u,_,m,A=`In this unit, we explored the challenges of fine-tuning ASR models, acknowledging the time and resources required to
fine-tune a model like Whisper (even a small checkpoint) on a new language. To provide a hands-on experience, we have
designed an exercise that allows you to navigate the process of fine-tuning an ASR model while using a smaller dataset.
The main goal of this exercise is to familiarize you with the process rather than expecting production-level results.
We have intentionally set a low metric to ensure that even with limited resources, you should be able to achieve it.`,I,c,S="Here are the instructions:",$,d,z="<li>Fine-tune the <code>”openai/whisper-tiny”</code> model using the American English (“en-US”) subset of the <code>”PolyAI/minds14”</code> dataset.</li> <li>Use the first <strong>450 examples for training</strong>, and the rest for evaluation. Ensure you set <code>num_proc=1</code> when pre-processing the dataset using the <code>.map</code> method (this will ensure your model is submitted correctly for assessment).</li> <li>To evaluate the model, use the <code>wer</code> and <code>wer_ortho</code> metrics as described in this Unit. However, <em>do not</em> convert the metric into percentages by multiplying by 100 (E.g. if WER is 42%, we’ll expect to see the value of 0.42 in this exercise).</li>",b,p,G="Once you have fine-tuned a model, make sure to upload it to the 🤗 Hub with the following <code>kwargs</code>:",C,h,M,f,N="You will pass this assignment if your model’s normalised WER (<code>wer</code>) is lower than <strong>0.37</strong>.",q,w,R="Feel free to build a demo of your model, and share it on Discord! If you have questions, post them in the #audio-study-group channel.",U,T,E,J,H;return u=new se({props:{title:"Hands-on exercise",local:"hands-on-exercise",headingTag:"h1"}}),h=new te({props:{code:"a3dhcmdzJTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIyZGF0YXNldF90YWdzJTIyJTNBJTIwJTIyUG9seUFJJTJGbWluZHMxNCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMmZpbmV0dW5lZF9mcm9tJTIyJTNBJTIwJTIyb3BlbmFpJTJGd2hpc3Blci10aW55JTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIydGFza3MlMjIlM0ElMjAlMjJhdXRvbWF0aWMtc3BlZWNoLXJlY29nbml0aW9uJTIyJTJDJTBBJTdE",highlighted:`<span class="hljs-attribute">kwargs</span> = {
     <span class="hljs-string">&quot;dataset_tags&quot;</span>: <span class="hljs-string">&quot;PolyAI/minds14&quot;</span>,
    <span class="hljs-string">&quot;finetuned_from&quot;</span>: <span class="hljs-string">&quot;openai/whisper-tiny&quot;</span>,
    <span class="hljs-string">&quot;tasks&quot;</span>: <span class="hljs-string">&quot;automatic-speech-recognition&quot;</span>,
}`,wrap:!1}}),T=new ne({props:{source:"https://github.com/huggingface/audio-transformers-course/blob/main/chapters/en/chapter5/hands_on.mdx"}}),{c(){o=l("meta"),v=a(),y=l("p"),x=a(),P(u.$$.fragment),_=a(),m=l("p"),m.textContent=A,I=a(),c=l("p"),c.textContent=S,$=a(),d=l("ul"),d.innerHTML=z,b=a(),p=l("p"),p.innerHTML=G,C=a(),P(h.$$.fragment),M=a(),f=l("p"),f.innerHTML=N,q=a(),w=l("p"),w.textContent=R,U=a(),P(T.$$.fragment),E=a(),J=l("p"),this.h()},l(e){const t=K("svelte-u9bgzb",document.head);o=r(t,"META",{name:!0,content:!0}),t.forEach(s),v=i(e),y=r(e,"P",{}),Z(y).forEach(s),x=i(e),k(u.$$.fragment,e),_=i(e),m=r(e,"P",{"data-svelte-h":!0}),g(m)!=="svelte-x2tvlr"&&(m.textContent=A),I=i(e),c=r(e,"P",{"data-svelte-h":!0}),g(c)!=="svelte-acxoy6"&&(c.textContent=S),$=i(e),d=r(e,"UL",{"data-svelte-h":!0}),g(d)!=="svelte-14v5kzw"&&(d.innerHTML=z),b=i(e),p=r(e,"P",{"data-svelte-h":!0}),g(p)!=="svelte-1p3fyil"&&(p.innerHTML=G),C=i(e),k(h.$$.fragment,e),M=i(e),f=r(e,"P",{"data-svelte-h":!0}),g(f)!=="svelte-i4linb"&&(f.innerHTML=N),q=i(e),w=r(e,"P",{"data-svelte-h":!0}),g(w)!=="svelte-1vc7edk"&&(w.textContent=R),U=i(e),k(T.$$.fragment,e),E=i(e),J=r(e,"P",{}),Z(J).forEach(s),this.h()},h(){Y(o,"name","hf:doc:metadata"),Y(o,"content",ie)},m(e,t){ee(document.head,o),n(e,v,t),n(e,y,t),n(e,x,t),B(u,e,t),n(e,_,t),n(e,m,t),n(e,I,t),n(e,c,t),n(e,$,t),n(e,d,t),n(e,b,t),n(e,p,t),n(e,C,t),B(h,e,t),n(e,M,t),n(e,f,t),n(e,q,t),n(e,w,t),n(e,U,t),B(T,e,t),n(e,E,t),n(e,J,t),H=!0},p:X,i(e){H||(W(u.$$.fragment,e),W(h.$$.fragment,e),W(T.$$.fragment,e),H=!0)},o(e){j(u.$$.fragment,e),j(h.$$.fragment,e),j(T.$$.fragment,e),H=!1},d(e){e&&(s(v),s(y),s(x),s(_),s(m),s(I),s(c),s($),s(d),s(b),s(p),s(C),s(M),s(f),s(q),s(w),s(U),s(E),s(J)),s(o),F(u,e),F(h,e),F(T,e)}}}const ie='{"title":"Hands-on exercise","local":"hands-on-exercise","sections":[],"depth":1}';function oe(L){return O(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ce extends Q{constructor(o){super(),V(this,o,oe,ae,D,{})}}export{ce as component};
