import{S as lt,i as it,s as rt,e as n,k as u,w as et,t as o,M as ht,c as l,d as s,m,a as i,x as tt,h as a,b as $,G as t,g as h,y as st,L as ct,q as ot,o as at,B as nt,v as dt}from"../../chunks/vendor-hf-doc-builder.js";import{I as ut}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as mt}from"../../chunks/CodeBlock-hf-doc-builder.js";function pt(Be){let w,G,v,g,M,J,se,W,oe,L,x,ae,z,b,ne,Y,p,y,le,S,ie,re,A,he,ce,de,c,ue,B,me,pe,O,fe,we,P,ve,ye,ge,d,Ee,D,_e,Te,H,Je,Ie,R,xe,be,Z,E,ke,F,qe,Ce,X,I,Q,f,Ue,N,$e,Me,j,We,Se,V,k,Ae,K;return J=new ut({}),I=new mt({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>,
}`}}),{c(){w=n("meta"),G=u(),v=n("h1"),g=n("a"),M=n("span"),et(J.$$.fragment),se=u(),W=n("span"),oe=o("Hands-on exercise"),L=u(),x=n("p"),ae=o(`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.`),z=u(),b=n("p"),ne=o("Here are the instructions:"),Y=u(),p=n("ul"),y=n("li"),le=o("Fine-tune the "),S=n("code"),ie=o("\u201Dopenai/whisper-tiny\u201D"),re=o(" model using the American English (\u201Cen-US\u201D) subset of the "),A=n("code"),he=o("\u201DPolyAI/minds14\u201D"),ce=o(" dataset."),de=u(),c=n("li"),ue=o("Use the first "),B=n("strong"),me=o("450 examples for training"),pe=o(", and the rest for evaluation. Ensure you set "),O=n("code"),fe=o("num_proc=1"),we=o(" when pre-processing the dataset using the "),P=n("code"),ve=o(".map"),ye=o(" method (this will ensure your model is submitted correctly for assessment)."),ge=u(),d=n("li"),Ee=o("To evaluate the model, use the "),D=n("code"),_e=o("wer"),Te=o(" and "),H=n("code"),Je=o("wer_ortho"),Ie=o(" metrics as described in this Unit. However, "),R=n("em"),xe=o("do not"),be=o(" convert the metric into percentages by multiplying by 100 (E.g. if WER is 42%, we\u2019ll expect to see the value of 0.42 in this exercise)."),Z=u(),E=n("p"),ke=o("Once you have fine-tuned a model, make sure to upload it to the \u{1F917} Hub with the following "),F=n("code"),qe=o("kwargs"),Ce=o(":"),X=u(),et(I.$$.fragment),Q=u(),f=n("p"),Ue=o("You will pass this assignment if your model\u2019s normalised WER ("),N=n("code"),$e=o("wer"),Me=o(") is lower than "),j=n("strong"),We=o("0.37"),Se=o("."),V=u(),k=n("p"),Ae=o("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."),this.h()},l(e){const r=ht('[data-svelte="svelte-1phssyn"]',document.head);w=l(r,"META",{name:!0,content:!0}),r.forEach(s),G=m(e),v=l(e,"H1",{class:!0});var ee=i(v);g=l(ee,"A",{id:!0,class:!0,href:!0});var Oe=i(g);M=l(Oe,"SPAN",{});var Pe=i(M);tt(J.$$.fragment,Pe),Pe.forEach(s),Oe.forEach(s),se=m(ee),W=l(ee,"SPAN",{});var De=i(W);oe=a(De,"Hands-on exercise"),De.forEach(s),ee.forEach(s),L=m(e),x=l(e,"P",{});var He=i(x);ae=a(He,`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.`),He.forEach(s),z=m(e),b=l(e,"P",{});var Re=i(b);ne=a(Re,"Here are the instructions:"),Re.forEach(s),Y=m(e),p=l(e,"UL",{});var q=i(p);y=l(q,"LI",{});var C=i(y);le=a(C,"Fine-tune the "),S=l(C,"CODE",{});var Fe=i(S);ie=a(Fe,"\u201Dopenai/whisper-tiny\u201D"),Fe.forEach(s),re=a(C," model using the American English (\u201Cen-US\u201D) subset of the "),A=l(C,"CODE",{});var Ne=i(A);he=a(Ne,"\u201DPolyAI/minds14\u201D"),Ne.forEach(s),ce=a(C," dataset."),C.forEach(s),de=m(q),c=l(q,"LI",{});var _=i(c);ue=a(_,"Use the first "),B=l(_,"STRONG",{});var je=i(B);me=a(je,"450 examples for training"),je.forEach(s),pe=a(_,", and the rest for evaluation. Ensure you set "),O=l(_,"CODE",{});var Ge=i(O);fe=a(Ge,"num_proc=1"),Ge.forEach(s),we=a(_," when pre-processing the dataset using the "),P=l(_,"CODE",{});var Le=i(P);ve=a(Le,".map"),Le.forEach(s),ye=a(_," method (this will ensure your model is submitted correctly for assessment)."),_.forEach(s),ge=m(q),d=l(q,"LI",{});var T=i(d);Ee=a(T,"To evaluate the model, use the "),D=l(T,"CODE",{});var ze=i(D);_e=a(ze,"wer"),ze.forEach(s),Te=a(T," and "),H=l(T,"CODE",{});var Ye=i(H);Je=a(Ye,"wer_ortho"),Ye.forEach(s),Ie=a(T," metrics as described in this Unit. However, "),R=l(T,"EM",{});var Ze=i(R);xe=a(Ze,"do not"),Ze.forEach(s),be=a(T," convert the metric into percentages by multiplying by 100 (E.g. if WER is 42%, we\u2019ll expect to see the value of 0.42 in this exercise)."),T.forEach(s),q.forEach(s),Z=m(e),E=l(e,"P",{});var te=i(E);ke=a(te,"Once you have fine-tuned a model, make sure to upload it to the \u{1F917} Hub with the following "),F=l(te,"CODE",{});var Xe=i(F);qe=a(Xe,"kwargs"),Xe.forEach(s),Ce=a(te,":"),te.forEach(s),X=m(e),tt(I.$$.fragment,e),Q=m(e),f=l(e,"P",{});var U=i(f);Ue=a(U,"You will pass this assignment if your model\u2019s normalised WER ("),N=l(U,"CODE",{});var Qe=i(N);$e=a(Qe,"wer"),Qe.forEach(s),Me=a(U,") is lower than "),j=l(U,"STRONG",{});var Ve=i(j);We=a(Ve,"0.37"),Ve.forEach(s),Se=a(U,"."),U.forEach(s),V=m(e),k=l(e,"P",{});var Ke=i(k);Ae=a(Ke,"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."),Ke.forEach(s),this.h()},h(){$(w,"name","hf:doc:metadata"),$(w,"content",JSON.stringify(ft)),$(g,"id","handson-exercise"),$(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),$(g,"href","#handson-exercise"),$(v,"class","relative group")},m(e,r){t(document.head,w),h(e,G,r),h(e,v,r),t(v,g),t(g,M),st(J,M,null),t(v,se),t(v,W),t(W,oe),h(e,L,r),h(e,x,r),t(x,ae),h(e,z,r),h(e,b,r),t(b,ne),h(e,Y,r),h(e,p,r),t(p,y),t(y,le),t(y,S),t(S,ie),t(y,re),t(y,A),t(A,he),t(y,ce),t(p,de),t(p,c),t(c,ue),t(c,B),t(B,me),t(c,pe),t(c,O),t(O,fe),t(c,we),t(c,P),t(P,ve),t(c,ye),t(p,ge),t(p,d),t(d,Ee),t(d,D),t(D,_e),t(d,Te),t(d,H),t(H,Je),t(d,Ie),t(d,R),t(R,xe),t(d,be),h(e,Z,r),h(e,E,r),t(E,ke),t(E,F),t(F,qe),t(E,Ce),h(e,X,r),st(I,e,r),h(e,Q,r),h(e,f,r),t(f,Ue),t(f,N),t(N,$e),t(f,Me),t(f,j),t(j,We),t(f,Se),h(e,V,r),h(e,k,r),t(k,Ae),K=!0},p:ct,i(e){K||(ot(J.$$.fragment,e),ot(I.$$.fragment,e),K=!0)},o(e){at(J.$$.fragment,e),at(I.$$.fragment,e),K=!1},d(e){s(w),e&&s(G),e&&s(v),nt(J),e&&s(L),e&&s(x),e&&s(z),e&&s(b),e&&s(Y),e&&s(p),e&&s(Z),e&&s(E),e&&s(X),nt(I,e),e&&s(Q),e&&s(f),e&&s(V),e&&s(k)}}}const ft={local:"handson-exercise",title:"Hands-on exercise"};function wt(Be){return dt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Et extends lt{constructor(w){super();it(this,w,wt,pt,rt,{})}}export{Et as default,ft as metadata};
