import{s as Z,n as Y,o as D}from"../chunks/scheduler.f7e1785c.js";import{S as X,i as Q,g as l,s as a,r as F,A as O,h as r,f as s,c as i,j as L,u as A,x as T,k as S,y as V,a as n,v as z,d as N,t as R,w as G}from"../chunks/index.9f8f0838.js";import{C as K}from"../chunks/CodeBlock.b3510e34.js";import{H as ee}from"../chunks/Heading.6643a2f7.js";function te(H){let o,g,y,v,u,x,c,P=`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,d,k="Here are the instructions:",_,m,B="<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>",C,p,E="Once you have fine-tuned a model, make sure to upload it to the 🤗 Hub with the following <code>kwargs</code>:",M,h,b,f,W="You will pass this assignment if your model’s normalised WER (<code>wer</code>) is lower than <strong>0.37</strong>.",$,w,j="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.",q,J,U;return u=new ee({props:{title:"Hands-on exercise",local:"hands-on-exercise",headingTag:"h1"}}),h=new K({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}}),{c(){o=l("meta"),g=a(),y=l("p"),v=a(),F(u.$$.fragment),x=a(),c=l("p"),c.textContent=P,I=a(),d=l("p"),d.textContent=k,_=a(),m=l("ul"),m.innerHTML=B,C=a(),p=l("p"),p.innerHTML=E,M=a(),F(h.$$.fragment),b=a(),f=l("p"),f.innerHTML=W,$=a(),w=l("p"),w.textContent=j,q=a(),J=l("p"),this.h()},l(e){const t=O("svelte-u9bgzb",document.head);o=r(t,"META",{name:!0,content:!0}),t.forEach(s),g=i(e),y=r(e,"P",{}),L(y).forEach(s),v=i(e),A(u.$$.fragment,e),x=i(e),c=r(e,"P",{"data-svelte-h":!0}),T(c)!=="svelte-x2tvlr"&&(c.textContent=P),I=i(e),d=r(e,"P",{"data-svelte-h":!0}),T(d)!=="svelte-acxoy6"&&(d.textContent=k),_=i(e),m=r(e,"UL",{"data-svelte-h":!0}),T(m)!=="svelte-14v5kzw"&&(m.innerHTML=B),C=i(e),p=r(e,"P",{"data-svelte-h":!0}),T(p)!=="svelte-1p3fyil"&&(p.innerHTML=E),M=i(e),A(h.$$.fragment,e),b=i(e),f=r(e,"P",{"data-svelte-h":!0}),T(f)!=="svelte-i4linb"&&(f.innerHTML=W),$=i(e),w=r(e,"P",{"data-svelte-h":!0}),T(w)!=="svelte-1vc7edk"&&(w.textContent=j),q=i(e),J=r(e,"P",{}),L(J).forEach(s),this.h()},h(){S(o,"name","hf:doc:metadata"),S(o,"content",se)},m(e,t){V(document.head,o),n(e,g,t),n(e,y,t),n(e,v,t),z(u,e,t),n(e,x,t),n(e,c,t),n(e,I,t),n(e,d,t),n(e,_,t),n(e,m,t),n(e,C,t),n(e,p,t),n(e,M,t),z(h,e,t),n(e,b,t),n(e,f,t),n(e,$,t),n(e,w,t),n(e,q,t),n(e,J,t),U=!0},p:Y,i(e){U||(N(u.$$.fragment,e),N(h.$$.fragment,e),U=!0)},o(e){R(u.$$.fragment,e),R(h.$$.fragment,e),U=!1},d(e){e&&(s(g),s(y),s(v),s(x),s(c),s(I),s(d),s(_),s(m),s(C),s(p),s(M),s(b),s(f),s($),s(w),s(q),s(J)),s(o),G(u,e),G(h,e)}}}const se='{"title":"Hands-on exercise","local":"hands-on-exercise","sections":[],"depth":1}';function ne(H){return D(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class re extends X{constructor(o){super(),Q(this,o,ne,te,Z,{})}}export{re as component};
