import{S as it,i as lt,s as rt,e as n,k as u,w as et,t as o,M as ht,c as i,d as s,m,a as l,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,ie,S,le,re,A,he,ce,de,c,ue,B,me,pe,O,fe,we,P,ve,ye,ge,d,_e,D,Ee,Te,H,Je,Ie,R,xe,be,Z,_,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"),ie=o("Fine-tune the "),S=n("code"),le=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"),_e=o("To evaluate the model, use the "),D=n("code"),Ee=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(),_=n("p"),ke=o("Once you have fine-tuned a model, make sure to upload it to the :hugging_face: 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=i(r,"META",{name:!0,content:!0}),r.forEach(s),G=m(e),v=i(e,"H1",{class:!0});var ee=l(v);g=i(ee,"A",{id:!0,class:!0,href:!0});var Oe=l(g);M=i(Oe,"SPAN",{});var Pe=l(M);tt(J.$$.fragment,Pe),Pe.forEach(s),Oe.forEach(s),se=m(ee),W=i(ee,"SPAN",{});var De=l(W);oe=a(De,"Hands-on exercise"),De.forEach(s),ee.forEach(s),L=m(e),x=i(e,"P",{});var He=l(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=i(e,"P",{});var Re=l(b);ne=a(Re,"Here are the instructions:"),Re.forEach(s),Y=m(e),p=i(e,"UL",{});var q=l(p);y=i(q,"LI",{});var C=l(y);ie=a(C,"Fine-tune the "),S=i(C,"CODE",{});var Fe=l(S);le=a(Fe,"\u201Dopenai/whisper-tiny\u201D"),Fe.forEach(s),re=a(C," model using the American English (\u201Cen-US\u201D) subset of the "),A=i(C,"CODE",{});var Ne=l(A);he=a(Ne,"\u201DPolyAI/minds14\u201D"),Ne.forEach(s),ce=a(C," dataset."),C.forEach(s),de=m(q),c=i(q,"LI",{});var E=l(c);ue=a(E,"Use the first "),B=i(E,"STRONG",{});var je=l(B);me=a(je,"450 examples for training"),je.forEach(s),pe=a(E,", and the rest for evaluation. Ensure you set "),O=i(E,"CODE",{});var Ge=l(O);fe=a(Ge,"num_proc=1"),Ge.forEach(s),we=a(E," when pre-processing the dataset using the "),P=i(E,"CODE",{});var Le=l(P);ve=a(Le,".map"),Le.forEach(s),ye=a(E," method (this will ensure your model is submitted correctly for assessment)."),E.forEach(s),ge=m(q),d=i(q,"LI",{});var T=l(d);_e=a(T,"To evaluate the model, use the "),D=i(T,"CODE",{});var ze=l(D);Ee=a(ze,"wer"),ze.forEach(s),Te=a(T," and "),H=i(T,"CODE",{});var Ye=l(H);Je=a(Ye,"wer_ortho"),Ye.forEach(s),Ie=a(T," metrics as described in this Unit. However, "),R=i(T,"EM",{});var Ze=l(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),_=i(e,"P",{});var te=l(_);ke=a(te,"Once you have fine-tuned a model, make sure to upload it to the :hugging_face: Hub with the following "),F=i(te,"CODE",{});var Xe=l(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=i(e,"P",{});var U=l(f);Ue=a(U,"You will pass this assignment if your model\u2019s normalised WER ("),N=i(U,"CODE",{});var Qe=l(N);$e=a(Qe,"wer"),Qe.forEach(s),Me=a(U,") is lower than "),j=i(U,"STRONG",{});var Ve=l(j);We=a(Ve,"0.37"),Ve.forEach(s),Se=a(U,"."),U.forEach(s),V=m(e),k=i(e,"P",{});var Ke=l(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,ie),t(y,S),t(S,le),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,_e),t(d,D),t(D,Ee),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,_,r),t(_,ke),t(_,F),t(F,qe),t(_,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&&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 _t extends it{constructor(w){super();lt(this,w,wt,pt,rt,{})}}export{_t as default,ft as metadata};
