import{S as Sf,i as Yf,s as Pf,e as r,k as u,w as J,t as s,M as Qf,c as a,d as l,m as p,a as o,x as U,h as i,b as h,G as t,g as f,y as g,q as b,o as A,B as j,v as Df,L as ao}from"../chunks/vendor-hf-doc-builder.js";import{I as le}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as V}from"../chunks/CodeBlock-hf-doc-builder.js";import{F as Bf,M as oo}from"../chunks/Markdown-hf-doc-builder.js";function Hf(L){let c,_,m,M,$,T,k,G,W,z,E,Z,I,N,R,X,F,v,y,B;return y=new V({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZ0c3Qtc3VtbWFyaXphdGlvbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdmVyd3JpdGVfb3V0cHV0X2RpciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJlZGljdF93aXRoX2dlbmVyYXRl",highlighted:`python examples/pytorch/summarization/run_summarization.py \\
    --model_name_or_path t5-small \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --overwrite_output_dir \\
    --predict_with_generate`}}),{c(){c=r("p"),_=s("The example script downloads and preprocesses a dataset from the \u{1F917} "),m=r("a"),M=s("Datasets"),$=s(" library. Then the script fine-tunes a dataset with the "),T=r("a"),k=s("Trainer"),G=s(" on an architecture that supports summarization. The following example shows how to fine-tune "),W=r("a"),z=s("T5-small"),E=s(" on the "),Z=r("a"),I=s("CNN/DailyMail"),N=s(" dataset. The T5 model requires an additional "),R=r("code"),X=s("source_prefix"),F=s(" argument due to how it was trained. This prompt lets T5 know this is a summarization task."),v=u(),J(y.$$.fragment),this.h()},l(x){c=a(x,"P",{});var C=o(c);_=i(C,"The example script downloads and preprocesses a dataset from the \u{1F917} "),m=a(C,"A",{href:!0,rel:!0});var Y=o(m);M=i(Y,"Datasets"),Y.forEach(l),$=i(C," library. Then the script fine-tunes a dataset with the "),T=a(C,"A",{href:!0,rel:!0});var vt=o(T);k=i(vt,"Trainer"),vt.forEach(l),G=i(C," on an architecture that supports summarization. The following example shows how to fine-tune "),W=a(C,"A",{href:!0,rel:!0});var xe=o(W);z=i(xe,"T5-small"),xe.forEach(l),E=i(C," on the "),Z=a(C,"A",{href:!0,rel:!0});var S=o(Z);I=i(S,"CNN/DailyMail"),S.forEach(l),N=i(C," dataset. The T5 model requires an additional "),R=a(C,"CODE",{});var Tt=o(R);X=i(Tt,"source_prefix"),Tt.forEach(l),F=i(C," argument due to how it was trained. This prompt lets T5 know this is a summarization task."),C.forEach(l),v=p(x),U(y.$$.fragment,x),this.h()},h(){h(m,"href","https://huggingface.co/docs/datasets/"),h(m,"rel","nofollow"),h(T,"href","https://huggingface.co/docs/transformers/main_classes/trainer"),h(T,"rel","nofollow"),h(W,"href","https://huggingface.co/t5-small"),h(W,"rel","nofollow"),h(Z,"href","https://huggingface.co/datasets/cnn_dailymail"),h(Z,"rel","nofollow")},m(x,C){f(x,c,C),t(c,_),t(c,m),t(m,M),t(c,$),t(c,T),t(T,k),t(c,G),t(c,W),t(W,z),t(c,E),t(c,Z),t(Z,I),t(c,N),t(c,R),t(R,X),t(c,F),f(x,v,C),g(y,x,C),B=!0},p:ao,i(x){B||(b(y.$$.fragment,x),B=!0)},o(x){A(y.$$.fragment,x),B=!1},d(x){x&&l(c),x&&l(v),j(y,x)}}}function qf(L){let c,_;return c=new oo({props:{$$slots:{default:[Hf]},$$scope:{ctx:L}}}),{c(){J(c.$$.fragment)},l(m){U(c.$$.fragment,m)},m(m,M){g(c,m,M),_=!0},p(m,M){const $={};M&2&&($.$$scope={dirty:M,ctx:m}),c.$set($)},i(m){_||(b(c.$$.fragment,m),_=!0)},o(m){A(c.$$.fragment,m),_=!1},d(m){j(c,m)}}}function Of(L){let c,_,m,M,$,T,k,G,W,z,E,Z,I,N,R,X,F;return X=new V({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZ0ZW5zb3JmbG93JTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9uYW1lJTIwY25uX2RhaWx5bWFpbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9jb25maWclMjAlMjIzLjAuMCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3V0cHV0X2RpciUyMCUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9uJTIwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlMjA4JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUyMDE2JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1udW1fdHJhaW5fZXBvY2hzJTIwMyUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWw=",highlighted:`python examples/tensorflow/summarization/run_summarization.py  \\
    --model_name_or_path t5-small \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --output_dir /tmp/tst-summarization  \\
    --per_device_train_batch_size 8 \\
    --per_device_eval_batch_size 16 \\
    --num_train_epochs 3 \\
    --do_train \\
    --do_eval`}}),{c(){c=r("p"),_=s("The example script downloads and preprocesses a dataset from the \u{1F917} "),m=r("a"),M=s("Datasets"),$=s(" library. Then the script fine-tunes a dataset using Keras on an architecture that supports summarization. The following example shows how to fine-tune "),T=r("a"),k=s("T5-small"),G=s(" on the "),W=r("a"),z=s("CNN/DailyMail"),E=s(" dataset. The T5 model requires an additional "),Z=r("code"),I=s("source_prefix"),N=s(" argument due to how it was trained. This prompt lets T5 know this is a summarization task."),R=u(),J(X.$$.fragment),this.h()},l(v){c=a(v,"P",{});var y=o(c);_=i(y,"The example script downloads and preprocesses a dataset from the \u{1F917} "),m=a(y,"A",{href:!0,rel:!0});var B=o(m);M=i(B,"Datasets"),B.forEach(l),$=i(y," library. Then the script fine-tunes a dataset using Keras on an architecture that supports summarization. The following example shows how to fine-tune "),T=a(y,"A",{href:!0,rel:!0});var x=o(T);k=i(x,"T5-small"),x.forEach(l),G=i(y," on the "),W=a(y,"A",{href:!0,rel:!0});var C=o(W);z=i(C,"CNN/DailyMail"),C.forEach(l),E=i(y," dataset. The T5 model requires an additional "),Z=a(y,"CODE",{});var Y=o(Z);I=i(Y,"source_prefix"),Y.forEach(l),N=i(y," argument due to how it was trained. This prompt lets T5 know this is a summarization task."),y.forEach(l),R=p(v),U(X.$$.fragment,v),this.h()},h(){h(m,"href","https://huggingface.co/docs/datasets/"),h(m,"rel","nofollow"),h(T,"href","https://huggingface.co/t5-small"),h(T,"rel","nofollow"),h(W,"href","https://huggingface.co/datasets/cnn_dailymail"),h(W,"rel","nofollow")},m(v,y){f(v,c,y),t(c,_),t(c,m),t(m,M),t(c,$),t(c,T),t(T,k),t(c,G),t(c,W),t(W,z),t(c,E),t(c,Z),t(Z,I),t(c,N),f(v,R,y),g(X,v,y),F=!0},p:ao,i(v){F||(b(X.$$.fragment,v),F=!0)},o(v){A(X.$$.fragment,v),F=!1},d(v){v&&l(c),v&&l(R),j(X,v)}}}function Kf(L){let c,_;return c=new oo({props:{$$slots:{default:[Of]},$$scope:{ctx:L}}}),{c(){J(c.$$.fragment)},l(m){U(c.$$.fragment,m)},m(m,M){g(c,m,M),_=!0},p(m,M){const $={};M&2&&($.$$scope={dirty:M,ctx:m}),c.$set($)},i(m){_||(b(c.$$.fragment,m),_=!0)},o(m){A(c.$$.fragment,m),_=!1},d(m){j(c,m)}}}function eu(L){let c,_,m,M,$,T,k,G,W,z,E,Z,I,N,R,X,F;return X=new V({props:{code:"cHl0aG9uJTIweGxhX3NwYXduLnB5JTIwLS1udW1fY29yZXMlMjA4JTIwJTVDJTBBJTIwJTIwJTIwJTIwc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZ0c3Qtc3VtbWFyaXphdGlvbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdmVyd3JpdGVfb3V0cHV0X2RpciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJlZGljdF93aXRoX2dlbmVyYXRl",highlighted:`python xla_spawn.py --num_cores 8 \\
    summarization/run_summarization.py \\
    --model_name_or_path t5-small \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --overwrite_output_dir \\
    --predict_with_generate`}}),{c(){c=r("p"),_=s("Tensor Processing Units (TPUs) are specifically designed to accelerate performance. PyTorch supports TPUs with the "),m=r("a"),M=s("XLA"),$=s(" deep learning compiler (see "),T=r("a"),k=s("here"),G=s(" for more details). To use a TPU, launch the "),W=r("code"),z=s("xla_spawn.py"),E=s(" script and use the "),Z=r("code"),I=s("num_cores"),N=s(" argument to set the number of TPU cores you want to use."),R=u(),J(X.$$.fragment),this.h()},l(v){c=a(v,"P",{});var y=o(c);_=i(y,"Tensor Processing Units (TPUs) are specifically designed to accelerate performance. PyTorch supports TPUs with the "),m=a(y,"A",{href:!0,rel:!0});var B=o(m);M=i(B,"XLA"),B.forEach(l),$=i(y," deep learning compiler (see "),T=a(y,"A",{href:!0,rel:!0});var x=o(T);k=i(x,"here"),x.forEach(l),G=i(y," for more details). To use a TPU, launch the "),W=a(y,"CODE",{});var C=o(W);z=i(C,"xla_spawn.py"),C.forEach(l),E=i(y," script and use the "),Z=a(y,"CODE",{});var Y=o(Z);I=i(Y,"num_cores"),Y.forEach(l),N=i(y," argument to set the number of TPU cores you want to use."),y.forEach(l),R=p(v),U(X.$$.fragment,v),this.h()},h(){h(m,"href","https://www.tensorflow.org/xla"),h(m,"rel","nofollow"),h(T,"href","https://github.com/pytorch/xla/blob/master/README.md"),h(T,"rel","nofollow")},m(v,y){f(v,c,y),t(c,_),t(c,m),t(m,M),t(c,$),t(c,T),t(T,k),t(c,G),t(c,W),t(W,z),t(c,E),t(c,Z),t(Z,I),t(c,N),f(v,R,y),g(X,v,y),F=!0},p:ao,i(v){F||(b(X.$$.fragment,v),F=!0)},o(v){A(X.$$.fragment,v),F=!1},d(v){v&&l(c),v&&l(R),j(X,v)}}}function tu(L){let c,_;return c=new oo({props:{$$slots:{default:[eu]},$$scope:{ctx:L}}}),{c(){J(c.$$.fragment)},l(m){U(c.$$.fragment,m)},m(m,M){g(c,m,M),_=!0},p(m,M){const $={};M&2&&($.$$scope={dirty:M,ctx:m}),c.$set($)},i(m){_||(b(c.$$.fragment,m),_=!0)},o(m){A(c.$$.fragment,m),_=!1},d(m){j(c,m)}}}function lu(L){let c,_,m,M,$,T,k,G,W,z,E,Z;return E=new V({props:{code:"cHl0aG9uJTIwcnVuX3N1bW1hcml6YXRpb24ucHklMjAlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRwdSUyMG5hbWVfb2ZfdHB1X3Jlc291cmNlJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9uYW1lJTIwY25uX2RhaWx5bWFpbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9jb25maWclMjAlMjIzLjAuMCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3V0cHV0X2RpciUyMCUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9uJTIwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlMjA4JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUyMDE2JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1udW1fdHJhaW5fZXBvY2hzJTIwMyUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWw=",highlighted:`python run_summarization.py  \\
    --tpu name_of_tpu_resource \\
    --model_name_or_path t5-small \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --output_dir /tmp/tst-summarization  \\
    --per_device_train_batch_size 8 \\
    --per_device_eval_batch_size 16 \\
    --num_train_epochs 3 \\
    --do_train \\
    --do_eval`}}),{c(){c=r("p"),_=s("Tensor Processing Units (TPUs) are specifically designed to accelerate performance. TensorFlow scripts utilize a "),m=r("a"),M=r("code"),$=s("TPUStrategy"),T=s(" for training on TPUs. To use a TPU, pass the name of the TPU resource to the "),k=r("code"),G=s("tpu"),W=s(" argument."),z=u(),J(E.$$.fragment),this.h()},l(I){c=a(I,"P",{});var N=o(c);_=i(N,"Tensor Processing Units (TPUs) are specifically designed to accelerate performance. TensorFlow scripts utilize a "),m=a(N,"A",{href:!0,rel:!0});var R=o(m);M=a(R,"CODE",{});var X=o(M);$=i(X,"TPUStrategy"),X.forEach(l),R.forEach(l),T=i(N," for training on TPUs. To use a TPU, pass the name of the TPU resource to the "),k=a(N,"CODE",{});var F=o(k);G=i(F,"tpu"),F.forEach(l),W=i(N," argument."),N.forEach(l),z=p(I),U(E.$$.fragment,I),this.h()},h(){h(m,"href","https://www.tensorflow.org/guide/distributed_training#tpustrategy"),h(m,"rel","nofollow")},m(I,N){f(I,c,N),t(c,_),t(c,m),t(m,M),t(M,$),t(c,T),t(c,k),t(k,G),t(c,W),f(I,z,N),g(E,I,N),Z=!0},p:ao,i(I){Z||(b(E.$$.fragment,I),Z=!0)},o(I){A(E.$$.fragment,I),Z=!1},d(I){I&&l(c),I&&l(z),j(E,I)}}}function ru(L){let c,_;return c=new oo({props:{$$slots:{default:[lu]},$$scope:{ctx:L}}}),{c(){J(c.$$.fragment)},l(m){U(c.$$.fragment,m)},m(m,M){g(c,m,M),_=!0},p(m,M){const $={};M&2&&($.$$scope={dirty:M,ctx:m}),c.$set($)},i(m){_||(b(c.$$.fragment,m),_=!0)},o(m){A(c.$$.fragment,m),_=!1},d(m){j(c,m)}}}function au(L){let c,_,m,M,$,T,k,G,W,z,E,Z,I,N,R,X,F,v,y,B,x,C,Y,vt,xe,S,Tt,Re,so,io,ke,no,ho,xr,Jt,fo,Rr,D,uo,Ge,po,co,ze,mo,wo,kr,H,Mo,Fe,yo,_o,Ve,vo,To,Gr,re,pe,dl,Le,Jo,wl,Uo,zr,ce,go,Ml,bo,Ao,Fr,Be,Vr,Ut,jo,Lr,me,yl,Eo,Io,d,_l,gt,$o,Xo,vl,bt,Co,Wo,Tl,At,Zo,No,Jl,jt,xo,Ro,Ul,Et,ko,Go,gl,It,zo,Fo,bl,$t,Vo,Lo,Al,Xt,Bo,So,jl,Ct,Yo,Po,El,Wt,Qo,Do,Il,Zt,Ho,qo,$l,Nt,Oo,Ko,Xl,xt,es,ts,Cl,Rt,ls,rs,Wl,kt,as,os,Zl,Gt,ss,is,Nl,zt,ns,hs,xl,Ft,fs,us,Rl,Vt,ps,cs,kl,Lt,ms,ds,Gl,Bt,ws,Ms,zl,St,ys,_s,Fl,Yt,vs,Ts,Vl,Pt,Js,Us,Ll,Qt,gs,bs,Bl,Dt,As,js,Sl,Ht,Es,Br,qt,Is,Sr,Se,Yr,Ot,$s,Pr,Ye,Qr,ae,de,Yl,Pe,Xs,Pl,Cs,Dr,we,Hr,oe,Me,Ql,Qe,Ws,Dl,Zs,qr,ye,Ns,De,xs,Rs,Or,_e,He,ks,Hl,Gs,zs,Fs,qe,Vs,ql,Ls,Bs,Kr,Oe,ea,ve,Ss,Ke,Ol,Ys,Ps,ta,se,Te,Kl,et,Qs,er,Ds,la,Je,ra,ie,Ue,tr,tt,Hs,lr,qs,aa,ge,Os,lt,Ks,ei,oa,be,rr,ti,li,rt,sa,P,ri,ar,ai,oi,or,si,ii,sr,ni,hi,ia,at,na,Kt,fi,ha,ot,fa,el,ui,ua,st,pa,ne,Ae,ir,it,pi,nr,ci,ca,tl,mi,ma,q,je,hr,di,wi,fr,Mi,yi,_i,ll,ur,vi,Ti,Ji,rl,pr,Ui,gi,da,al,bi,wa,nt,Ma,he,Ee,cr,ht,Ai,mr,ji,ya,ol,Ei,_a,O,dr,wr,Ii,$i,Mr,yr,Xi,Ci,_r,vr,Wi,va,ft,Ta,K,Zi,Tr,Ni,xi,Jr,Ri,ki,Ja,ut,Ua,fe,Ie,Ur,pt,Gi,gr,zi,ga,sl,Fi,ba,Q,Vi,br,Li,Bi,Ar,Si,Yi,jr,Pi,Qi,Aa,ct,ja,$e,Di,Er,Hi,qi,Ea,mt,Ia,ue,Xe,Ir,dt,Oi,$r,Ki,$a,Ce,en,wt,tn,ln,Xa,Mt,Ca,ee,rn,Xr,an,on,Cr,sn,nn,Wa,We,hn,Wr,fn,un,Za,il,pn,Na,yt,xa;return T=new le({}),Le=new le({}),Be=new V({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRnRyYW5zZm9ybWVycyUwQWNkJTIwdHJhbnNmb3JtZXJzJTBBcGlwJTIwaW5zdGFsbCUyMC4=",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/huggingface/transformers
<span class="hljs-built_in">cd</span> transformers
pip install .`}}),Se=new V({props:{code:"Z2l0JTIwY2hlY2tvdXQlMjB0YWdzJTJGdjMuNS4x",highlighted:"git checkout tags/v3.5.1"}}),Ye=new V({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1yJTIwcmVxdWlyZW1lbnRzLnR4dA==",highlighted:"pip install -r requirements.txt"}}),Pe=new le({}),we=new Bf({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Kf],pytorch:[qf]},$$scope:{ctx:L}}}),Qe=new le({}),Oe=new V({props:{code:"cHl0aG9uJTIwLW0lMjB0b3JjaC5kaXN0cmlidXRlZC5sYXVuY2glMjAlNUMlMEElMjAlMjAlMjAlMjAtLW5wcm9jX3Blcl9ub2RlJTIwOCUyMHB5dG9yY2glMkZzdW1tYXJpemF0aW9uJTJGcnVuX3N1bW1hcml6YXRpb24ucHklMjAlNUMlMEElMjAlMjAlMjAlMjAtLWZwMTYlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW1vZGVsX25hbWVfb3JfcGF0aCUyMHQ1LXNtYWxsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kb190cmFpbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fZXZhbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9uYW1lJTIwY25uX2RhaWx5bWFpbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZGF0YXNldF9jb25maWclMjAlMjIzLjAuMCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tc291cmNlX3ByZWZpeCUyMCUyMnN1bW1hcml6ZSUzQSUyMCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3V0cHV0X2RpciUyMCUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9uJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW92ZXJ3cml0ZV9vdXRwdXRfZGlyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wcmVkaWN0X3dpdGhfZ2VuZXJhdGU=",highlighted:`python -m torch.distributed.launch \\
    --nproc_per_node 8 pytorch/summarization/run_summarization.py \\
    --fp16 \\
    --model_name_or_path t5-small \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --overwrite_output_dir \\
    --predict_with_generate`}}),et=new le({}),Je=new Bf({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ru],pytorch:[tu]},$$scope:{ctx:L}}}),tt=new le({}),rt=new V({props:{code:"cGlwJTIwaW5zdGFsbCUyMGdpdCUyQmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmh1Z2dpbmdmYWNlJTJGYWNjZWxlcmF0ZQ==",highlighted:"pip install git+https://github.com/huggingface/accelerate"}}),at=new V({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config"}}),ot=new V({props:{code:"YWNjZWxlcmF0ZSUyMHRlc3Q=",highlighted:'accelerate <span class="hljs-built_in">test</span>'}}),st=new V({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHJ1bl9zdW1tYXJpemF0aW9uX25vX3RyYWluZXIucHklMjAlNUMlMEElMjAlMjAlMjAlMjAtLW1vZGVsX25hbWVfb3JfcGF0aCUyMHQ1LXNtYWxsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X25hbWUlMjBjbm5fZGFpbHltYWlsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X2NvbmZpZyUyMCUyMjMuMC4wJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1zb3VyY2VfcHJlZml4JTIwJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwfiUyRnRtcCUyRnRzdC1zdW1tYXJpemF0aW9u",highlighted:`accelerate launch run_summarization_no_trainer.py \\
    --model_name_or_path t5-small \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir ~/tmp/tst-summarization`}}),it=new le({}),nt=new V({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRyYWluX2ZpbGUlMjBwYXRoX3RvX2Nzdl9vcl9qc29ubGluZXNfZmlsZSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tdmFsaWRhdGlvbl9maWxlJTIwcGF0aF90b19jc3Zfb3JfanNvbmxpbmVzX2ZpbGUlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXRleHRfY29sdW1uJTIwdGV4dF9jb2x1bW5fbmFtZSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tc3VtbWFyeV9jb2x1bW4lMjBzdW1tYXJ5X2NvbHVtbl9uYW1lJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1zb3VyY2VfcHJlZml4JTIwJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwJTJGdG1wJTJGdHN0LXN1bW1hcml6YXRpb24lMjAlNUMlMEElMjAlMjAlMjAlMjAtLW92ZXJ3cml0ZV9vdXRwdXRfZGlyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wZXJfZGV2aWNlX2V2YWxfYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXByZWRpY3Rfd2l0aF9nZW5lcmF0ZQ==",highlighted:`python examples/pytorch/summarization/run_summarization.py \\
    --model_name_or_path t5-small \\
    --do_train \\
    --do_eval \\
    --train_file path_to_csv_or_jsonlines_file \\
    --validation_file path_to_csv_or_jsonlines_file \\
    --text_column text_column_name \\
    --summary_column summary_column_name \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --overwrite_output_dir \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --predict_with_generate`}}),ht=new le({}),ft=new V({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tbWF4X3RyYWluX3NhbXBsZXMlMjA1MCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tbWF4X2V2YWxfc2FtcGxlcyUyMDUwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tYXhfcHJlZGljdF9zYW1wbGVzJTIwNTAlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX3RyYWluJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kb19ldmFsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X25hbWUlMjBjbm5fZGFpbHltYWlsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kYXRhc2V0X2NvbmZpZyUyMCUyMjMuMC4wJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1zb3VyY2VfcHJlZml4JTIwJTIyc3VtbWFyaXplJTNBJTIwJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwJTJGdG1wJTJGdHN0LXN1bW1hcml6YXRpb24lMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3ZlcndyaXRlX291dHB1dF9kaXIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXByZWRpY3Rfd2l0aF9nZW5lcmF0ZQ==",highlighted:`python examples/pytorch/summarization/run_summarization.py \\
    --model_name_or_path t5-small \\
    --max_train_samples 50 \\
    --max_eval_samples 50 \\
    --max_predict_samples 50 \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --overwrite_output_dir \\
    --predict_with_generate`}}),ut=new V({props:{code:"ZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTIwLWg=",highlighted:"examples/pytorch/summarization/run_summarization.py -h"}}),pt=new le({}),ct=new V({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZ0c3Qtc3VtbWFyaXphdGlvbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwcHJldmlvdXNfb3V0cHV0X2RpciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJlZGljdF93aXRoX2dlbmVyYXRl",highlighted:`python examples/pytorch/summarization/run_summarization.py
    --model_name_or_path t5-small \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --output_dir previous_output_dir \\
    --predict_with_generate`}}),mt=new V({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZ0c3Qtc3VtbWFyaXphdGlvbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV9ldmFsX2JhdGNoX3NpemUlM0Q0JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdmVyd3JpdGVfb3V0cHV0X2RpciUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcmVzdW1lX2Zyb21fY2hlY2twb2ludCUyMHBhdGhfdG9fc3BlY2lmaWNfY2hlY2twb2ludCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJlZGljdF93aXRoX2dlbmVyYXRl",highlighted:`python examples/pytorch/summarization/run_summarization.py
    --model_name_or_path t5-small \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --overwrite_output_dir \\
    --resume_from_checkpoint path_to_specific_checkpoint \\
    --predict_with_generate`}}),dt=new le({}),Mt=new V({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"huggingface-cli login"}}),yt=new V({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGc3VtbWFyaXphdGlvbiUyRnJ1bl9zdW1tYXJpemF0aW9uLnB5JTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjB0NS1zbWFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfbmFtZSUyMGNubl9kYWlseW1haWwlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRhdGFzZXRfY29uZmlnJTIwJTIyMy4wLjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXNvdXJjZV9wcmVmaXglMjAlMjJzdW1tYXJpemUlM0ElMjAlMjIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXB1c2hfdG9faHViJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wdXNoX3RvX2h1Yl9tb2RlbF9pZCUyMGZpbmV0dW5lZC10NS1jbm5fZGFpbHltYWlsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1vdXRwdXRfZGlyJTIwJTJGdG1wJTJGdHN0LXN1bW1hcml6YXRpb24lMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUzRDQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNENCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3ZlcndyaXRlX291dHB1dF9kaXIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXByZWRpY3Rfd2l0aF9nZW5lcmF0ZQ==",highlighted:`python examples/pytorch/summarization/run_summarization.py
    --model_name_or_path t5-small \\
    --do_train \\
    --do_eval \\
    --dataset_name cnn_dailymail \\
    --dataset_config <span class="hljs-string">&quot;3.0.0&quot;</span> \\
    --source_prefix <span class="hljs-string">&quot;summarize: &quot;</span> \\
    --push_to_hub \\
    --push_to_hub_model_id finetuned-t5-cnn_dailymail \\
    --output_dir /tmp/tst-summarization \\
    --per_device_train_batch_size=4 \\
    --per_device_eval_batch_size=4 \\
    --overwrite_output_dir \\
    --predict_with_generate`}}),{c(){c=r("meta"),_=u(),m=r("h1"),M=r("a"),$=r("span"),J(T.$$.fragment),k=u(),G=r("span"),W=s("Train with a script"),z=u(),E=r("p"),Z=s("Along with the \u{1F917} Transformers "),I=r("a"),N=s("notebooks"),R=s(", there are also example scripts demonstrating how to train a model for a task with "),X=r("a"),F=s("PyTorch"),v=s(", "),y=r("a"),B=s("TensorFlow"),x=s(", or "),C=r("a"),Y=s("JAX/Flax"),vt=s("."),xe=u(),S=r("p"),Tt=s("You will also find scripts we\u2019ve used in our "),Re=r("a"),so=s("research projects"),io=s(" and "),ke=r("a"),no=s("legacy examples"),ho=s(" which are mostly community contributed. These scripts are not actively maintained and require a specific version of \u{1F917} Transformers that will most likely be incompatible with the latest version of the library."),xr=u(),Jt=r("p"),fo=s("The example scripts are not expected to work out-of-the-box on every problem, and you may need to adapt the script to the problem you\u2019re trying to solve. To help you with this, most of the scripts fully expose how data is preprocessed, allowing you to edit it as necessary for your use case."),Rr=u(),D=r("p"),uo=s("For any feature you\u2019d like to implement in an example script, please discuss it on the "),Ge=r("a"),po=s("forum"),co=s(" or in an "),ze=r("a"),mo=s("issue"),wo=s(" before submitting a Pull Request. While we welcome bug fixes, it is unlikely we will merge a Pull Request that adds more functionality at the cost of readability."),kr=u(),H=r("p"),Mo=s("This guide will show you how to run an example summarization training script in "),Fe=r("a"),yo=s("PyTorch"),_o=s(" and "),Ve=r("a"),vo=s("TensorFlow"),To=s(". All examples are expected to work with both frameworks unless otherwise specified."),Gr=u(),re=r("h2"),pe=r("a"),dl=r("span"),J(Le.$$.fragment),Jo=u(),wl=r("span"),Uo=s("Setup"),zr=u(),ce=r("p"),go=s("To successfully run the latest version of the example scripts, you have to "),Ml=r("strong"),bo=s("install \u{1F917} Transformers from source"),Ao=s(" in a new virtual environment:"),Fr=u(),J(Be.$$.fragment),Vr=u(),Ut=r("p"),jo=s("For older versions of the example scripts, click on the toggle below:"),Lr=u(),me=r("details"),yl=r("summary"),Eo=s("Examples for older versions of \u{1F917} Transformers"),Io=u(),d=r("ul"),_l=r("li"),gt=r("a"),$o=s("v4.5.1"),Xo=u(),vl=r("li"),bt=r("a"),Co=s("v4.4.2"),Wo=u(),Tl=r("li"),At=r("a"),Zo=s("v4.3.3"),No=u(),Jl=r("li"),jt=r("a"),xo=s("v4.2.2"),Ro=u(),Ul=r("li"),Et=r("a"),ko=s("v4.1.1"),Go=u(),gl=r("li"),It=r("a"),zo=s("v4.0.1"),Fo=u(),bl=r("li"),$t=r("a"),Vo=s("v3.5.1"),Lo=u(),Al=r("li"),Xt=r("a"),Bo=s("v3.4.0"),So=u(),jl=r("li"),Ct=r("a"),Yo=s("v3.3.1"),Po=u(),El=r("li"),Wt=r("a"),Qo=s("v3.2.0"),Do=u(),Il=r("li"),Zt=r("a"),Ho=s("v3.1.0"),qo=u(),$l=r("li"),Nt=r("a"),Oo=s("v3.0.2"),Ko=u(),Xl=r("li"),xt=r("a"),es=s("v2.11.0"),ts=u(),Cl=r("li"),Rt=r("a"),ls=s("v2.10.0"),rs=u(),Wl=r("li"),kt=r("a"),as=s("v2.9.1"),os=u(),Zl=r("li"),Gt=r("a"),ss=s("v2.8.0"),is=u(),Nl=r("li"),zt=r("a"),ns=s("v2.7.0"),hs=u(),xl=r("li"),Ft=r("a"),fs=s("v2.6.0"),us=u(),Rl=r("li"),Vt=r("a"),ps=s("v2.5.1"),cs=u(),kl=r("li"),Lt=r("a"),ms=s("v2.4.0"),ds=u(),Gl=r("li"),Bt=r("a"),ws=s("v2.3.0"),Ms=u(),zl=r("li"),St=r("a"),ys=s("v2.2.0"),_s=u(),Fl=r("li"),Yt=r("a"),vs=s("v2.1.1"),Ts=u(),Vl=r("li"),Pt=r("a"),Js=s("v2.0.0"),Us=u(),Ll=r("li"),Qt=r("a"),gs=s("v1.2.0"),bs=u(),Bl=r("li"),Dt=r("a"),As=s("v1.1.0"),js=u(),Sl=r("li"),Ht=r("a"),Es=s("v1.0.0"),Br=u(),qt=r("p"),Is=s("Then switch your current clone of \u{1F917} Transformers to a specific version, like v3.5.1 for example:"),Sr=u(),J(Se.$$.fragment),Yr=u(),Ot=r("p"),$s=s("After you\u2019ve setup the correct library version, navigate to the example folder of your choice and install the example specific requirements:"),Pr=u(),J(Ye.$$.fragment),Qr=u(),ae=r("h2"),de=r("a"),Yl=r("span"),J(Pe.$$.fragment),Xs=u(),Pl=r("span"),Cs=s("Run a script"),Dr=u(),J(we.$$.fragment),Hr=u(),oe=r("h2"),Me=r("a"),Ql=r("span"),J(Qe.$$.fragment),Ws=u(),Dl=r("span"),Zs=s("Distributed training and mixed precision"),qr=u(),ye=r("p"),Ns=s("The "),De=r("a"),xs=s("Trainer"),Rs=s(" supports distributed training and mixed precision, which means you can also use it in a script. To enable both of these features:"),Or=u(),_e=r("ul"),He=r("li"),ks=s("Add the "),Hl=r("code"),Gs=s("fp16"),zs=s(" argument to enable mixed precision."),Fs=u(),qe=r("li"),Vs=s("Set the number of GPUs to use with the "),ql=r("code"),Ls=s("nproc_per_node"),Bs=s(" argument."),Kr=u(),J(Oe.$$.fragment),ea=u(),ve=r("p"),Ss=s("TensorFlow scripts utilize a "),Ke=r("a"),Ol=r("code"),Ys=s("MirroredStrategy"),Ps=s(" for distributed training, and you don\u2019t need to add any additional arguments to the training script. The TensorFlow script will use multiple GPUs by default if they are available."),ta=u(),se=r("h2"),Te=r("a"),Kl=r("span"),J(et.$$.fragment),Qs=u(),er=r("span"),Ds=s("Run a script on a TPU"),la=u(),J(Je.$$.fragment),ra=u(),ie=r("h2"),Ue=r("a"),tr=r("span"),J(tt.$$.fragment),Hs=u(),lr=r("span"),qs=s("Run a script with \u{1F917} Accelerate"),aa=u(),ge=r("p"),Os=s("\u{1F917} "),lt=r("a"),Ks=s("Accelerate"),ei=s(" is a PyTorch-only library that offers a unified method for training a model on several types of setups (CPU-only, multiple GPUs, TPUs) while maintaining complete visibility into the PyTorch training loop. Make sure you have \u{1F917} Accelerate installed if you don\u2019t already have it:"),oa=u(),be=r("blockquote"),rr=r("p"),ti=s("Note: As Accelerate is rapidly developing, the git version of accelerate must be installed to run the scripts"),li=u(),J(rt.$$.fragment),sa=u(),P=r("p"),ri=s("Instead of the "),ar=r("code"),ai=s("run_summarization.py"),oi=s(" script, you need to use the "),or=r("code"),si=s("run_summarization_no_trainer.py"),ii=s(" script. \u{1F917} Accelerate supported scripts will have a "),sr=r("code"),ni=s("task_no_trainer.py"),hi=s(" file in the folder. Begin by running the following command to create and save a configuration file:"),ia=u(),J(at.$$.fragment),na=u(),Kt=r("p"),fi=s("Test your setup to make sure it is configured correctly:"),ha=u(),J(ot.$$.fragment),fa=u(),el=r("p"),ui=s("Now you are ready to launch the training:"),ua=u(),J(st.$$.fragment),pa=u(),ne=r("h2"),Ae=r("a"),ir=r("span"),J(it.$$.fragment),pi=u(),nr=r("span"),ci=s("Use a custom dataset"),ca=u(),tl=r("p"),mi=s("The summarization script supports custom datasets as long as they are a CSV or JSON Line file. When you use your own dataset, you need to specify several additional arguments:"),ma=u(),q=r("ul"),je=r("li"),hr=r("code"),di=s("train_file"),wi=s(" and "),fr=r("code"),Mi=s("validation_file"),yi=s(" specify the path to your training and validation files."),_i=u(),ll=r("li"),ur=r("code"),vi=s("text_column"),Ti=s(" is the input text to summarize."),Ji=u(),rl=r("li"),pr=r("code"),Ui=s("summary_column"),gi=s(" is the target text to output."),da=u(),al=r("p"),bi=s("A summarization script using a custom dataset would look like this:"),wa=u(),J(nt.$$.fragment),Ma=u(),he=r("h2"),Ee=r("a"),cr=r("span"),J(ht.$$.fragment),Ai=u(),mr=r("span"),ji=s("Test a script"),ya=u(),ol=r("p"),Ei=s("It is often a good idea to run your script on a smaller number of dataset examples to ensure everything works as expected before committing to an entire dataset which may take hours to complete. Use the following arguments to truncate the dataset to a maximum number of samples:"),_a=u(),O=r("ul"),dr=r("li"),wr=r("code"),Ii=s("max_train_samples"),$i=u(),Mr=r("li"),yr=r("code"),Xi=s("max_eval_samples"),Ci=u(),_r=r("li"),vr=r("code"),Wi=s("max_predict_samples"),va=u(),J(ft.$$.fragment),Ta=u(),K=r("p"),Zi=s("Not all example scripts support the "),Tr=r("code"),Ni=s("max_predict_samples"),xi=s(" argument. If you aren\u2019t sure whether your script supports this argument, add the "),Jr=r("code"),Ri=s("-h"),ki=s(" argument to check:"),Ja=u(),J(ut.$$.fragment),Ua=u(),fe=r("h2"),Ie=r("a"),Ur=r("span"),J(pt.$$.fragment),Gi=u(),gr=r("span"),zi=s("Resume training from checkpoint"),ga=u(),sl=r("p"),Fi=s("Another helpful option to enable is resuming training from a previous checkpoint. This will ensure you can pick up where you left off without starting over if your training gets interrupted. There are two methods to resume training from a checkpoint."),ba=u(),Q=r("p"),Vi=s("The first method uses the "),br=r("code"),Li=s("output_dir previous_output_dir"),Bi=s(" argument to resume training from the latest checkpoint stored in "),Ar=r("code"),Si=s("output_dir"),Yi=s(". In this case, you should remove "),jr=r("code"),Pi=s("overwrite_output_dir"),Qi=s(":"),Aa=u(),J(ct.$$.fragment),ja=u(),$e=r("p"),Di=s("The second method uses the "),Er=r("code"),Hi=s("resume_from_checkpoint path_to_specific_checkpoint"),qi=s(" argument to resume training from a specific checkpoint folder."),Ea=u(),J(mt.$$.fragment),Ia=u(),ue=r("h2"),Xe=r("a"),Ir=r("span"),J(dt.$$.fragment),Oi=u(),$r=r("span"),Ki=s("Share your model"),$a=u(),Ce=r("p"),en=s("All scripts can upload your final model to the "),wt=r("a"),tn=s("Model Hub"),ln=s(". Make sure you are logged into Hugging Face before you begin:"),Xa=u(),J(Mt.$$.fragment),Ca=u(),ee=r("p"),rn=s("Then add the "),Xr=r("code"),an=s("push_to_hub"),on=s(" argument to the script. This argument will create a repository with your Hugging Face username and the folder name specified in "),Cr=r("code"),sn=s("output_dir"),nn=s("."),Wa=u(),We=r("p"),hn=s("To give your repository a specific name, use the "),Wr=r("code"),fn=s("push_to_hub_model_id"),un=s(" argument to add it. The repository will be automatically listed under your namespace."),Za=u(),il=r("p"),pn=s("The following example shows how to upload a model with a specific repository name:"),Na=u(),J(yt.$$.fragment),this.h()},l(e){const n=Qf('[data-svelte="svelte-1phssyn"]',document.head);c=a(n,"META",{name:!0,content:!0}),n.forEach(l),_=p(e),m=a(e,"H1",{class:!0});var _t=o(m);M=a(_t,"A",{id:!0,class:!0,href:!0});var Zr=o(M);$=a(Zr,"SPAN",{});var dn=o($);U(T.$$.fragment,dn),dn.forEach(l),Zr.forEach(l),k=p(_t),G=a(_t,"SPAN",{});var wn=o(G);W=i(wn,"Train with a script"),wn.forEach(l),_t.forEach(l),z=p(e),E=a(e,"P",{});var te=o(E);Z=i(te,"Along with the \u{1F917} Transformers "),I=a(te,"A",{href:!0});var Mn=o(I);N=i(Mn,"notebooks"),Mn.forEach(l),R=i(te,", there are also example scripts demonstrating how to train a model for a task with "),X=a(te,"A",{href:!0,rel:!0});var yn=o(X);F=i(yn,"PyTorch"),yn.forEach(l),v=i(te,", "),y=a(te,"A",{href:!0,rel:!0});var _n=o(y);B=i(_n,"TensorFlow"),_n.forEach(l),x=i(te,", or "),C=a(te,"A",{href:!0,rel:!0});var vn=o(C);Y=i(vn,"JAX/Flax"),vn.forEach(l),vt=i(te,"."),te.forEach(l),xe=p(e),S=a(e,"P",{});var nl=o(S);Tt=i(nl,"You will also find scripts we\u2019ve used in our "),Re=a(nl,"A",{href:!0,rel:!0});var Tn=o(Re);so=i(Tn,"research projects"),Tn.forEach(l),io=i(nl," and "),ke=a(nl,"A",{href:!0,rel:!0});var Jn=o(ke);no=i(Jn,"legacy examples"),Jn.forEach(l),ho=i(nl," which are mostly community contributed. These scripts are not actively maintained and require a specific version of \u{1F917} Transformers that will most likely be incompatible with the latest version of the library."),nl.forEach(l),xr=p(e),Jt=a(e,"P",{});var Un=o(Jt);fo=i(Un,"The example scripts are not expected to work out-of-the-box on every problem, and you may need to adapt the script to the problem you\u2019re trying to solve. To help you with this, most of the scripts fully expose how data is preprocessed, allowing you to edit it as necessary for your use case."),Un.forEach(l),Rr=p(e),D=a(e,"P",{});var hl=o(D);uo=i(hl,"For any feature you\u2019d like to implement in an example script, please discuss it on the "),Ge=a(hl,"A",{href:!0,rel:!0});var gn=o(Ge);po=i(gn,"forum"),gn.forEach(l),co=i(hl," or in an "),ze=a(hl,"A",{href:!0,rel:!0});var bn=o(ze);mo=i(bn,"issue"),bn.forEach(l),wo=i(hl," before submitting a Pull Request. While we welcome bug fixes, it is unlikely we will merge a Pull Request that adds more functionality at the cost of readability."),hl.forEach(l),kr=p(e),H=a(e,"P",{});var fl=o(H);Mo=i(fl,"This guide will show you how to run an example summarization training script in "),Fe=a(fl,"A",{href:!0,rel:!0});var An=o(Fe);yo=i(An,"PyTorch"),An.forEach(l),_o=i(fl," and "),Ve=a(fl,"A",{href:!0,rel:!0});var jn=o(Ve);vo=i(jn,"TensorFlow"),jn.forEach(l),To=i(fl,". All examples are expected to work with both frameworks unless otherwise specified."),fl.forEach(l),Gr=p(e),re=a(e,"H2",{class:!0});var Ra=o(re);pe=a(Ra,"A",{id:!0,class:!0,href:!0});var En=o(pe);dl=a(En,"SPAN",{});var In=o(dl);U(Le.$$.fragment,In),In.forEach(l),En.forEach(l),Jo=p(Ra),wl=a(Ra,"SPAN",{});var $n=o(wl);Uo=i($n,"Setup"),$n.forEach(l),Ra.forEach(l),zr=p(e),ce=a(e,"P",{});var ka=o(ce);go=i(ka,"To successfully run the latest version of the example scripts, you have to "),Ml=a(ka,"STRONG",{});var Xn=o(Ml);bo=i(Xn,"install \u{1F917} Transformers from source"),Xn.forEach(l),Ao=i(ka," in a new virtual environment:"),ka.forEach(l),Fr=p(e),U(Be.$$.fragment,e),Vr=p(e),Ut=a(e,"P",{});var Cn=o(Ut);jo=i(Cn,"For older versions of the example scripts, click on the toggle below:"),Cn.forEach(l),Lr=p(e),me=a(e,"DETAILS",{});var Ga=o(me);yl=a(Ga,"SUMMARY",{});var Wn=o(yl);Eo=i(Wn,"Examples for older versions of \u{1F917} Transformers"),Wn.forEach(l),Io=p(Ga),d=a(Ga,"UL",{});var w=o(d);_l=a(w,"LI",{});var Zn=o(_l);gt=a(Zn,"A",{href:!0});var Nn=o(gt);$o=i(Nn,"v4.5.1"),Nn.forEach(l),Zn.forEach(l),Xo=p(w),vl=a(w,"LI",{});var xn=o(vl);bt=a(xn,"A",{href:!0});var Rn=o(bt);Co=i(Rn,"v4.4.2"),Rn.forEach(l),xn.forEach(l),Wo=p(w),Tl=a(w,"LI",{});var kn=o(Tl);At=a(kn,"A",{href:!0});var Gn=o(At);Zo=i(Gn,"v4.3.3"),Gn.forEach(l),kn.forEach(l),No=p(w),Jl=a(w,"LI",{});var zn=o(Jl);jt=a(zn,"A",{href:!0});var Fn=o(jt);xo=i(Fn,"v4.2.2"),Fn.forEach(l),zn.forEach(l),Ro=p(w),Ul=a(w,"LI",{});var Vn=o(Ul);Et=a(Vn,"A",{href:!0});var Ln=o(Et);ko=i(Ln,"v4.1.1"),Ln.forEach(l),Vn.forEach(l),Go=p(w),gl=a(w,"LI",{});var Bn=o(gl);It=a(Bn,"A",{href:!0});var Sn=o(It);zo=i(Sn,"v4.0.1"),Sn.forEach(l),Bn.forEach(l),Fo=p(w),bl=a(w,"LI",{});var Yn=o(bl);$t=a(Yn,"A",{href:!0});var Pn=o($t);Vo=i(Pn,"v3.5.1"),Pn.forEach(l),Yn.forEach(l),Lo=p(w),Al=a(w,"LI",{});var Qn=o(Al);Xt=a(Qn,"A",{href:!0});var Dn=o(Xt);Bo=i(Dn,"v3.4.0"),Dn.forEach(l),Qn.forEach(l),So=p(w),jl=a(w,"LI",{});var Hn=o(jl);Ct=a(Hn,"A",{href:!0});var qn=o(Ct);Yo=i(qn,"v3.3.1"),qn.forEach(l),Hn.forEach(l),Po=p(w),El=a(w,"LI",{});var On=o(El);Wt=a(On,"A",{href:!0});var Kn=o(Wt);Qo=i(Kn,"v3.2.0"),Kn.forEach(l),On.forEach(l),Do=p(w),Il=a(w,"LI",{});var eh=o(Il);Zt=a(eh,"A",{href:!0});var th=o(Zt);Ho=i(th,"v3.1.0"),th.forEach(l),eh.forEach(l),qo=p(w),$l=a(w,"LI",{});var lh=o($l);Nt=a(lh,"A",{href:!0});var rh=o(Nt);Oo=i(rh,"v3.0.2"),rh.forEach(l),lh.forEach(l),Ko=p(w),Xl=a(w,"LI",{});var ah=o(Xl);xt=a(ah,"A",{href:!0});var oh=o(xt);es=i(oh,"v2.11.0"),oh.forEach(l),ah.forEach(l),ts=p(w),Cl=a(w,"LI",{});var sh=o(Cl);Rt=a(sh,"A",{href:!0});var ih=o(Rt);ls=i(ih,"v2.10.0"),ih.forEach(l),sh.forEach(l),rs=p(w),Wl=a(w,"LI",{});var nh=o(Wl);kt=a(nh,"A",{href:!0});var hh=o(kt);as=i(hh,"v2.9.1"),hh.forEach(l),nh.forEach(l),os=p(w),Zl=a(w,"LI",{});var fh=o(Zl);Gt=a(fh,"A",{href:!0});var uh=o(Gt);ss=i(uh,"v2.8.0"),uh.forEach(l),fh.forEach(l),is=p(w),Nl=a(w,"LI",{});var ph=o(Nl);zt=a(ph,"A",{href:!0});var ch=o(zt);ns=i(ch,"v2.7.0"),ch.forEach(l),ph.forEach(l),hs=p(w),xl=a(w,"LI",{});var mh=o(xl);Ft=a(mh,"A",{href:!0});var dh=o(Ft);fs=i(dh,"v2.6.0"),dh.forEach(l),mh.forEach(l),us=p(w),Rl=a(w,"LI",{});var wh=o(Rl);Vt=a(wh,"A",{href:!0});var Mh=o(Vt);ps=i(Mh,"v2.5.1"),Mh.forEach(l),wh.forEach(l),cs=p(w),kl=a(w,"LI",{});var yh=o(kl);Lt=a(yh,"A",{href:!0});var _h=o(Lt);ms=i(_h,"v2.4.0"),_h.forEach(l),yh.forEach(l),ds=p(w),Gl=a(w,"LI",{});var vh=o(Gl);Bt=a(vh,"A",{href:!0});var Th=o(Bt);ws=i(Th,"v2.3.0"),Th.forEach(l),vh.forEach(l),Ms=p(w),zl=a(w,"LI",{});var Jh=o(zl);St=a(Jh,"A",{href:!0});var Uh=o(St);ys=i(Uh,"v2.2.0"),Uh.forEach(l),Jh.forEach(l),_s=p(w),Fl=a(w,"LI",{});var gh=o(Fl);Yt=a(gh,"A",{href:!0});var bh=o(Yt);vs=i(bh,"v2.1.1"),bh.forEach(l),gh.forEach(l),Ts=p(w),Vl=a(w,"LI",{});var Ah=o(Vl);Pt=a(Ah,"A",{href:!0});var jh=o(Pt);Js=i(jh,"v2.0.0"),jh.forEach(l),Ah.forEach(l),Us=p(w),Ll=a(w,"LI",{});var Eh=o(Ll);Qt=a(Eh,"A",{href:!0});var Ih=o(Qt);gs=i(Ih,"v1.2.0"),Ih.forEach(l),Eh.forEach(l),bs=p(w),Bl=a(w,"LI",{});var $h=o(Bl);Dt=a($h,"A",{href:!0});var Xh=o(Dt);As=i(Xh,"v1.1.0"),Xh.forEach(l),$h.forEach(l),js=p(w),Sl=a(w,"LI",{});var Ch=o(Sl);Ht=a(Ch,"A",{href:!0});var Wh=o(Ht);Es=i(Wh,"v1.0.0"),Wh.forEach(l),Ch.forEach(l),w.forEach(l),Ga.forEach(l),Br=p(e),qt=a(e,"P",{});var Zh=o(qt);Is=i(Zh,"Then switch your current clone of \u{1F917} Transformers to a specific version, like v3.5.1 for example:"),Zh.forEach(l),Sr=p(e),U(Se.$$.fragment,e),Yr=p(e),Ot=a(e,"P",{});var Nh=o(Ot);$s=i(Nh,"After you\u2019ve setup the correct library version, navigate to the example folder of your choice and install the example specific requirements:"),Nh.forEach(l),Pr=p(e),U(Ye.$$.fragment,e),Qr=p(e),ae=a(e,"H2",{class:!0});var za=o(ae);de=a(za,"A",{id:!0,class:!0,href:!0});var xh=o(de);Yl=a(xh,"SPAN",{});var Rh=o(Yl);U(Pe.$$.fragment,Rh),Rh.forEach(l),xh.forEach(l),Xs=p(za),Pl=a(za,"SPAN",{});var kh=o(Pl);Cs=i(kh,"Run a script"),kh.forEach(l),za.forEach(l),Dr=p(e),U(we.$$.fragment,e),Hr=p(e),oe=a(e,"H2",{class:!0});var Fa=o(oe);Me=a(Fa,"A",{id:!0,class:!0,href:!0});var Gh=o(Me);Ql=a(Gh,"SPAN",{});var zh=o(Ql);U(Qe.$$.fragment,zh),zh.forEach(l),Gh.forEach(l),Ws=p(Fa),Dl=a(Fa,"SPAN",{});var Fh=o(Dl);Zs=i(Fh,"Distributed training and mixed precision"),Fh.forEach(l),Fa.forEach(l),qr=p(e),ye=a(e,"P",{});var Va=o(ye);Ns=i(Va,"The "),De=a(Va,"A",{href:!0,rel:!0});var Vh=o(De);xs=i(Vh,"Trainer"),Vh.forEach(l),Rs=i(Va," supports distributed training and mixed precision, which means you can also use it in a script. To enable both of these features:"),Va.forEach(l),Or=p(e),_e=a(e,"UL",{});var La=o(_e);He=a(La,"LI",{});var Ba=o(He);ks=i(Ba,"Add the "),Hl=a(Ba,"CODE",{});var Lh=o(Hl);Gs=i(Lh,"fp16"),Lh.forEach(l),zs=i(Ba," argument to enable mixed precision."),Ba.forEach(l),Fs=p(La),qe=a(La,"LI",{});var Sa=o(qe);Vs=i(Sa,"Set the number of GPUs to use with the "),ql=a(Sa,"CODE",{});var Bh=o(ql);Ls=i(Bh,"nproc_per_node"),Bh.forEach(l),Bs=i(Sa," argument."),Sa.forEach(l),La.forEach(l),Kr=p(e),U(Oe.$$.fragment,e),ea=p(e),ve=a(e,"P",{});var Ya=o(ve);Ss=i(Ya,"TensorFlow scripts utilize a "),Ke=a(Ya,"A",{href:!0,rel:!0});var Sh=o(Ke);Ol=a(Sh,"CODE",{});var Yh=o(Ol);Ys=i(Yh,"MirroredStrategy"),Yh.forEach(l),Sh.forEach(l),Ps=i(Ya," for distributed training, and you don\u2019t need to add any additional arguments to the training script. The TensorFlow script will use multiple GPUs by default if they are available."),Ya.forEach(l),ta=p(e),se=a(e,"H2",{class:!0});var Pa=o(se);Te=a(Pa,"A",{id:!0,class:!0,href:!0});var Ph=o(Te);Kl=a(Ph,"SPAN",{});var Qh=o(Kl);U(et.$$.fragment,Qh),Qh.forEach(l),Ph.forEach(l),Qs=p(Pa),er=a(Pa,"SPAN",{});var Dh=o(er);Ds=i(Dh,"Run a script on a TPU"),Dh.forEach(l),Pa.forEach(l),la=p(e),U(Je.$$.fragment,e),ra=p(e),ie=a(e,"H2",{class:!0});var Qa=o(ie);Ue=a(Qa,"A",{id:!0,class:!0,href:!0});var Hh=o(Ue);tr=a(Hh,"SPAN",{});var qh=o(tr);U(tt.$$.fragment,qh),qh.forEach(l),Hh.forEach(l),Hs=p(Qa),lr=a(Qa,"SPAN",{});var Oh=o(lr);qs=i(Oh,"Run a script with \u{1F917} Accelerate"),Oh.forEach(l),Qa.forEach(l),aa=p(e),ge=a(e,"P",{});var Da=o(ge);Os=i(Da,"\u{1F917} "),lt=a(Da,"A",{href:!0,rel:!0});var Kh=o(lt);Ks=i(Kh,"Accelerate"),Kh.forEach(l),ei=i(Da," is a PyTorch-only library that offers a unified method for training a model on several types of setups (CPU-only, multiple GPUs, TPUs) while maintaining complete visibility into the PyTorch training loop. Make sure you have \u{1F917} Accelerate installed if you don\u2019t already have it:"),Da.forEach(l),oa=p(e),be=a(e,"BLOCKQUOTE",{});var Ha=o(be);rr=a(Ha,"P",{});var ef=o(rr);ti=i(ef,"Note: As Accelerate is rapidly developing, the git version of accelerate must be installed to run the scripts"),ef.forEach(l),li=p(Ha),U(rt.$$.fragment,Ha),Ha.forEach(l),sa=p(e),P=a(e,"P",{});var Ze=o(P);ri=i(Ze,"Instead of the "),ar=a(Ze,"CODE",{});var tf=o(ar);ai=i(tf,"run_summarization.py"),tf.forEach(l),oi=i(Ze," script, you need to use the "),or=a(Ze,"CODE",{});var lf=o(or);si=i(lf,"run_summarization_no_trainer.py"),lf.forEach(l),ii=i(Ze," script. \u{1F917} Accelerate supported scripts will have a "),sr=a(Ze,"CODE",{});var rf=o(sr);ni=i(rf,"task_no_trainer.py"),rf.forEach(l),hi=i(Ze," file in the folder. Begin by running the following command to create and save a configuration file:"),Ze.forEach(l),ia=p(e),U(at.$$.fragment,e),na=p(e),Kt=a(e,"P",{});var af=o(Kt);fi=i(af,"Test your setup to make sure it is configured correctly:"),af.forEach(l),ha=p(e),U(ot.$$.fragment,e),fa=p(e),el=a(e,"P",{});var of=o(el);ui=i(of,"Now you are ready to launch the training:"),of.forEach(l),ua=p(e),U(st.$$.fragment,e),pa=p(e),ne=a(e,"H2",{class:!0});var qa=o(ne);Ae=a(qa,"A",{id:!0,class:!0,href:!0});var sf=o(Ae);ir=a(sf,"SPAN",{});var nf=o(ir);U(it.$$.fragment,nf),nf.forEach(l),sf.forEach(l),pi=p(qa),nr=a(qa,"SPAN",{});var hf=o(nr);ci=i(hf,"Use a custom dataset"),hf.forEach(l),qa.forEach(l),ca=p(e),tl=a(e,"P",{});var ff=o(tl);mi=i(ff,"The summarization script supports custom datasets as long as they are a CSV or JSON Line file. When you use your own dataset, you need to specify several additional arguments:"),ff.forEach(l),ma=p(e),q=a(e,"UL",{});var ul=o(q);je=a(ul,"LI",{});var Nr=o(je);hr=a(Nr,"CODE",{});var uf=o(hr);di=i(uf,"train_file"),uf.forEach(l),wi=i(Nr," and "),fr=a(Nr,"CODE",{});var pf=o(fr);Mi=i(pf,"validation_file"),pf.forEach(l),yi=i(Nr," specify the path to your training and validation files."),Nr.forEach(l),_i=p(ul),ll=a(ul,"LI",{});var cn=o(ll);ur=a(cn,"CODE",{});var cf=o(ur);vi=i(cf,"text_column"),cf.forEach(l),Ti=i(cn," is the input text to summarize."),cn.forEach(l),Ji=p(ul),rl=a(ul,"LI",{});var mn=o(rl);pr=a(mn,"CODE",{});var mf=o(pr);Ui=i(mf,"summary_column"),mf.forEach(l),gi=i(mn," is the target text to output."),mn.forEach(l),ul.forEach(l),da=p(e),al=a(e,"P",{});var df=o(al);bi=i(df,"A summarization script using a custom dataset would look like this:"),df.forEach(l),wa=p(e),U(nt.$$.fragment,e),Ma=p(e),he=a(e,"H2",{class:!0});var Oa=o(he);Ee=a(Oa,"A",{id:!0,class:!0,href:!0});var wf=o(Ee);cr=a(wf,"SPAN",{});var Mf=o(cr);U(ht.$$.fragment,Mf),Mf.forEach(l),wf.forEach(l),Ai=p(Oa),mr=a(Oa,"SPAN",{});var yf=o(mr);ji=i(yf,"Test a script"),yf.forEach(l),Oa.forEach(l),ya=p(e),ol=a(e,"P",{});var _f=o(ol);Ei=i(_f,"It is often a good idea to run your script on a smaller number of dataset examples to ensure everything works as expected before committing to an entire dataset which may take hours to complete. Use the following arguments to truncate the dataset to a maximum number of samples:"),_f.forEach(l),_a=p(e),O=a(e,"UL",{});var pl=o(O);dr=a(pl,"LI",{});var vf=o(dr);wr=a(vf,"CODE",{});var Tf=o(wr);Ii=i(Tf,"max_train_samples"),Tf.forEach(l),vf.forEach(l),$i=p(pl),Mr=a(pl,"LI",{});var Jf=o(Mr);yr=a(Jf,"CODE",{});var Uf=o(yr);Xi=i(Uf,"max_eval_samples"),Uf.forEach(l),Jf.forEach(l),Ci=p(pl),_r=a(pl,"LI",{});var gf=o(_r);vr=a(gf,"CODE",{});var bf=o(vr);Wi=i(bf,"max_predict_samples"),bf.forEach(l),gf.forEach(l),pl.forEach(l),va=p(e),U(ft.$$.fragment,e),Ta=p(e),K=a(e,"P",{});var cl=o(K);Zi=i(cl,"Not all example scripts support the "),Tr=a(cl,"CODE",{});var Af=o(Tr);Ni=i(Af,"max_predict_samples"),Af.forEach(l),xi=i(cl," argument. If you aren\u2019t sure whether your script supports this argument, add the "),Jr=a(cl,"CODE",{});var jf=o(Jr);Ri=i(jf,"-h"),jf.forEach(l),ki=i(cl," argument to check:"),cl.forEach(l),Ja=p(e),U(ut.$$.fragment,e),Ua=p(e),fe=a(e,"H2",{class:!0});var Ka=o(fe);Ie=a(Ka,"A",{id:!0,class:!0,href:!0});var Ef=o(Ie);Ur=a(Ef,"SPAN",{});var If=o(Ur);U(pt.$$.fragment,If),If.forEach(l),Ef.forEach(l),Gi=p(Ka),gr=a(Ka,"SPAN",{});var $f=o(gr);zi=i($f,"Resume training from checkpoint"),$f.forEach(l),Ka.forEach(l),ga=p(e),sl=a(e,"P",{});var Xf=o(sl);Fi=i(Xf,"Another helpful option to enable is resuming training from a previous checkpoint. This will ensure you can pick up where you left off without starting over if your training gets interrupted. There are two methods to resume training from a checkpoint."),Xf.forEach(l),ba=p(e),Q=a(e,"P",{});var Ne=o(Q);Vi=i(Ne,"The first method uses the "),br=a(Ne,"CODE",{});var Cf=o(br);Li=i(Cf,"output_dir previous_output_dir"),Cf.forEach(l),Bi=i(Ne," argument to resume training from the latest checkpoint stored in "),Ar=a(Ne,"CODE",{});var Wf=o(Ar);Si=i(Wf,"output_dir"),Wf.forEach(l),Yi=i(Ne,". In this case, you should remove "),jr=a(Ne,"CODE",{});var Zf=o(jr);Pi=i(Zf,"overwrite_output_dir"),Zf.forEach(l),Qi=i(Ne,":"),Ne.forEach(l),Aa=p(e),U(ct.$$.fragment,e),ja=p(e),$e=a(e,"P",{});var eo=o($e);Di=i(eo,"The second method uses the "),Er=a(eo,"CODE",{});var Nf=o(Er);Hi=i(Nf,"resume_from_checkpoint path_to_specific_checkpoint"),Nf.forEach(l),qi=i(eo," argument to resume training from a specific checkpoint folder."),eo.forEach(l),Ea=p(e),U(mt.$$.fragment,e),Ia=p(e),ue=a(e,"H2",{class:!0});var to=o(ue);Xe=a(to,"A",{id:!0,class:!0,href:!0});var xf=o(Xe);Ir=a(xf,"SPAN",{});var Rf=o(Ir);U(dt.$$.fragment,Rf),Rf.forEach(l),xf.forEach(l),Oi=p(to),$r=a(to,"SPAN",{});var kf=o($r);Ki=i(kf,"Share your model"),kf.forEach(l),to.forEach(l),$a=p(e),Ce=a(e,"P",{});var lo=o(Ce);en=i(lo,"All scripts can upload your final model to the "),wt=a(lo,"A",{href:!0,rel:!0});var Gf=o(wt);tn=i(Gf,"Model Hub"),Gf.forEach(l),ln=i(lo,". Make sure you are logged into Hugging Face before you begin:"),lo.forEach(l),Xa=p(e),U(Mt.$$.fragment,e),Ca=p(e),ee=a(e,"P",{});var ml=o(ee);rn=i(ml,"Then add the "),Xr=a(ml,"CODE",{});var zf=o(Xr);an=i(zf,"push_to_hub"),zf.forEach(l),on=i(ml," argument to the script. This argument will create a repository with your Hugging Face username and the folder name specified in "),Cr=a(ml,"CODE",{});var Ff=o(Cr);sn=i(Ff,"output_dir"),Ff.forEach(l),nn=i(ml,"."),ml.forEach(l),Wa=p(e),We=a(e,"P",{});var ro=o(We);hn=i(ro,"To give your repository a specific name, use the "),Wr=a(ro,"CODE",{});var Vf=o(Wr);fn=i(Vf,"push_to_hub_model_id"),Vf.forEach(l),un=i(ro," argument to add it. The repository will be automatically listed under your namespace."),ro.forEach(l),Za=p(e),il=a(e,"P",{});var Lf=o(il);pn=i(Lf,"The following example shows how to upload a model with a specific repository name:"),Lf.forEach(l),Na=p(e),U(yt.$$.fragment,e),this.h()},h(){h(c,"name","hf:doc:metadata"),h(c,"content",JSON.stringify(ou)),h(M,"id","train-with-a-script"),h(M,"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"),h(M,"href","#train-with-a-script"),h(m,"class","relative group"),h(I,"href","./noteboks/README"),h(X,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch"),h(X,"rel","nofollow"),h(y,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow"),h(y,"rel","nofollow"),h(C,"href","https://github.com/huggingface/transformers/tree/main/examples/flax"),h(C,"rel","nofollow"),h(Re,"href","https://github.com/huggingface/transformers/tree/main/examples/research_projects"),h(Re,"rel","nofollow"),h(ke,"href","https://github.com/huggingface/transformers/tree/main/examples/legacy"),h(ke,"rel","nofollow"),h(Ge,"href","https://discuss.huggingface.co/"),h(Ge,"rel","nofollow"),h(ze,"href","https://github.com/huggingface/transformers/issues"),h(ze,"rel","nofollow"),h(Fe,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/summarization"),h(Fe,"rel","nofollow"),h(Ve,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/summarization"),h(Ve,"rel","nofollow"),h(pe,"id","setup"),h(pe,"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"),h(pe,"href","#setup"),h(re,"class","relative group"),h(gt,"href","https://github.com/huggingface/transformers/tree/v4.5.1/examples"),h(bt,"href","https://github.com/huggingface/transformers/tree/v4.4.2/examples"),h(At,"href","https://github.com/huggingface/transformers/tree/v4.3.3/examples"),h(jt,"href","https://github.com/huggingface/transformers/tree/v4.2.2/examples"),h(Et,"href","https://github.com/huggingface/transformers/tree/v4.1.1/examples"),h(It,"href","https://github.com/huggingface/transformers/tree/v4.0.1/examples"),h($t,"href","https://github.com/huggingface/transformers/tree/v3.5.1/examples"),h(Xt,"href","https://github.com/huggingface/transformers/tree/v3.4.0/examples"),h(Ct,"href","https://github.com/huggingface/transformers/tree/v3.3.1/examples"),h(Wt,"href","https://github.com/huggingface/transformers/tree/v3.2.0/examples"),h(Zt,"href","https://github.com/huggingface/transformers/tree/v3.1.0/examples"),h(Nt,"href","https://github.com/huggingface/transformers/tree/v3.0.2/examples"),h(xt,"href","https://github.com/huggingface/transformers/tree/v2.11.0/examples"),h(Rt,"href","https://github.com/huggingface/transformers/tree/v2.10.0/examples"),h(kt,"href","https://github.com/huggingface/transformers/tree/v2.9.1/examples"),h(Gt,"href","https://github.com/huggingface/transformers/tree/v2.8.0/examples"),h(zt,"href","https://github.com/huggingface/transformers/tree/v2.7.0/examples"),h(Ft,"href","https://github.com/huggingface/transformers/tree/v2.6.0/examples"),h(Vt,"href","https://github.com/huggingface/transformers/tree/v2.5.1/examples"),h(Lt,"href","https://github.com/huggingface/transformers/tree/v2.4.0/examples"),h(Bt,"href","https://github.com/huggingface/transformers/tree/v2.3.0/examples"),h(St,"href","https://github.com/huggingface/transformers/tree/v2.2.0/examples"),h(Yt,"href","https://github.com/huggingface/transformers/tree/v2.1.0/examples"),h(Pt,"href","https://github.com/huggingface/transformers/tree/v2.0.0/examples"),h(Qt,"href","https://github.com/huggingface/transformers/tree/v1.2.0/examples"),h(Dt,"href","https://github.com/huggingface/transformers/tree/v1.1.0/examples"),h(Ht,"href","https://github.com/huggingface/transformers/tree/v1.0.0/examples"),h(de,"id","run-a-script"),h(de,"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"),h(de,"href","#run-a-script"),h(ae,"class","relative group"),h(Me,"id","distributed-training-and-mixed-precision"),h(Me,"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"),h(Me,"href","#distributed-training-and-mixed-precision"),h(oe,"class","relative group"),h(De,"href","https://huggingface.co/docs/transformers/main_classes/trainer"),h(De,"rel","nofollow"),h(Ke,"href","https://www.tensorflow.org/guide/distributed_training#mirroredstrategy"),h(Ke,"rel","nofollow"),h(Te,"id","run-a-script-on-a-tpu"),h(Te,"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"),h(Te,"href","#run-a-script-on-a-tpu"),h(se,"class","relative group"),h(Ue,"id","run-a-script-with-accelerate"),h(Ue,"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"),h(Ue,"href","#run-a-script-with-accelerate"),h(ie,"class","relative group"),h(lt,"href","https://huggingface.co/docs/accelerate"),h(lt,"rel","nofollow"),h(Ae,"id","use-a-custom-dataset"),h(Ae,"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"),h(Ae,"href","#use-a-custom-dataset"),h(ne,"class","relative group"),h(Ee,"id","test-a-script"),h(Ee,"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"),h(Ee,"href","#test-a-script"),h(he,"class","relative group"),h(Ie,"id","resume-training-from-checkpoint"),h(Ie,"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"),h(Ie,"href","#resume-training-from-checkpoint"),h(fe,"class","relative group"),h(Xe,"id","share-your-model"),h(Xe,"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"),h(Xe,"href","#share-your-model"),h(ue,"class","relative group"),h(wt,"href","https://huggingface.co/models"),h(wt,"rel","nofollow")},m(e,n){t(document.head,c),f(e,_,n),f(e,m,n),t(m,M),t(M,$),g(T,$,null),t(m,k),t(m,G),t(G,W),f(e,z,n),f(e,E,n),t(E,Z),t(E,I),t(I,N),t(E,R),t(E,X),t(X,F),t(E,v),t(E,y),t(y,B),t(E,x),t(E,C),t(C,Y),t(E,vt),f(e,xe,n),f(e,S,n),t(S,Tt),t(S,Re),t(Re,so),t(S,io),t(S,ke),t(ke,no),t(S,ho),f(e,xr,n),f(e,Jt,n),t(Jt,fo),f(e,Rr,n),f(e,D,n),t(D,uo),t(D,Ge),t(Ge,po),t(D,co),t(D,ze),t(ze,mo),t(D,wo),f(e,kr,n),f(e,H,n),t(H,Mo),t(H,Fe),t(Fe,yo),t(H,_o),t(H,Ve),t(Ve,vo),t(H,To),f(e,Gr,n),f(e,re,n),t(re,pe),t(pe,dl),g(Le,dl,null),t(re,Jo),t(re,wl),t(wl,Uo),f(e,zr,n),f(e,ce,n),t(ce,go),t(ce,Ml),t(Ml,bo),t(ce,Ao),f(e,Fr,n),g(Be,e,n),f(e,Vr,n),f(e,Ut,n),t(Ut,jo),f(e,Lr,n),f(e,me,n),t(me,yl),t(yl,Eo),t(me,Io),t(me,d),t(d,_l),t(_l,gt),t(gt,$o),t(d,Xo),t(d,vl),t(vl,bt),t(bt,Co),t(d,Wo),t(d,Tl),t(Tl,At),t(At,Zo),t(d,No),t(d,Jl),t(Jl,jt),t(jt,xo),t(d,Ro),t(d,Ul),t(Ul,Et),t(Et,ko),t(d,Go),t(d,gl),t(gl,It),t(It,zo),t(d,Fo),t(d,bl),t(bl,$t),t($t,Vo),t(d,Lo),t(d,Al),t(Al,Xt),t(Xt,Bo),t(d,So),t(d,jl),t(jl,Ct),t(Ct,Yo),t(d,Po),t(d,El),t(El,Wt),t(Wt,Qo),t(d,Do),t(d,Il),t(Il,Zt),t(Zt,Ho),t(d,qo),t(d,$l),t($l,Nt),t(Nt,Oo),t(d,Ko),t(d,Xl),t(Xl,xt),t(xt,es),t(d,ts),t(d,Cl),t(Cl,Rt),t(Rt,ls),t(d,rs),t(d,Wl),t(Wl,kt),t(kt,as),t(d,os),t(d,Zl),t(Zl,Gt),t(Gt,ss),t(d,is),t(d,Nl),t(Nl,zt),t(zt,ns),t(d,hs),t(d,xl),t(xl,Ft),t(Ft,fs),t(d,us),t(d,Rl),t(Rl,Vt),t(Vt,ps),t(d,cs),t(d,kl),t(kl,Lt),t(Lt,ms),t(d,ds),t(d,Gl),t(Gl,Bt),t(Bt,ws),t(d,Ms),t(d,zl),t(zl,St),t(St,ys),t(d,_s),t(d,Fl),t(Fl,Yt),t(Yt,vs),t(d,Ts),t(d,Vl),t(Vl,Pt),t(Pt,Js),t(d,Us),t(d,Ll),t(Ll,Qt),t(Qt,gs),t(d,bs),t(d,Bl),t(Bl,Dt),t(Dt,As),t(d,js),t(d,Sl),t(Sl,Ht),t(Ht,Es),f(e,Br,n),f(e,qt,n),t(qt,Is),f(e,Sr,n),g(Se,e,n),f(e,Yr,n),f(e,Ot,n),t(Ot,$s),f(e,Pr,n),g(Ye,e,n),f(e,Qr,n),f(e,ae,n),t(ae,de),t(de,Yl),g(Pe,Yl,null),t(ae,Xs),t(ae,Pl),t(Pl,Cs),f(e,Dr,n),g(we,e,n),f(e,Hr,n),f(e,oe,n),t(oe,Me),t(Me,Ql),g(Qe,Ql,null),t(oe,Ws),t(oe,Dl),t(Dl,Zs),f(e,qr,n),f(e,ye,n),t(ye,Ns),t(ye,De),t(De,xs),t(ye,Rs),f(e,Or,n),f(e,_e,n),t(_e,He),t(He,ks),t(He,Hl),t(Hl,Gs),t(He,zs),t(_e,Fs),t(_e,qe),t(qe,Vs),t(qe,ql),t(ql,Ls),t(qe,Bs),f(e,Kr,n),g(Oe,e,n),f(e,ea,n),f(e,ve,n),t(ve,Ss),t(ve,Ke),t(Ke,Ol),t(Ol,Ys),t(ve,Ps),f(e,ta,n),f(e,se,n),t(se,Te),t(Te,Kl),g(et,Kl,null),t(se,Qs),t(se,er),t(er,Ds),f(e,la,n),g(Je,e,n),f(e,ra,n),f(e,ie,n),t(ie,Ue),t(Ue,tr),g(tt,tr,null),t(ie,Hs),t(ie,lr),t(lr,qs),f(e,aa,n),f(e,ge,n),t(ge,Os),t(ge,lt),t(lt,Ks),t(ge,ei),f(e,oa,n),f(e,be,n),t(be,rr),t(rr,ti),t(be,li),g(rt,be,null),f(e,sa,n),f(e,P,n),t(P,ri),t(P,ar),t(ar,ai),t(P,oi),t(P,or),t(or,si),t(P,ii),t(P,sr),t(sr,ni),t(P,hi),f(e,ia,n),g(at,e,n),f(e,na,n),f(e,Kt,n),t(Kt,fi),f(e,ha,n),g(ot,e,n),f(e,fa,n),f(e,el,n),t(el,ui),f(e,ua,n),g(st,e,n),f(e,pa,n),f(e,ne,n),t(ne,Ae),t(Ae,ir),g(it,ir,null),t(ne,pi),t(ne,nr),t(nr,ci),f(e,ca,n),f(e,tl,n),t(tl,mi),f(e,ma,n),f(e,q,n),t(q,je),t(je,hr),t(hr,di),t(je,wi),t(je,fr),t(fr,Mi),t(je,yi),t(q,_i),t(q,ll),t(ll,ur),t(ur,vi),t(ll,Ti),t(q,Ji),t(q,rl),t(rl,pr),t(pr,Ui),t(rl,gi),f(e,da,n),f(e,al,n),t(al,bi),f(e,wa,n),g(nt,e,n),f(e,Ma,n),f(e,he,n),t(he,Ee),t(Ee,cr),g(ht,cr,null),t(he,Ai),t(he,mr),t(mr,ji),f(e,ya,n),f(e,ol,n),t(ol,Ei),f(e,_a,n),f(e,O,n),t(O,dr),t(dr,wr),t(wr,Ii),t(O,$i),t(O,Mr),t(Mr,yr),t(yr,Xi),t(O,Ci),t(O,_r),t(_r,vr),t(vr,Wi),f(e,va,n),g(ft,e,n),f(e,Ta,n),f(e,K,n),t(K,Zi),t(K,Tr),t(Tr,Ni),t(K,xi),t(K,Jr),t(Jr,Ri),t(K,ki),f(e,Ja,n),g(ut,e,n),f(e,Ua,n),f(e,fe,n),t(fe,Ie),t(Ie,Ur),g(pt,Ur,null),t(fe,Gi),t(fe,gr),t(gr,zi),f(e,ga,n),f(e,sl,n),t(sl,Fi),f(e,ba,n),f(e,Q,n),t(Q,Vi),t(Q,br),t(br,Li),t(Q,Bi),t(Q,Ar),t(Ar,Si),t(Q,Yi),t(Q,jr),t(jr,Pi),t(Q,Qi),f(e,Aa,n),g(ct,e,n),f(e,ja,n),f(e,$e,n),t($e,Di),t($e,Er),t(Er,Hi),t($e,qi),f(e,Ea,n),g(mt,e,n),f(e,Ia,n),f(e,ue,n),t(ue,Xe),t(Xe,Ir),g(dt,Ir,null),t(ue,Oi),t(ue,$r),t($r,Ki),f(e,$a,n),f(e,Ce,n),t(Ce,en),t(Ce,wt),t(wt,tn),t(Ce,ln),f(e,Xa,n),g(Mt,e,n),f(e,Ca,n),f(e,ee,n),t(ee,rn),t(ee,Xr),t(Xr,an),t(ee,on),t(ee,Cr),t(Cr,sn),t(ee,nn),f(e,Wa,n),f(e,We,n),t(We,hn),t(We,Wr),t(Wr,fn),t(We,un),f(e,Za,n),f(e,il,n),t(il,pn),f(e,Na,n),g(yt,e,n),xa=!0},p(e,[n]){const _t={};n&2&&(_t.$$scope={dirty:n,ctx:e}),we.$set(_t);const Zr={};n&2&&(Zr.$$scope={dirty:n,ctx:e}),Je.$set(Zr)},i(e){xa||(b(T.$$.fragment,e),b(Le.$$.fragment,e),b(Be.$$.fragment,e),b(Se.$$.fragment,e),b(Ye.$$.fragment,e),b(Pe.$$.fragment,e),b(we.$$.fragment,e),b(Qe.$$.fragment,e),b(Oe.$$.fragment,e),b(et.$$.fragment,e),b(Je.$$.fragment,e),b(tt.$$.fragment,e),b(rt.$$.fragment,e),b(at.$$.fragment,e),b(ot.$$.fragment,e),b(st.$$.fragment,e),b(it.$$.fragment,e),b(nt.$$.fragment,e),b(ht.$$.fragment,e),b(ft.$$.fragment,e),b(ut.$$.fragment,e),b(pt.$$.fragment,e),b(ct.$$.fragment,e),b(mt.$$.fragment,e),b(dt.$$.fragment,e),b(Mt.$$.fragment,e),b(yt.$$.fragment,e),xa=!0)},o(e){A(T.$$.fragment,e),A(Le.$$.fragment,e),A(Be.$$.fragment,e),A(Se.$$.fragment,e),A(Ye.$$.fragment,e),A(Pe.$$.fragment,e),A(we.$$.fragment,e),A(Qe.$$.fragment,e),A(Oe.$$.fragment,e),A(et.$$.fragment,e),A(Je.$$.fragment,e),A(tt.$$.fragment,e),A(rt.$$.fragment,e),A(at.$$.fragment,e),A(ot.$$.fragment,e),A(st.$$.fragment,e),A(it.$$.fragment,e),A(nt.$$.fragment,e),A(ht.$$.fragment,e),A(ft.$$.fragment,e),A(ut.$$.fragment,e),A(pt.$$.fragment,e),A(ct.$$.fragment,e),A(mt.$$.fragment,e),A(dt.$$.fragment,e),A(Mt.$$.fragment,e),A(yt.$$.fragment,e),xa=!1},d(e){l(c),e&&l(_),e&&l(m),j(T),e&&l(z),e&&l(E),e&&l(xe),e&&l(S),e&&l(xr),e&&l(Jt),e&&l(Rr),e&&l(D),e&&l(kr),e&&l(H),e&&l(Gr),e&&l(re),j(Le),e&&l(zr),e&&l(ce),e&&l(Fr),j(Be,e),e&&l(Vr),e&&l(Ut),e&&l(Lr),e&&l(me),e&&l(Br),e&&l(qt),e&&l(Sr),j(Se,e),e&&l(Yr),e&&l(Ot),e&&l(Pr),j(Ye,e),e&&l(Qr),e&&l(ae),j(Pe),e&&l(Dr),j(we,e),e&&l(Hr),e&&l(oe),j(Qe),e&&l(qr),e&&l(ye),e&&l(Or),e&&l(_e),e&&l(Kr),j(Oe,e),e&&l(ea),e&&l(ve),e&&l(ta),e&&l(se),j(et),e&&l(la),j(Je,e),e&&l(ra),e&&l(ie),j(tt),e&&l(aa),e&&l(ge),e&&l(oa),e&&l(be),j(rt),e&&l(sa),e&&l(P),e&&l(ia),j(at,e),e&&l(na),e&&l(Kt),e&&l(ha),j(ot,e),e&&l(fa),e&&l(el),e&&l(ua),j(st,e),e&&l(pa),e&&l(ne),j(it),e&&l(ca),e&&l(tl),e&&l(ma),e&&l(q),e&&l(da),e&&l(al),e&&l(wa),j(nt,e),e&&l(Ma),e&&l(he),j(ht),e&&l(ya),e&&l(ol),e&&l(_a),e&&l(O),e&&l(va),j(ft,e),e&&l(Ta),e&&l(K),e&&l(Ja),j(ut,e),e&&l(Ua),e&&l(fe),j(pt),e&&l(ga),e&&l(sl),e&&l(ba),e&&l(Q),e&&l(Aa),j(ct,e),e&&l(ja),e&&l($e),e&&l(Ea),j(mt,e),e&&l(Ia),e&&l(ue),j(dt),e&&l($a),e&&l(Ce),e&&l(Xa),j(Mt,e),e&&l(Ca),e&&l(ee),e&&l(Wa),e&&l(We),e&&l(Za),e&&l(il),e&&l(Na),j(yt,e)}}}const ou={local:"train-with-a-script",sections:[{local:"setup",title:"Setup"},{local:"run-a-script",title:"Run a script"},{local:"distributed-training-and-mixed-precision",title:"Distributed training and mixed precision"},{local:"run-a-script-on-a-tpu",title:"Run a script on a TPU"},{local:"run-a-script-with-accelerate",title:"Run a script with \u{1F917} Accelerate"},{local:"use-a-custom-dataset",title:"Use a custom dataset"},{local:"test-a-script",title:"Test a script"},{local:"resume-training-from-checkpoint",title:"Resume training from checkpoint"},{local:"share-your-model",title:"Share your model"}],title:"Train with a script"};function su(L){return Df(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class uu extends Sf{constructor(c){super();Yf(this,c,su,au,Pf,{})}}export{uu as default,ou as metadata};
