import{s as tt,n as et,o as st}from"../chunks/scheduler.f7e1785c.js";import{S as at,i as ot,g as i,s as o,r as z,A as nt,h as l,f as s,c as n,j as V,u as P,x as u,k as K,y as it,a,v as Y,d as L,t as Z,w as E}from"../chunks/index.9f8f0838.js";import{C as lt}from"../chunks/CodeBlock.4baef5d7.js";import{H as rt,E as ut}from"../chunks/getInferenceSnippets.ad8e59bc.js";function ct(N){let r,M,_,v,c,C,m,A=`It’s time to get your hands on some Audio models and apply what you have learned so far.
This exercise is one of the four hands-on exercises required to qualify for a course completion certificate.`,I,d,S=`Here are the instructions.
In this unit, we demonstrated how to fine-tune a Hubert model on <code>marsyas/gtzan</code> dataset for music classification. Our example achieved 83% accuracy.
Your task is to improve upon this accuracy metric.`,b,f,X=`Feel free to choose any model on the <a href="https://huggingface.co/models" rel="nofollow">🤗 Hub</a> that you think is suitable for audio classification,
and use the exact same dataset <a href="https://huggingface.co/datasets/marsyas/gtzan" rel="nofollow"><code>marsyas/gtzan</code></a> to build your own classifier.`,$,p,G=`Your goal is to achieve 87% accuracy on this dataset with your classifier. You can choose the exact same model, and play with the training hyperparameters,
or pick an entirely different model - it’s up to you!`,q,h,Q=`For your result to count towards your certificate, don’t forget to push your model to Hub as was shown in this unit with
the following <code>**kwargs</code> at the end of the training:`,U,y,k,T,D="Here are some additional resources that you may find helpful when working on this exercise:",H,g,R='<li><a href="https://huggingface.co/docs/transformers/tasks/audio_classification" rel="nofollow">Audio classification task guide in Transformers documentation</a></li> <li><a href="https://huggingface.co/docs/transformers/model_doc/hubert" rel="nofollow">Hubert model documentation</a></li> <li><a href="https://huggingface.co/docs/transformers/model_doc/mctct" rel="nofollow">M-CTC-T model documentation</a></li> <li><a href="https://huggingface.co/docs/transformers/model_doc/audio-spectrogram-transformer" rel="nofollow">Audio Spectrogram Transformer documentation</a></li> <li><a href="https://huggingface.co/docs/transformers/model_doc/wav2vec2" rel="nofollow">Wav2Vec2 documentation</a></li>',j,w,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.",W,J,B,x,F;return c=new rt({props:{title:"Hands-on exercise",local:"hands-on-exercise",headingTag:"h1"}}),y=new lt({props:{code:"a3dhcmdzJTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIyZGF0YXNldF90YWdzJTIyJTNBJTIwJTIybWFyc3lhcyUyRmd0emFuJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyZGF0YXNldCUyMiUzQSUyMCUyMkdUWkFOJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIybW9kZWxfbmFtZSUyMiUzQSUyMGYlMjIlN0Jtb2RlbF9uYW1lJTdELWZpbmV0dW5lZC1ndHphbiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMmZpbmV0dW5lZF9mcm9tJTIyJTNBJTIwbW9kZWxfaWQlMkMlMEElMjAlMjAlMjAlMjAlMjJ0YXNrcyUyMiUzQSUyMCUyMmF1ZGlvLWNsYXNzaWZpY2F0aW9uJTIyJTJDJTBBJTdEJTBBJTBBdHJhaW5lci5wdXNoX3RvX2h1YigqKmt3YXJncyk=",highlighted:`kwargs = {
    <span class="hljs-string">&quot;dataset_tags&quot;</span>: <span class="hljs-string">&quot;marsyas/gtzan&quot;</span>,
    <span class="hljs-string">&quot;dataset&quot;</span>: <span class="hljs-string">&quot;GTZAN&quot;</span>,
    <span class="hljs-string">&quot;model_name&quot;</span>: <span class="hljs-string">f&quot;<span class="hljs-subst">{model_name}</span>-finetuned-gtzan&quot;</span>,
    <span class="hljs-string">&quot;finetuned_from&quot;</span>: model_id,
    <span class="hljs-string">&quot;tasks&quot;</span>: <span class="hljs-string">&quot;audio-classification&quot;</span>,
}

