import{S as nt,i as it,s as lt,e as a,k as f,w as et,t as i,M as ut,c as s,d as t,m as d,a as r,x as tt,h as l,b as u,G as o,g as c,y as ot,L as ct,q as at,o as st,B as rt,v as ft}from"../../chunks/vendor-hf-doc-builder.js";import{I as dt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as ht}from"../../chunks/CodeBlock-hf-doc-builder.js";function mt(Ae){let y,L,w,_,$,J,re,F,ne,D,U,ie,X,v,le,j,ue,ce,O,m,fe,g,de,he,I,B,me,pe,G,A,ye,Q,T,we,Y,_e,ve,R,E,V,C,Te,K,h,N,b,Je,ge,z,k,Ie,Ee,S,q,be,ke,P,M,qe,Me,Z,x,xe,ee,H,Ue,te;return J=new dt({}),E=new ht({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)`}}),{c(){y=a("meta"),L=f(),w=a("h1"),_=a("a"),$=a("span"),et(J.$$.fragment),re=f(),F=a("span"),ne=i("Hands-on exercise"),D=f(),U=a("p"),ie=i(`It\u2019s 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.`),X=f(),v=a("p"),le=i(`Here are the instructions.
In this unit, we demonstrated how to fine-tune a Hubert model on `),j=a("code"),ue=i("marsyas/gtzan"),ce=i(` dataset for music classification. Our example achieved 83% accuracy.
Your task is to improve upon this accuracy metric.`),O=f(),m=a("p"),fe=i("Feel free to choose any model on the "),g=a("a"),de=i("\u{1F917} Hub"),he=i(` that you think is suitable for audio classification,
and use the exact same dataset `),I=a("a"),B=a("code"),me=i("marsyas/gtzan"),pe=i(" to build your own classifier."),G=f(),A=a("p"),ye=i(`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\u2019s up to you!`),Q=f(),T=a("p"),we=i(`For your result to count towards your certificate, don\u2019t forget to push your model to Hub as was shown in this unit with
the following `),Y=a("code"),_e=i("**kwargs"),ve=i(" at the end of the training:"),R=f(),et(E.$$.fragment),V=f(),C=a("p"),Te=i("Here are some additional resources that you may find helpful when working on this exercise:"),K=f(),h=a("ul"),N=a("li"),b=a("a"),Je=i("Audio classification task guide in Transformers documentation"),ge=f(),z=a("li"),k=a("a"),Ie=i("Hubert model documentation"),Ee=f(),S=a("li"),q=a("a"),be=i("M-CTC-T model documentation"),ke=f(),P=a("li"),M=a("a"),qe=i("Audio Spectrogram Transformer documentation"),Me=f(),Z=a("li"),x=a("a"),xe=i("Wav2Vec2 documentation"),ee=f(),H=a("p"),Ue=i("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."),this.h()},l(e){const n=ut('[data-svelte="svelte-1phssyn"]',document.head);y=s(n,"META",{name:!0,content:!0}),n.forEach(t),L=d(e),w=s(e,"H1",{class:!0});var oe=r(w);_=s(oe,"A",{id:!0,class:!0,href:!0});var Ce=r(_);$=s(Ce,"SPAN",{});var He=r($);tt(J.$$.fragment,He),He.forEach(t),Ce.forEach(t),re=d(oe),F=s(oe,"SPAN",{});var We=r(F);ne=l(We,"Hands-on exercise"),We.forEach(t),oe.forEach(t),D=d(e),U=s(e,"P",{});var $e=r(U);ie=l($e,`It\u2019s 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.`),$e.forEach(t),X=d(e),v=s(e,"P",{});var ae=r(v);le=l(ae,`Here are the instructions.
In this unit, we demonstrated how to fine-tune a Hubert model on `),j=s(ae,"CODE",{});var Fe=r(j);ue=l(Fe,"marsyas/gtzan"),Fe.forEach(t),ce=l(ae,` dataset for music classification. Our example achieved 83% accuracy.
Your task is to improve upon this accuracy metric.`),ae.forEach(t),O=d(e),m=s(e,"P",{});var W=r(m);fe=l(W,"Feel free to choose any model on the "),g=s(W,"A",{href:!0,rel:!0});var je=r(g);de=l(je,"\u{1F917} Hub"),je.forEach(t),he=l(W,` that you think is suitable for audio classification,
and use the exact same dataset `),I=s(W,"A",{href:!0,rel:!0});var Be=r(I);B=s(Be,"CODE",{});var Ye=r(B);me=l(Ye,"marsyas/gtzan"),Ye.forEach(t),Be.forEach(t),pe=l(W," to build your own classifier."),W.forEach(t),G=d(e),A=s(e,"P",{});var Ne=r(A);ye=l(Ne,`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\u2019s up to you!`),Ne.forEach(t),Q=d(e),T=s(e,"P",{});var se=r(T);we=l(se,`For your result to count towards your certificate, don\u2019t forget to push your model to Hub as was shown in this unit with
the following `),Y=s(se,"CODE",{});var ze=r(Y);_e=l(ze,"**kwargs"),ze.forEach(t),ve=l(se," at the end of the training:"),se.forEach(t),R=d(e),tt(E.$$.fragment,e),V=d(e),C=s(e,"P",{});var Se=r(C);Te=l(Se,"Here are some additional resources that you may find helpful when working on this exercise:"),Se.forEach(t),K=d(e),h=s(e,"UL",{});var p=r(h);N=s(p,"LI",{});var Pe=r(N);b=s(Pe,"A",{href:!0,rel:!0});var Ze=r(b);Je=l(Ze,"Audio classification task guide in Transformers documentation"),Ze.forEach(t),Pe.forEach(t),ge=d(p),z=s(p,"LI",{});var Le=r(z);k=s(Le,"A",{href:!0,rel:!0});var De=r(k);Ie=l(De,"Hubert model documentation"),De.forEach(t),Le.forEach(t),Ee=d(p),S=s(p,"LI",{});var Xe=r(S);q=s(Xe,"A",{href:!0,rel:!0});var Oe=r(q);be=l(Oe,"M-CTC-T model documentation"),Oe.forEach(t),Xe.forEach(t),ke=d(p),P=s(p,"LI",{});var Ge=r(P);M=s(Ge,"A",{href:!0,rel:!0});var Qe=r(M);qe=l(Qe,"Audio Spectrogram Transformer documentation"),Qe.forEach(t),Ge.forEach(t),Me=d(p),Z=s(p,"LI",{});var Re=r(Z);x=s(Re,"A",{href:!0,rel:!0});var Ve=r(x);xe=l(Ve,"Wav2Vec2 documentation"),Ve.forEach(t),Re.forEach(t),p.forEach(t),ee=d(e),H=s(e,"P",{});var Ke=r(H);Ue=l(Ke,"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."),Ke.forEach(t),this.h()},h(){u(y,"name","hf:doc:metadata"),u(y,"content",JSON.stringify(pt)),u(_,"id","handson-exercise"),u(_,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(_,"href","#handson-exercise"),u(w,"class","relative group"),u(g,"href","https://huggingface.co/models"),u(g,"rel","nofollow"),u(I,"href","https://huggingface.co/datasets/marsyas/gtzan"),u(I,"rel","nofollow"),u(b,"href","https://huggingface.co/docs/transformers/tasks/audio_classification"),u(b,"rel","nofollow"),u(k,"href","https://huggingface.co/docs/transformers/model_doc/hubert"),u(k,"rel","nofollow"),u(q,"href","https://huggingface.co/docs/transformers/model_doc/mctct"),u(q,"rel","nofollow"),u(M,"href","https://huggingface.co/docs/transformers/model_doc/audio-spectrogram-transformer"),u(M,"rel","nofollow"),u(x,"href","https://huggingface.co/docs/transformers/model_doc/wav2vec2"),u(x,"rel","nofollow")},m(e,n){o(document.head,y),c(e,L,n),c(e,w,n),o(w,_),o(_,$),ot(J,$,null),o(w,re),o(w,F),o(F,ne),c(e,D,n),c(e,U,n),o(U,ie),c(e,X,n),c(e,v,n),o(v,le),o(v,j),o(j,ue),o(v,ce),c(e,O,n),c(e,m,n),o(m,fe),o(m,g),o(g,de),o(m,he),o(m,I),o(I,B),o(B,me),o(m,pe),c(e,G,n),c(e,A,n),o(A,ye),c(e,Q,n),c(e,T,n),o(T,we),o(T,Y),o(Y,_e),o(T,ve),c(e,R,n),ot(E,e,n),c(e,V,n),c(e,C,n),o(C,Te),c(e,K,n),c(e,h,n),o(h,N),o(N,b),o(b,Je),o(h,ge),o(h,z),o(z,k),o(k,Ie),o(h,Ee),o(h,S),o(S,q),o(q,be),o(h,ke),o(h,P),o(P,M),o(M,qe),o(h,Me),o(h,Z),o(Z,x),o(x,xe),c(e,ee,n),c(e,H,n),o(H,Ue),te=!0},p:ct,i(e){te||(at(J.$$.fragment,e),at(E.$$.fragment,e),te=!0)},o(e){st(J.$$.fragment,e),st(E.$$.fragment,e),te=!1},d(e){t(y),e&&t(L),e&&t(w),rt(J),e&&t(D),e&&t(U),e&&t(X),e&&t(v),e&&t(O),e&&t(m),e&&t(G),e&&t(A),e&&t(Q),e&&t(T),e&&t(R),rt(E,e),e&&t(V),e&&t(C),e&&t(K),e&&t(h),e&&t(ee),e&&t(H)}}}const pt={local:"handson-exercise",title:"Hands-on exercise"};function yt(Ae){return ft(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Tt extends nt{constructor(y){super();it(this,y,yt,mt,lt,{})}}export{Tt as default,pt as metadata};
