import{s as O,n as Q,o as V}from"../chunks/scheduler.cd324960.js";import{S as K,i as ee,e as l,s as i,c as B,h as te,a as r,d as n,b as a,f as D,g as W,j as y,k as X,l as ne,m as s,n as j,t as L,o as F,p as S}from"../chunks/index.d5c3adcc.js";import{C as se,H as ie,E as ae}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.92ea4747.js";import{C as oe}from"../chunks/CodeBlock.bef85339.js";function le(z){let o,v,J,$,m,_,u,b,p,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,G="Here are the instructions:",C,d,N="<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>",M,h,R="Once you have fine-tuned a model, make sure to upload it to the 🤗 Hub with the following <code>kwargs</code>:",q,f,U,w,Z="You will pass this assignment if your model’s normalised WER (<code>wer</code>) is lower than <strong>0.37</strong>.",E,g,Y="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.",H,T,P,x,k;return m=new se({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),u=new ie({props:{title:"Hands-on exercise",local:"hands-on-exercise",headingTag:"h1"}}),f=new oe({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 ae({props:{source:"https://github.com/huggingface/audio-transformers-course/blob/main/chapters/en/chapter5/hands_on.mdx"}}),{c(){o=l("meta"),v=i(),J=l("p"),$=i(),B(m.$$.fragment),_=i(),B(u.$$.fragment),b=i(),p=l("p"),p.textContent=A,I=i(),c=l("p"),c.textContent=G,C=i(),d=l("ul"),d.innerHTML=N,M=i(),h=l("p"),h.innerHTML=R,q=i(),B(f.$$.fragment),U=i(),w=l("p"),w.innerHTML=Z,E=i(),g=l("p"),g.textContent=Y,H=i(),B(T.$$.fragment),P=i(),x=l("p"),this.h()},l(e){const t=te("svelte-u9bgzb",document.head);o=r(t,"META",{name:!0,content:!0}),t.forEach(n),v=a(e),J=r(e,"P",{}),D(J).forEach(n),$=a(e),W(m.$$.fragment,e),_=a(e),W(u.$$.fragment,e),b=a(e),p=r(e,"P",{"data-svelte-h":!0}),y(p)!=="svelte-x2tvlr"&&(p.textContent=A),I=a(e),c=r(e,"P",{"data-svelte-h":!0}),y(c)!=="svelte-acxoy6"&&(c.textContent=G),C=a(e),d=r(e,"UL",{"data-svelte-h":!0}),y(d)!=="svelte-14v5kzw"&&(d.innerHTML=N),M=a(e),h=r(e,"P",{"data-svelte-h":!0}),y(h)!=="svelte-1p3fyil"&&(h.innerHTML=R),q=a(e),W(f.$$.fragment,e),U=a(e),w=r(e,"P",{"data-svelte-h":!0}),y(w)!=="svelte-i4linb"&&(w.innerHTML=Z),E=a(e),g=r(e,"P",{"data-svelte-h":!0}),y(g)!=="svelte-1vc7edk"&&(g.textContent=Y),H=a(e),W(T.$$.fragment,e),P=a(e),x=r(e,"P",{}),D(x).forEach(n),this.h()},h(){X(o,"name","hf:doc:metadata"),X(o,"content",re)},m(e,t){ne(document.head,o),s(e,v,t),s(e,J,t),s(e,$,t),j(m,e,t),s(e,_,t),j(u,e,t),s(e,b,t),s(e,p,t),s(e,I,t),s(e,c,t),s(e,C,t),s(e,d,t),s(e,M,t),s(e,h,t),s(e,q,t),j(f,e,t),s(e,U,t),s(e,w,t),s(e,E,t),s(e,g,t),s(e,H,t),j(T,e,t),s(e,P,t),s(e,x,t),k=!0},p:Q,i(e){k||(L(m.$$.fragment,e),L(u.$$.fragment,e),L(f.$$.fragment,e),L(T.$$.fragment,e),k=!0)},o(e){F(m.$$.fragment,e),F(u.$$.fragment,e),F(f.$$.fragment,e),F(T.$$.fragment,e),k=!1},d(e){e&&(n(v),n(J),n($),n(_),n(b),n(p),n(I),n(c),n(C),n(d),n(M),n(h),n(q),n(U),n(w),n(E),n(g),n(H),n(P),n(x)),n(o),S(m,e),S(u,e),S(f,e),S(T,e)}}}const re='{"title":"Hands-on exercise","local":"hands-on-exercise","sections":[],"depth":1}';function me(z){return V(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class he extends K{constructor(o){super(),ee(this,o,me,le,O,{})}}export{he as component};