trainer.push_to_hub(**kwargs)`,wrap:!1}}),J=new ut({props:{source:"https://github.com/huggingface/audio-transformers-course/blob/main/chapters/en/chapter4/hands_on.mdx"}}),{c(){r=i("meta"),M=o(),_=i("p"),v=o(),z(c.$$.fragment),C=o(),m=i("p"),m.textContent=A,I=o(),d=i("p"),d.innerHTML=S,b=o(),f=i("p"),f.innerHTML=X,$=o(),p=i("p"),p.textContent=G,q=o(),h=i("p"),h.innerHTML=Q,U=o(),z(y.$$.fragment),k=o(),T=i("p"),T.textContent=D,H=o(),g=i("ul"),g.innerHTML=R,j=o(),w=i("p"),w.textContent=O,W=o(),z(J.$$.fragment),B=o(),x=i("p"),this.h()},l(t){const e=nt("svelte-u9bgzb",document.head);r=l(e,"META",{name:!0,content:!0}),e.forEach(s),M=n(t),_=l(t,"P",{}),V(_).forEach(s),v=n(t),P(c.$$.fragment,t),C=n(t),m=l(t,"P",{"data-svelte-h":!0}),u(m)!=="svelte-r7de23"&&(m.textContent=A),I=n(t),d=l(t,"P",{"data-svelte-h":!0}),u(d)!=="svelte-1ei55oe"&&(d.innerHTML=S),b=n(t),f=l(t,"P",{"data-svelte-h":!0}),u(f)!=="svelte-1umb5yr"&&(f.innerHTML=X),$=n(t),p=l(t,"P",{"data-svelte-h":!0}),u(p)!=="svelte-wvzk8g"&&(p.textContent=G),q=n(t),h=l(t,"P",{"data-svelte-h":!0}),u(h)!=="svelte-1e7x01p"&&(h.innerHTML=Q),U=n(t),P(y.$$.fragment,t),k=n(t),T=l(t,"P",{"data-svelte-h":!0}),u(T)!=="svelte-qioqfw"&&(T.textContent=D),H=n(t),g=l(t,"UL",{"data-svelte-h":!0}),u(g)!=="svelte-r8nls9"&&(g.innerHTML=R),j=n(t),w=l(t,"P",{"data-svelte-h":!0}),u(w)!=="svelte-1vc7edk"&&(w.textContent=O),W=n(t),P(J.$$.fragment,t),B=n(t),x=l(t,"P",{}),V(x).forEach(s),this.h()},h(){K(r,"name","hf:doc:metadata"),K(r,"content",mt)},m(t,e){it(document.head,r),a(t,M,e),a(t,_,e),a(t,v,e),Y(c,t,e),a(t,C,e),a(t,m,e),a(t,I,e),a(t,d,e),a(t,b,e),a(t,f,e),a(t,$,e),a(t,p,e),a(t,q,e),a(t,h,e),a(t,U,e),Y(y,t,e),a(t,k,e),a(t,T,e),a(t,H,e),a(t,g,e),a(t,j,e),a(t,w,e),a(t,W,e),Y(J,t,e),a(t,B,e),a(t,x,e),F=!0},p:et,i(t){F||(L(c.$$.fragment,t),L(y.$$.fragment,t),L(J.$$.fragment,t),F=!0)},o(t){Z(c.$$.fragment,t),Z(y.$$.fragment,t),Z(J.$$.fragment,t),F=!1},d(t){t&&(s(M),s(_),s(v),s(C),s(m),s(I),s(d),s(b),s(f),s($),s(p),s(q),s(h),s(U),s(k),s(T),s(H),s(g),s(j),s(w),s(W),s(B),s(x)),s(r),E(c,t),E(y,t),E(J,t)}}}const mt='{"title":"Hands-on exercise","local":"hands-on-exercise","sections":[],"depth":1}';function dt(N){return st(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Tt extends at{constructor(r){super(),ot(this,r,dt,ct,tt,{})}}export{Tt as component};
