import{S as ke,i as be,s as $e,e as n,k as T,w as le,t as i,M as Ae,c as s,d as o,m as I,x as ne,a as c,h as l,b as A,G as e,g as k,y as se,q as he,o as ce,B as ue,v as Ce}from"../../chunks/vendor-hf-doc-builder.js";import{T as Te}from"../../chunks/Tip-hf-doc-builder.js";import{I as Ie}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{F as Pe}from"../../chunks/FrameworkSwitchCourse-hf-doc-builder.js";function Le(B){let a,y,h,m,v,u,P,b,g,L,N,w,E,H,_,C,O;return{c(){a=n("p"),y=i("To do this, you\u2019ll need to leverage everything you learned about training models with the Keras API in "),h=n("a"),m=i("Chapter 3"),v=i(", the \u{1F917} Datasets library in "),u=n("a"),P=i("Chapter 5"),b=i(", and the \u{1F917} Tokenizers library in "),g=n("a"),L=i("Chapter 6"),N=i(". We\u2019ll also upload our results to the Model Hub, like we did in "),w=n("a"),E=i("Chapter 4"),H=i(", so this is really the chapter where everything comes together!"),_=T(),C=n("p"),O=i("Each section can be read independently."),this.h()},l(f){a=s(f,"P",{});var r=c(a);y=l(r,"To do this, you\u2019ll need to leverage everything you learned about training models with the Keras API in "),h=s(r,"A",{href:!0});var S=c(h);m=l(S,"Chapter 3"),S.forEach(o),v=l(r,", the \u{1F917} Datasets library in "),u=s(r,"A",{href:!0});var z=c(u);P=l(z,"Chapter 5"),z.forEach(o),b=l(r,", and the \u{1F917} Tokenizers library in "),g=s(r,"A",{href:!0});var W=c(g);L=l(W,"Chapter 6"),W.forEach(o),N=l(r,". We\u2019ll also upload our results to the Model Hub, like we did in "),w=s(r,"A",{href:!0});var D=c(w);E=l(D,"Chapter 4"),D.forEach(o),H=l(r,", so this is really the chapter where everything comes together!"),r.forEach(o),_=I(f),C=s(f,"P",{});var q=c(C);O=l(q,"Each section can be read independently."),q.forEach(o),this.h()},h(){A(h,"href","/course/chapter3"),A(u,"href","/course/chapter5"),A(g,"href","/course/chapter6"),A(w,"href","/course/chapter4")},m(f,r){k(f,a,r),e(a,y),e(a,h),e(h,m),e(a,v),e(a,u),e(u,P),e(a,b),e(a,g),e(g,L),e(a,N),e(a,w),e(w,E),e(a,H),k(f,_,r),k(f,C,r),e(C,O)},d(f){f&&o(a),f&&o(_),f&&o(C)}}}function Me(B){let a,y,h,m,v,u,P,b,g,L,N,w,E,H,_,C,O,f,r,S,z,W,D,q,V,G,R,X,K;return{c(){a=n("p"),y=i("To do this, you\u2019ll need to leverage everything you learned about the "),h=n("code"),m=i("Trainer"),v=i(" API and the \u{1F917} Accelerate library in "),u=n("a"),P=i("Chapter 3"),b=i(", the \u{1F917} Datasets library in "),g=n("a"),L=i("Chapter 5"),N=i(", and the \u{1F917} Tokenizers library in "),w=n("a"),E=i("Chapter 6"),H=i(". We\u2019ll also upload our results to the Model Hub, like we did in "),_=n("a"),C=i("Chapter 4"),O=i(", so this is really the chapter where everything comes together!"),f=T(),r=n("p"),S=i("Each section can be read independently and will show you how to train a model with the "),z=n("code"),W=i("Trainer"),D=i(" API or with your own training loop, using \u{1F917} Accelerate. Feel free to skip either part and focus on the one that interests you the most: the "),q=n("code"),V=i("Trainer"),G=i(" API is great for fine-tuning or training your model without worrying about what\u2019s going on behind the scenes, while the training loop with "),R=n("code"),X=i("Accelerate"),K=i(" will let you customize any part you want more easily."),this.h()},l($){a=s($,"P",{});var d=c(a);y=l(d,"To do this, you\u2019ll need to leverage everything you learned about the "),h=s(d,"CODE",{});var J=c(h);m=l(J,"Trainer"),J.forEach(o),v=l(d," API and the \u{1F917} Accelerate library in "),u=s(d,"A",{href:!0});var ee=c(u);P=l(ee,"Chapter 3"),ee.forEach(o),b=l(d,", the \u{1F917} Datasets library in "),g=s(d,"A",{href:!0});var te=c(g);L=l(te,"Chapter 5"),te.forEach(o),N=l(d,", and the \u{1F917} Tokenizers library in "),w=s(d,"A",{href:!0});var j=c(w);E=l(j,"Chapter 6"),j.forEach(o),H=l(d,". We\u2019ll also upload our results to the Model Hub, like we did in "),_=s(d,"A",{href:!0});var ae=c(_);C=l(ae,"Chapter 4"),ae.forEach(o),O=l(d,", so this is really the chapter where everything comes together!"),d.forEach(o),f=I($),r=s($,"P",{});var M=c(r);S=l(M,"Each section can be read independently and will show you how to train a model with the "),z=s(M,"CODE",{});var Q=c(z);W=l(Q,"Trainer"),Q.forEach(o),D=l(M," API or with your own training loop, using \u{1F917} Accelerate. Feel free to skip either part and focus on the one that interests you the most: the "),q=s(M,"CODE",{});var F=c(q);V=l(F,"Trainer"),F.forEach(o),G=l(M," API is great for fine-tuning or training your model without worrying about what\u2019s going on behind the scenes, while the training loop with "),R=s(M,"CODE",{});var Y=c(R);X=l(Y,"Accelerate"),Y.forEach(o),K=l(M," will let you customize any part you want more easily."),M.forEach(o),this.h()},h(){A(u,"href","/course/chapter3"),A(g,"href","/course/chapter5"),A(w,"href","/course/chapter6"),A(_,"href","/course/chapter4")},m($,d){k($,a,d),e(a,y),e(a,h),e(h,m),e(a,v),e(a,u),e(u,P),e(a,b),e(a,g),e(g,L),e(a,N),e(a,w),e(w,E),e(a,H),e(a,_),e(_,C),e(a,O),k($,f,d),k($,r,d),e(r,S),e(r,z),e(z,W),e(r,D),e(r,q),e(q,V),e(r,G),e(r,R),e(R,X),e(r,K)},d($){$&&o(a),$&&o(f),$&&o(r)}}}function Se(B){let a,y;return{c(){a=n("p"),y=i("If you read the sections in sequence, you will notice that they have quite a bit of code and prose in common. The repetition is intentional, to allow you to dip in (or come back later) to any task that interests you and find a complete working example.")},l(h){a=s(h,"P",{});var m=c(a);y=l(m,"If you read the sections in sequence, you will notice that they have quite a bit of code and prose in common. The repetition is intentional, to allow you to dip in (or come back later) to any task that interests you and find a complete working example."),m.forEach(o)},m(h,m){k(h,a,m),e(a,y)},d(h){h&&o(a)}}}function ze(B){let a,y,h,m,v,u,P,b,g,L,N,w,E,H,_,C,O,f,r,S,z,W,D,q,V,G,R,X,K,$,d,J,ee,te,j,ae,M,Q,F,Y;h=new Pe({props:{fw:B[0]}}),b=new Ie({});function fe(t,p){return t[0]==="pt"?Me:Le}let re=fe(B),U=re(B);return F=new Te({props:{$$slots:{default:[Se]},$$scope:{ctx:B}}}),{c(){a=n("meta"),y=T(),le(h.$$.fragment),m=T(),v=n("h1"),u=n("a"),P=n("span"),le(b.$$.fragment),g=T(),L=n("span"),N=i("Introduction"),w=T(),E=n("p"),H=i("In "),_=n("a"),C=i("Chapter 3"),O=i(", you saw how to fine-tune a model for text classification. In this chapter, we will tackle the following common NLP tasks:"),f=T(),r=n("ul"),S=n("li"),z=i("Token classification"),W=T(),D=n("li"),q=i("Masked language modeling (like BERT)"),V=T(),G=n("li"),R=i("Summarization"),X=T(),K=n("li"),$=i("Translation"),d=T(),J=n("li"),ee=i("Causal language modeling pretraining (like GPT-2)"),te=T(),j=n("li"),ae=i("Question answering"),M=T(),U.c(),Q=T(),le(F.$$.fragment),this.h()},l(t){const p=Ae('[data-svelte="svelte-1phssyn"]',document.head);a=s(p,"META",{name:!0,content:!0}),p.forEach(o),y=I(t),ne(h.$$.fragment,t),m=I(t),v=s(t,"H1",{class:!0});var Z=c(v);u=s(Z,"A",{id:!0,class:!0,href:!0});var oe=c(u);P=s(oe,"SPAN",{});var de=c(P);ne(b.$$.fragment,de),de.forEach(o),oe.forEach(o),g=I(Z),L=s(Z,"SPAN",{});var pe=c(L);N=l(pe,"Introduction"),pe.forEach(o),Z.forEach(o),w=I(t),E=s(t,"P",{});var ie=c(E);H=l(ie,"In "),_=s(ie,"A",{href:!0});var me=c(_);C=l(me,"Chapter 3"),me.forEach(o),O=l(ie,", you saw how to fine-tune a model for text classification. In this chapter, we will tackle the following common NLP tasks:"),ie.forEach(o),f=I(t),r=s(t,"UL",{});var x=c(r);S=s(x,"LI",{});var ye=c(S);z=l(ye,"Token classification"),ye.forEach(o),W=I(x),D=s(x,"LI",{});var we=c(D);q=l(we,"Masked language modeling (like BERT)"),we.forEach(o),V=I(x),G=s(x,"LI",{});var _e=c(G);R=l(_e,"Summarization"),_e.forEach(o),X=I(x),K=s(x,"LI",{});var ve=c(K);$=l(ve,"Translation"),ve.forEach(o),d=I(x),J=s(x,"LI",{});var ge=c(J);ee=l(ge,"Causal language modeling pretraining (like GPT-2)"),ge.forEach(o),te=I(x),j=s(x,"LI",{});var Ee=c(j);ae=l(Ee,"Question answering"),Ee.forEach(o),x.forEach(o),M=I(t),U.l(t),Q=I(t),ne(F.$$.fragment,t),this.h()},h(){A(a,"name","hf:doc:metadata"),A(a,"content",JSON.stringify(De)),A(u,"id","introduction"),A(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"),A(u,"href","#introduction"),A(v,"class","relative group"),A(_,"href","/course/chapter3")},m(t,p){e(document.head,a),k(t,y,p),se(h,t,p),k(t,m,p),k(t,v,p),e(v,u),e(u,P),se(b,P,null),e(v,g),e(v,L),e(L,N),k(t,w,p),k(t,E,p),e(E,H),e(E,_),e(_,C),e(E,O),k(t,f,p),k(t,r,p),e(r,S),e(S,z),e(r,W),e(r,D),e(D,q),e(r,V),e(r,G),e(G,R),e(r,X),e(r,K),e(K,$),e(r,d),e(r,J),e(J,ee),e(r,te),e(r,j),e(j,ae),k(t,M,p),U.m(t,p),k(t,Q,p),se(F,t,p),Y=!0},p(t,[p]){const Z={};p&1&&(Z.fw=t[0]),h.$set(Z),re!==(re=fe(t))&&(U.d(1),U=re(t),U&&(U.c(),U.m(Q.parentNode,Q)));const oe={};p&2&&(oe.$$scope={dirty:p,ctx:t}),F.$set(oe)},i(t){Y||(he(h.$$.fragment,t),he(b.$$.fragment,t),he(F.$$.fragment,t),Y=!0)},o(t){ce(h.$$.fragment,t),ce(b.$$.fragment,t),ce(F.$$.fragment,t),Y=!1},d(t){o(a),t&&o(y),ue(h,t),t&&o(m),t&&o(v),ue(b),t&&o(w),t&&o(E),t&&o(f),t&&o(r),t&&o(M),U.d(t),t&&o(Q),ue(F,t)}}}const De={local:"introduction",title:"Introduction"};function qe(B,a,y){let h="pt";return Ce(()=>{const m=new URLSearchParams(window.location.search);y(0,h=m.get("fw")||"pt")}),[h]}class Fe extends ke{constructor(a){super();be(this,a,qe,ze,$e,{})}}export{Fe as default,De as metadata};
