import{s as O,n as K,o as tt}from"../chunks/scheduler.f7e1785c.js";import{S as et,i as at,g as l,s as o,r as E,A as st,h as i,f as a,c as n,j as S,u as X,x as u,k as Q,y as ot,a as s,v as G,d as D,t as R,w as V}from"../chunks/index.9f8f0838.js";import{C as nt}from"../chunks/CodeBlock.b3510e34.js";import{H as lt}from"../chunks/Heading.6643a2f7.js";function it(B){let r,M,J,x,c,v,d,F=`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.`,C,m,z=`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.`,I,f,P=`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.`,q,p,Y=`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!`,b,h,L=`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,Z="Here are some additional resources that you may find helpful when working on this exercise:",H,w,N='<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>',$,g,A="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.",j,_,W;return c=new lt({props:{title:"Hands-on exercise",local:"hands-on-exercise",headingTag:"h1"}}),y=new nt({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}}),{c(){r=l("meta"),M=o(),J=l("p"),x=o(),E(c.$$.fragment),v=o(),d=l("p"),d.textContent=F,C=o(),m=l("p"),m.innerHTML=z,I=o(),f=l("p"),f.innerHTML=P,q=o(),p=l("p"),p.textContent=Y,b=o(),h=l("p"),h.innerHTML=L,U=o(),E(y.$$.fragment),k=o(),T=l("p"),T.textContent=Z,H=o(),w=l("ul"),w.innerHTML=N,$=o(),g=l("p"),g.textContent=A,j=o(),_=l("p"),this.h()},l(t){const e=st("svelte-u9bgzb",document.head);r=i(e,"META",{name:!0,content:!0}),e.forEach(a),M=n(t),J=i(t,"P",{}),S(J).forEach(a),x=n(t),X(c.$$.fragment,t),v=n(t),d=i(t,"P",{"data-svelte-h":!0}),u(d)!=="svelte-r7de23"&&(d.textContent=F),C=n(t),m=i(t,"P",{"data-svelte-h":!0}),u(m)!=="svelte-1ei55oe"&&(m.innerHTML=z),I=n(t),f=i(t,"P",{"data-svelte-h":!0}),u(f)!=="svelte-1umb5yr"&&(f.innerHTML=P),q=n(t),p=i(t,"P",{"data-svelte-h":!0}),u(p)!=="svelte-wvzk8g"&&(p.textContent=Y),b=n(t),h=i(t,"P",{"data-svelte-h":!0}),u(h)!=="svelte-1e7x01p"&&(h.innerHTML=L),U=n(t),X(y.$$.fragment,t),k=n(t),T=i(t,"P",{"data-svelte-h":!0}),u(T)!=="svelte-qioqfw"&&(T.textContent=Z),H=n(t),w=i(t,"UL",{"data-svelte-h":!0}),u(w)!=="svelte-r8nls9"&&(w.innerHTML=N),$=n(t),g=i(t,"P",{"data-svelte-h":!0}),u(g)!=="svelte-1vc7edk"&&(g.textContent=A),j=n(t),_=i(t,"P",{}),S(_).forEach(a),this.h()},h(){Q(r,"name","hf:doc:metadata"),Q(r,"content",rt)},m(t,e){ot(document.head,r),s(t,M,e),s(t,J,e),s(t,x,e),G(c,t,e),s(t,v,e),s(t,d,e),s(t,C,e),s(t,m,e),s(t,I,e),s(t,f,e),s(t,q,e),s(t,p,e),s(t,b,e),s(t,h,e),s(t,U,e),G(y,t,e),s(t,k,e),s(t,T,e),s(t,H,e),s(t,w,e),s(t,$,e),s(t,g,e),s(t,j,e),s(t,_,e),W=!0},p:K,i(t){W||(D(c.$$.fragment,t),D(y.$$.fragment,t),W=!0)},o(t){R(c.$$.fragment,t),R(y.$$.fragment,t),W=!1},d(t){t&&(a(M),a(J),a(x),a(v),a(d),a(C),a(m),a(I),a(f),a(q),a(p),a(b),a(h),a(U),a(k),a(T),a(H),a(w),a($),a(g),a(j),a(_)),a(r),V(c,t),V(y,t)}}}const rt='{"title":"Hands-on exercise","local":"hands-on-exercise","sections":[],"depth":1}';function ut(B){return tt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pt extends et{constructor(r){super(),at(this,r,ut,it,O,{})}}export{pt as component};
