import{s as st,n as at,o as ot}from"../chunks/scheduler.cd324960.js";import{S as nt,i as it,e as i,s as o,c as P,h as lt,a as l,d as s,b as n,f as tt,g as Y,j as u,k as et,l as rt,m as a,n as Z,t as E,o as N,p as S}from"../chunks/index.d5c3adcc.js";import{C as ut,H as ct,E as mt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.7d44181b.js";import{C as dt}from"../chunks/CodeBlock.f16d02bc.js";function ft(A){let r,$,_,v,c,C,m,b,d,X=`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,f,G=`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.`,q,p,Q=`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.`,U,h,D=`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!`,k,y,R=`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:`,H,T,j,g,O="Here are some additional resources that you may find helpful when working on this exercise:",W,w,V='<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>',B,J,K="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.",z,x,F,M,L;return c=new ut({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),m=new ct({props:{title:"Hands-on exercise",local:"hands-on-exercise",headingTag:"h1"}}),T=new dt({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}}),x=new mt({props:{source:"https://github.com/huggingface/audio-transformers-course/blob/main/chapters/en/chapter4/hands_on.mdx"}}),{c(){r=i("meta"),$=o(),_=i("p"),v=o(),P(c.$$.fragment),C=o(),P(m.$$.fragment),b=o(),d=i("p"),d.textContent=X,I=o(),f=i("p"),f.innerHTML=G,q=o(),p=i("p"),p.innerHTML=Q,U=o(),h=i("p"),h.textContent=D,k=o(),y=i("p"),y.innerHTML=R,H=o(),P(T.$$.fragment),j=o(),g=i("p"),g.textContent=O,W=o(),w=i("ul"),w.innerHTML=V,B=o(),J=i("p"),J.textContent=K,z=o(),P(x.$$.fragment),F=o(),M=i("p"),this.h()},l(t){const e=lt("svelte-u9bgzb",document.head);r=l(e,"META",{name:!0,content:!0}),e.forEach(s),$=n(t),_=l(t,"P",{}),tt(_).forEach(s),v=n(t),Y(c.$$.fragment,t),C=n(t),Y(m.$$.fragment,t),b=n(t),d=l(t,"P",{"data-svelte-h":!0}),u(d)!=="svelte-r7de23"&&(d.textContent=X),I=n(t),f=l(t,"P",{"data-svelte-h":!0}),u(f)!=="svelte-1ei55oe"&&(f.innerHTML=G),q=n(t),p=l(t,"P",{"data-svelte-h":!0}),u(p)!=="svelte-1umb5yr"&&(p.innerHTML=Q),U=n(t),h=l(t,"P",{"data-svelte-h":!0}),u(h)!=="svelte-wvzk8g"&&(h.textContent=D),k=n(t),y=l(t,"P",{"data-svelte-h":!0}),u(y)!=="svelte-1e7x01p"&&(y.innerHTML=R),H=n(t),Y(T.$$.fragment,t),j=n(t),g=l(t,"P",{"data-svelte-h":!0}),u(g)!=="svelte-qioqfw"&&(g.textContent=O),W=n(t),w=l(t,"UL",{"data-svelte-h":!0}),u(w)!=="svelte-r8nls9"&&(w.innerHTML=V),B=n(t),J=l(t,"P",{"data-svelte-h":!0}),u(J)!=="svelte-1vc7edk"&&(J.textContent=K),z=n(t),Y(x.$$.fragment,t),F=n(t),M=l(t,"P",{}),tt(M).forEach(s),this.h()},h(){et(r,"name","hf:doc:metadata"),et(r,"content",pt)},m(t,e){rt(document.head,r),a(t,$,e),a(t,_,e),a(t,v,e),Z(c,t,e),a(t,C,e),Z(m,t,e),a(t,b,e),a(t,d,e),a(t,I,e),a(t,f,e),a(t,q,e),a(t,p,e),a(t,U,e),a(t,h,e),a(t,k,e),a(t,y,e),a(t,H,e),Z(T,t,e),a(t,j,e),a(t,g,e),a(t,W,e),a(t,w,e),a(t,B,e),a(t,J,e),a(t,z,e),Z(x,t,e),a(t,F,e),a(t,M,e),L=!0},p:at,i(t){L||(E(c.$$.fragment,t),E(m.$$.fragment,t),E(T.$$.fragment,t),E(x.$$.fragment,t),L=!0)},o(t){N(c.$$.fragment,t),N(m.$$.fragment,t),N(T.$$.fragment,t),N(x.$$.fragment,t),L=!1},d(t){t&&(s($),s(_),s(v),s(C),s(b),s(d),s(I),s(f),s(q),s(p),s(U),s(h),s(k),s(y),s(H),s(j),s(g),s(W),s(w),s(B),s(J),s(z),s(F),s(M)),s(r),S(c,t),S(m,t),S(T,t),S(x,t)}}}const pt='{"title":"Hands-on exercise","local":"hands-on-exercise","sections":[],"depth":1}';function ht(A){return ot(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Jt extends nt{constructor(r){super(),it(this,r,ht,ft,st,{})}}export{Jt as component};
