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