import{S as SL,i as qL,s as UL,e as n,k as l,w as f,t as r,M as DL,c as s,d as o,m as d,a as i,x as g,h as a,b as m,G as e,g as p,y as _,q as b,o as v,B as y,v as jL,L as bo}from"../../chunks/vendor-hf-doc-builder.js";import{T as ur}from"../../chunks/Tip-hf-doc-builder.js";import{D as S}from"../../chunks/Docstring-hf-doc-builder.js";import{C as D}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as oe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as _o}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function PL(U){let u,$,T,w,k,h,E,C,z,j,R,G,ee,Q,Y,X,ue,H,L,O,ne,F,Ee,Ae,se,bt,vt,be,je,_n,$e,bn,vn;return{c(){u=n("p"),$=r("The "),T=n("a"),w=r("Trainer"),k=r(` class is optimized for \u{1F917} Transformers models and can have surprising behaviors
when you use it on other models. When using it on your own model, make sure:`),h=l(),E=n("ul"),C=n("li"),z=r("your model always return tuples or subclasses of "),j=n("a"),R=r("ModelOutput"),G=r("."),ee=l(),Q=n("li"),Y=r("your model can compute the loss if a "),X=n("code"),ue=r("labels"),H=r(` argument is provided and that loss is returned as the first
element of the tuple (if your model returns tuples)`),L=l(),O=n("li"),ne=r("your model can accept multiple label arguments (use the "),F=n("code"),Ee=r("label_names"),Ae=r(" in your "),se=n("a"),bt=r("TrainingArguments"),vt=r(" to indicate their name to the "),be=n("a"),je=r("Trainer"),_n=r(") but none of them should be named "),$e=n("code"),bn=r('"label"'),vn=r("."),this.h()},l(ie){u=s(ie,"P",{});var re=i(u);$=a(re,"The "),T=s(re,"A",{href:!0});var Wl=i(T);w=a(Wl,"Trainer"),Wl.forEach(o),k=a(re,` class is optimized for \u{1F917} Transformers models and can have surprising behaviors
when you use it on other models. When using it on your own model, make sure:`),re.forEach(o),h=d(ie),E=s(ie,"UL",{});var ke=i(E);C=s(ke,"LI",{});var fr=i(C);z=a(fr,"your model always return tuples or subclasses of "),j=s(fr,"A",{href:!0});var Rl=i(j);R=a(Rl,"ModelOutput"),Rl.forEach(o),G=a(fr,"."),fr.forEach(o),ee=d(ke),Q=s(ke,"LI",{});var vo=i(Q);Y=a(vo,"your model can compute the loss if a "),X=s(vo,"CODE",{});var W=i(X);ue=a(W,"labels"),W.forEach(o),H=a(vo,` argument is provided and that loss is returned as the first
element of the tuple (if your model returns tuples)`),vo.forEach(o),L=d(ke),O=s(ke,"LI",{});var ae=i(O);ne=a(ae,"your model can accept multiple label arguments (use the "),F=s(ae,"CODE",{});var gr=i(F);Ee=a(gr,"label_names"),gr.forEach(o),Ae=a(ae," in your "),se=s(ae,"A",{href:!0});var Ll=i(se);bt=a(Ll,"TrainingArguments"),Ll.forEach(o),vt=a(ae," to indicate their name to the "),be=s(ae,"A",{href:!0});var Bl=i(be);je=a(Bl,"Trainer"),Bl.forEach(o),_n=a(ae,") but none of them should be named "),$e=s(ae,"CODE",{});var Gl=i($e);bn=a(Gl,'"label"'),Gl.forEach(o),vn=a(ae,"."),ae.forEach(o),ke.forEach(o),this.h()},h(){m(T,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(j,"href","/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput"),m(se,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.TrainingArguments"),m(be,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer")},m(ie,re){p(ie,u,re),e(u,$),e(u,T),e(T,w),e(u,k),p(ie,h,re),p(ie,E,re),e(E,C),e(C,z),e(C,j),e(j,R),e(C,G),e(E,ee),e(E,Q),e(Q,Y),e(Q,X),e(X,ue),e(Q,H),e(E,L),e(E,O),e(O,ne),e(O,F),e(F,Ee),e(O,Ae),e(O,se),e(se,bt),e(O,vt),e(O,be),e(be,je),e(O,_n),e(O,$e),e($e,bn),e(O,vn)},d(ie){ie&&o(u),ie&&o(h),ie&&o(E)}}}function JL(U){let u,$,T,w,k,h,E,C,z,j,R,G,ee,Q,Y,X,ue;return{c(){u=n("p"),$=r("To use this method, you need to have provided a "),T=n("code"),w=r("model_init"),k=r(" when initializing your "),h=n("a"),E=r("Trainer"),C=r(`: we need to
reinitialize the model at each new run. This is incompatible with the `),z=n("code"),j=r("optimizers"),R=r(` argument, so you need to
subclass `),G=n("a"),ee=r("Trainer"),Q=r(" and override the method "),Y=n("a"),X=r("create_optimizer_and_scheduler()"),ue=r(` for custom
optimizer/scheduler.`),this.h()},l(H){u=s(H,"P",{});var L=i(u);$=a(L,"To use this method, you need to have provided a "),T=s(L,"CODE",{});var O=i(T);w=a(O,"model_init"),O.forEach(o),k=a(L," when initializing your "),h=s(L,"A",{href:!0});var ne=i(h);E=a(ne,"Trainer"),ne.forEach(o),C=a(L,`: we need to
reinitialize the model at each new run. This is incompatible with the `),z=s(L,"CODE",{});var F=i(z);j=a(F,"optimizers"),F.forEach(o),R=a(L,` argument, so you need to
subclass `),G=s(L,"A",{href:!0});var Ee=i(G);ee=a(Ee,"Trainer"),Ee.forEach(o),Q=a(L," and override the method "),Y=s(L,"A",{href:!0});var Ae=i(Y);X=a(Ae,"create_optimizer_and_scheduler()"),Ae.forEach(o),ue=a(L,` for custom
optimizer/scheduler.`),L.forEach(o),this.h()},h(){m(h,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(G,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(Y,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer.create_optimizer_and_scheduler")},m(H,L){p(H,u,L),e(u,$),e(u,T),e(T,w),e(u,k),e(u,h),e(h,E),e(u,C),e(u,z),e(z,j),e(u,R),e(u,G),e(G,ee),e(u,Q),e(u,Y),e(Y,X),e(u,ue)},d(H){H&&o(u)}}}function CL(U){let u,$;return{c(){u=n("p"),$=r("This function is deprecated and will be removed in v4.34.0 of Transformers.")},l(T){u=s(T,"P",{});var w=i(u);$=a(w,"This function is deprecated and will be removed in v4.34.0 of Transformers."),w.forEach(o)},m(T,w){p(T,u,w),e(u,$)},d(T){T&&o(u)}}}function FL(U){let u,$,T,w,k;return w=new D({props:{code:"aW5pdF9tZW1fY3B1X2FsbG9jX2RlbHRhJTIwJTIwJTIwJTNEJTIwJTIwJTIwJTIwJTIwMTMwMU1CJTBBaW5pdF9tZW1fY3B1X3BlYWtlZF9kZWx0YSUyMCUyMCUzRCUyMCUyMCUyMCUyMCUyMCUyMDE1NE1CJTBBaW5pdF9tZW1fZ3B1X2FsbG9jX2RlbHRhJTIwJTIwJTIwJTNEJTIwJTIwJTIwJTIwJTIwJTIwMjMwTUIlMEFpbml0X21lbV9ncHVfcGVha2VkX2RlbHRhJTIwJTIwJTNEJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwME1CJTBBdHJhaW5fbWVtX2NwdV9hbGxvY19kZWx0YSUyMCUyMCUzRCUyMCUyMCUyMCUyMCUyMDEzNDVNQiUwQXRyYWluX21lbV9jcHVfcGVha2VkX2RlbHRhJTIwJTNEJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwME1CJTBBdHJhaW5fbWVtX2dwdV9hbGxvY19kZWx0YSUyMCUyMCUzRCUyMCUyMCUyMCUyMCUyMCUyMDY5M01CJTBBdHJhaW5fbWVtX2dwdV9wZWFrZWRfZGVsdGElMjAlM0QlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjA3TUI=",highlighted:`<span class="hljs-attr">init_mem_cpu_alloc_delta</span>   =     <span class="hljs-number">1301</span>MB
<span class="hljs-attr">init_mem_cpu_peaked_delta</span>  =      <span class="hljs-number">154</span>MB
<span class="hljs-attr">init_mem_gpu_alloc_delta</span>   =      <span class="hljs-number">230</span>MB
<span class="hljs-attr">init_mem_gpu_peaked_delta</span>  =        <span class="hljs-number">0</span>MB
<span class="hljs-attr">train_mem_cpu_alloc_delta</span>  =     <span class="hljs-number">1345</span>MB
<span class="hljs-attr">train_mem_cpu_peaked_delta</span> =        <span class="hljs-number">0</span>MB
<span class="hljs-attr">train_mem_gpu_alloc_delta</span>  =      <span class="hljs-number">693</span>MB
<span class="hljs-attr">train_mem_gpu_peaked_delta</span> =        <span class="hljs-number">7</span>MB`}}),{c(){u=n("p"),$=r("Now when this method is run, you will see a report that will include: :"),T=l(),f(w.$$.fragment)},l(h){u=s(h,"P",{});var E=i(u);$=a(E,"Now when this method is run, you will see a report that will include: :"),E.forEach(o),T=d(h),g(w.$$.fragment,h)},m(h,E){p(h,u,E),e(u,$),p(h,T,E),_(w,h,E),k=!0},p:bo,i(h){k||(b(w.$$.fragment,h),k=!0)},o(h){v(w.$$.fragment,h),k=!1},d(h){h&&o(u),h&&o(T),y(w,h)}}}function NL(U){let u,$;return{c(){u=n("p"),$=r(`If your predictions or labels have different sequence length (for instance because you\u2019re doing dynamic padding
in a token classification task) the predictions will be padded (on the right) to allow for concatenation into
one array. The padding index is -100.`)},l(T){u=s(T,"P",{});var w=i(u);$=a(w,`If your predictions or labels have different sequence length (for instance because you\u2019re doing dynamic padding
in a token classification task) the predictions will be padded (on the right) to allow for concatenation into
one array. The padding index is -100.`),w.forEach(o)},m(T,w){p(T,u,w),e(u,$)},d(T){T&&o(u)}}}function zL(U){let u,$;return{c(){u=n("p"),$=r(`If your predictions or labels have different sequence lengths (for instance because you\u2019re doing dynamic
padding in a token classification task) the predictions will be padded (on the right) to allow for
concatenation into one array. The padding index is -100.`)},l(T){u=s(T,"P",{});var w=i(u);$=a(w,`If your predictions or labels have different sequence lengths (for instance because you\u2019re doing dynamic
padding in a token classification task) the predictions will be padded (on the right) to allow for
concatenation into one array. The padding index is -100.`),w.forEach(o)},m(T,w){p(T,u,w),e(u,$)},d(T){T&&o(u)}}}function OL(U){let u,$,T,w,k;return w=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUyMndvcmtpbmdfZGlyJTIyKSUwQWFyZ3MlMjAlM0QlMjBhcmdzLnNldF9kYXRhbG9hZGVyKHRyYWluX2JhdGNoX3NpemUlM0QxNiUyQyUyMGV2YWxfYmF0Y2hfc2l6ZSUzRDY0KSUwQWFyZ3MucGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXpl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>args = TrainingArguments(<span class="hljs-string">&quot;working_dir&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args = args.set_dataloader(train_batch_size=<span class="hljs-number">16</span>, eval_batch_size=<span class="hljs-number">64</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args.per_device_train_batch_size
<span class="hljs-number">16</span>`}}),{c(){u=n("p"),$=r("Example:"),T=l(),f(w.$$.fragment)},l(h){u=s(h,"P",{});var E=i(u);$=a(E,"Example:"),E.forEach(o),T=d(h),g(w.$$.fragment,h)},m(h,E){p(h,u,E),e(u,$),p(h,T,E),_(w,h,E),k=!0},p:bo,i(h){k||(b(w.$$.fragment,h),k=!0)},o(h){v(w.$$.fragment,h),k=!1},d(h){h&&o(u),h&&o(T),y(w,h)}}}function WL(U){let u,$,T,w,k;return w=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUyMndvcmtpbmdfZGlyJTIyKSUwQWFyZ3MlMjAlM0QlMjBhcmdzLnNldF9ldmFsdWF0ZShzdHJhdGVneSUzRCUyMnN0ZXBzJTIyJTJDJTIwc3RlcHMlM0QxMDApJTBBYXJncy5ldmFsX3N0ZXBz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>args = TrainingArguments(<span class="hljs-string">&quot;working_dir&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args = args.set_evaluate(strategy=<span class="hljs-string">&quot;steps&quot;</span>, steps=<span class="hljs-number">100</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args.eval_steps
<span class="hljs-number">100</span>`}}),{c(){u=n("p"),$=r("Example:"),T=l(),f(w.$$.fragment)},l(h){u=s(h,"P",{});var E=i(u);$=a(E,"Example:"),E.forEach(o),T=d(h),g(w.$$.fragment,h)},m(h,E){p(h,u,E),e(u,$),p(h,T,E),_(w,h,E),k=!0},p:bo,i(h){k||(b(w.$$.fragment,h),k=!0)},o(h){v(w.$$.fragment,h),k=!1},d(h){h&&o(u),h&&o(T),y(w,h)}}}function RL(U){let u,$,T,w,k;return w=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUyMndvcmtpbmdfZGlyJTIyKSUwQWFyZ3MlMjAlM0QlMjBhcmdzLnNldF9sb2dnaW5nKHN0cmF0ZWd5JTNEJTIyc3RlcHMlMjIlMkMlMjBzdGVwcyUzRDEwMCklMEFhcmdzLmxvZ2dpbmdfc3RlcHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>args = TrainingArguments(<span class="hljs-string">&quot;working_dir&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args = args.set_logging(strategy=<span class="hljs-string">&quot;steps&quot;</span>, steps=<span class="hljs-number">100</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args.logging_steps
<span class="hljs-number">100</span>`}}),{c(){u=n("p"),$=r("Example:"),T=l(),f(w.$$.fragment)},l(h){u=s(h,"P",{});var E=i(u);$=a(E,"Example:"),E.forEach(o),T=d(h),g(w.$$.fragment,h)},m(h,E){p(h,u,E),e(u,$),p(h,T,E),_(w,h,E),k=!0},p:bo,i(h){k||(b(w.$$.fragment,h),k=!0)},o(h){v(w.$$.fragment,h),k=!1},d(h){h&&o(u),h&&o(T),y(w,h)}}}function LL(U){let u,$,T,w,k;return w=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUyMndvcmtpbmdfZGlyJTIyKSUwQWFyZ3MlMjAlM0QlMjBhcmdzLnNldF9scl9zY2hlZHVsZXIobmFtZSUzRCUyMmNvc2luZSUyMiUyQyUyMHdhcm11cF9yYXRpbyUzRDAuMDUpJTBBYXJncy53YXJtdXBfcmF0aW8=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>args = TrainingArguments(<span class="hljs-string">&quot;working_dir&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args = args.set_lr_scheduler(name=<span class="hljs-string">&quot;cosine&quot;</span>, warmup_ratio=<span class="hljs-number">0.05</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args.warmup_ratio
<span class="hljs-number">0.05</span>`}}),{c(){u=n("p"),$=r("Example:"),T=l(),f(w.$$.fragment)},l(h){u=s(h,"P",{});var E=i(u);$=a(E,"Example:"),E.forEach(o),T=d(h),g(w.$$.fragment,h)},m(h,E){p(h,u,E),e(u,$),p(h,T,E),_(w,h,E),k=!0},p:bo,i(h){k||(b(w.$$.fragment,h),k=!0)},o(h){v(w.$$.fragment,h),k=!1},d(h){h&&o(u),h&&o(T),y(w,h)}}}function BL(U){let u,$,T,w,k;return w=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUyMndvcmtpbmdfZGlyJTIyKSUwQWFyZ3MlMjAlM0QlMjBhcmdzLnNldF9vcHRpbWl6ZXIobmFtZSUzRCUyMmFkYW13X3RvcmNoJTIyJTJDJTIwYmV0YTElM0QwLjgpJTBBYXJncy5vcHRpbQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>args = TrainingArguments(<span class="hljs-string">&quot;working_dir&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args = args.set_optimizer(name=<span class="hljs-string">&quot;adamw_torch&quot;</span>, beta1=<span class="hljs-number">0.8</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args.optim
<span class="hljs-string">&#x27;adamw_torch&#x27;</span>`}}),{c(){u=n("p"),$=r("Example:"),T=l(),f(w.$$.fragment)},l(h){u=s(h,"P",{});var E=i(u);$=a(E,"Example:"),E.forEach(o),T=d(h),g(w.$$.fragment,h)},m(h,E){p(h,u,E),e(u,$),p(h,T,E),_(w,h,E),k=!0},p:bo,i(h){k||(b(w.$$.fragment,h),k=!0)},o(h){v(w.$$.fragment,h),k=!1},d(h){h&&o(u),h&&o(T),y(w,h)}}}function GL(U){let u,$,T,w,k,h,E,C,z,j,R,G,ee,Q,Y,X,ue,H,L,O;return{c(){u=n("p"),$=r("Calling this method will set "),T=n("code"),w=r("self.push_to_hub"),k=r(" to "),h=n("code"),E=r("True"),C=r(", which means the "),z=n("code"),j=r("output_dir"),R=r(` will begin a git
directory synced with the repo (determined by `),G=n("code"),ee=r("model_id"),Q=r(`) and the content will be pushed each time a save is
triggered (depending on`),Y=n("code"),X=r("self.save_strategy"),ue=r("). Calling "),H=n("a"),L=r("save_model()"),O=r(" will also trigger a push."),this.h()},l(ne){u=s(ne,"P",{});var F=i(u);$=a(F,"Calling this method will set "),T=s(F,"CODE",{});var Ee=i(T);w=a(Ee,"self.push_to_hub"),Ee.forEach(o),k=a(F," to "),h=s(F,"CODE",{});var Ae=i(h);E=a(Ae,"True"),Ae.forEach(o),C=a(F,", which means the "),z=s(F,"CODE",{});var se=i(z);j=a(se,"output_dir"),se.forEach(o),R=a(F,` will begin a git
directory synced with the repo (determined by `),G=s(F,"CODE",{});var bt=i(G);ee=a(bt,"model_id"),bt.forEach(o),Q=a(F,`) and the content will be pushed each time a save is
triggered (depending on`),Y=s(F,"CODE",{});var vt=i(Y);X=a(vt,"self.save_strategy"),vt.forEach(o),ue=a(F,"). Calling "),H=s(F,"A",{href:!0});var be=i(H);L=a(be,"save_model()"),be.forEach(o),O=a(F," will also trigger a push."),F.forEach(o),this.h()},h(){m(H,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer.save_model")},m(ne,F){p(ne,u,F),e(u,$),e(u,T),e(T,w),e(u,k),e(u,h),e(h,E),e(u,C),e(u,z),e(z,j),e(u,R),e(u,G),e(G,ee),e(u,Q),e(u,Y),e(Y,X),e(u,ue),e(u,H),e(H,L),e(u,O)},d(ne){ne&&o(u)}}}function ZL(U){let u,$,T,w,k;return w=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUyMndvcmtpbmdfZGlyJTIyKSUwQWFyZ3MlMjAlM0QlMjBhcmdzLnNldF9wdXNoX3RvX2h1YiglMjJtZSUyRmF3ZXNvbWUtbW9kZWwlMjIpJTBBYXJncy5odWJfbW9kZWxfaWQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>args = TrainingArguments(<span class="hljs-string">&quot;working_dir&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args = args.set_push_to_hub(<span class="hljs-string">&quot;me/awesome-model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args.hub_model_id
<span class="hljs-string">&#x27;me/awesome-model&#x27;</span>`}}),{c(){u=n("p"),$=r("Example:"),T=l(),f(w.$$.fragment)},l(h){u=s(h,"P",{});var E=i(u);$=a(E,"Example:"),E.forEach(o),T=d(h),g(w.$$.fragment,h)},m(h,E){p(h,u,E),e(u,$),p(h,T,E),_(w,h,E),k=!0},p:bo,i(h){k||(b(w.$$.fragment,h),k=!0)},o(h){v(w.$$.fragment,h),k=!1},d(h){h&&o(u),h&&o(T),y(w,h)}}}function VL(U){let u,$,T,w,k;return w=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUyMndvcmtpbmdfZGlyJTIyKSUwQWFyZ3MlMjAlM0QlMjBhcmdzLnNldF9zYXZlKHN0cmF0ZWd5JTNEJTIyc3RlcHMlMjIlMkMlMjBzdGVwcyUzRDEwMCklMEFhcmdzLnNhdmVfc3RlcHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>args = TrainingArguments(<span class="hljs-string">&quot;working_dir&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args = args.set_save(strategy=<span class="hljs-string">&quot;steps&quot;</span>, steps=<span class="hljs-number">100</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args.save_steps
<span class="hljs-number">100</span>`}}),{c(){u=n("p"),$=r("Example:"),T=l(),f(w.$$.fragment)},l(h){u=s(h,"P",{});var E=i(u);$=a(E,"Example:"),E.forEach(o),T=d(h),g(w.$$.fragment,h)},m(h,E){p(h,u,E),e(u,$),p(h,T,E),_(w,h,E),k=!0},p:bo,i(h){k||(b(w.$$.fragment,h),k=!0)},o(h){v(w.$$.fragment,h),k=!1},d(h){h&&o(u),h&&o(T),y(w,h)}}}function XL(U){let u,$,T,w,k,h,E,C;return{c(){u=n("p"),$=r("Calling this method will automatically set "),T=n("code"),w=r("self.do_predict"),k=r(" to "),h=n("code"),E=r("True"),C=r(".")},l(z){u=s(z,"P",{});var j=i(u);$=a(j,"Calling this method will automatically set "),T=s(j,"CODE",{});var R=i(T);w=a(R,"self.do_predict"),R.forEach(o),k=a(j," to "),h=s(j,"CODE",{});var G=i(h);E=a(G,"True"),G.forEach(o),C=a(j,"."),j.forEach(o)},m(z,j){p(z,u,j),e(u,$),e(u,T),e(T,w),e(u,k),e(u,h),e(h,E),e(u,C)},d(z){z&&o(u)}}}function YL(U){let u,$,T,w,k;return w=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUyMndvcmtpbmdfZGlyJTIyKSUwQWFyZ3MlMjAlM0QlMjBhcmdzLnNldF90ZXN0aW5nKGJhdGNoX3NpemUlM0QzMiklMEFhcmdzLnBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXpl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>args = TrainingArguments(<span class="hljs-string">&quot;working_dir&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args = args.set_testing(batch_size=<span class="hljs-number">32</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args.per_device_eval_batch_size
<span class="hljs-number">32</span>`}}),{c(){u=n("p"),$=r("Example:"),T=l(),f(w.$$.fragment)},l(h){u=s(h,"P",{});var E=i(u);$=a(E,"Example:"),E.forEach(o),T=d(h),g(w.$$.fragment,h)},m(h,E){p(h,u,E),e(u,$),p(h,T,E),_(w,h,E),k=!0},p:bo,i(h){k||(b(w.$$.fragment,h),k=!0)},o(h){v(w.$$.fragment,h),k=!1},d(h){h&&o(u),h&&o(T),y(w,h)}}}function HL(U){let u,$,T,w,k,h,E,C;return{c(){u=n("p"),$=r("Calling this method will automatically set "),T=n("code"),w=r("self.do_train"),k=r(" to "),h=n("code"),E=r("True"),C=r(".")},l(z){u=s(z,"P",{});var j=i(u);$=a(j,"Calling this method will automatically set "),T=s(j,"CODE",{});var R=i(T);w=a(R,"self.do_train"),R.forEach(o),k=a(j," to "),h=s(j,"CODE",{});var G=i(h);E=a(G,"True"),G.forEach(o),C=a(j,"."),j.forEach(o)},m(z,j){p(z,u,j),e(u,$),e(u,T),e(T,w),e(u,k),e(u,h),e(h,E),e(u,C)},d(z){z&&o(u)}}}function QL(U){let u,$,T,w,k;return w=new D({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUyMndvcmtpbmdfZGlyJTIyKSUwQWFyZ3MlMjAlM0QlMjBhcmdzLnNldF90cmFpbmluZyhsZWFybmluZ19yYXRlJTNEMWUtNCUyQyUyMGJhdGNoX3NpemUlM0QzMiklMEFhcmdzLmxlYXJuaW5nX3JhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>args = TrainingArguments(<span class="hljs-string">&quot;working_dir&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args = args.set_training(learning_rate=<span class="hljs-number">1e-4</span>, batch_size=<span class="hljs-number">32</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>args.learning_rate
<span class="hljs-number">1e-4</span>`}}),{c(){u=n("p"),$=r("Example:"),T=l(),f(w.$$.fragment)},l(h){u=s(h,"P",{});var E=i(u);$=a(E,"Example:"),E.forEach(o),T=d(h),g(w.$$.fragment,h)},m(h,E){p(h,u,E),e(u,$),p(h,T,E),_(w,h,E),k=!0},p:bo,i(h){k||(b(w.$$.fragment,h),k=!0)},o(h){v(w.$$.fragment,h),k=!1},d(h){h&&o(u),h&&o(T),y(w,h)}}}function KL(U){let u,$,T,w,k;return{c(){u=n("p"),$=r(`We strongly recommend to install PyTorch >= 1.13 (nightly version at the time of writing) on your MacOS machine.
It has major fixes related to model correctness and performance improvements for transformer based models.
Please refer to `),T=n("a"),w=r("https://github.com/pytorch/pytorch/issues/82707"),k=r(" for more details."),this.h()},l(h){u=s(h,"P",{});var E=i(u);$=a(E,`We strongly recommend to install PyTorch >= 1.13 (nightly version at the time of writing) on your MacOS machine.
It has major fixes related to model correctness and performance improvements for transformer based models.
Please refer to `),T=s(E,"A",{href:!0,rel:!0});var C=i(T);w=a(C,"https://github.com/pytorch/pytorch/issues/82707"),C.forEach(o),k=a(E," for more details."),E.forEach(o),this.h()},h(){m(T,"href","https://github.com/pytorch/pytorch/issues/82707"),m(T,"rel","nofollow")},m(h,E){p(h,u,E),e(u,$),e(u,T),e(T,w),e(u,k)},d(h){h&&o(u)}}}function eB(U){let u,$,T,w,k,h,E,C,z,j,R,G,ee,Q,Y,X,ue,H,L,O,ne,F,Ee,Ae,se,bt,vt,be,je,_n,$e,bn,vn,ie,re,Wl,ke,fr,Rl,vo,W,ae,gr,Ll,Bl,Gl,Zl,om,mT,hT,uT,Vl,rm,fT,gT,_T,Xl,am,bT,vT,yT,yt,nm,wT,TT,sm,ET,AT,im,$T,kT,xT,Yl,lm,MT,IT,ST,Hl,dm,qT,UT,DT,Ql,cm,jT,PT,JT,Kl,pm,CT,FT,NT,ed,mm,zT,OT,WT,td,hm,RT,LT,BT,od,um,GT,ZT,Uv,_r,Dv,br,VT,rd,XT,YT,jv,yn,Pv,wt,HT,ad,QT,KT,nd,e0,t0,Jv,yo,vr,fm,wn,o0,gm,r0,Cv,A,Tn,a0,_m,n0,s0,bm,i0,l0,xe,yr,vm,d0,c0,sd,p0,m0,h0,le,ym,u0,f0,wm,g0,_0,Tm,b0,v0,Em,y0,w0,Am,T0,E0,$m,A0,$0,k0,id,km,x0,M0,I0,Pe,xm,S0,q0,Mm,U0,D0,Im,j0,P0,Sm,J0,C0,F0,Je,qm,N0,z0,Um,O0,W0,Dm,R0,L0,jm,B0,G0,Z0,wr,En,V0,An,X0,Pm,Y0,H0,Q0,Tr,$n,K0,kn,eE,Jm,tE,oE,rE,Tt,xn,aE,Cm,nE,sE,Fm,iE,lE,Er,Mn,dE,Nm,cE,pE,Ar,In,mE,Sn,hE,zm,uE,fE,gE,Et,qn,_E,Om,bE,vE,Un,yE,Wm,wE,TE,EE,At,Dn,AE,Rm,$E,kE,it,xE,Lm,ME,IE,Bm,SE,qE,Gm,UE,DE,jE,$r,jn,PE,Zm,JE,CE,Ce,Pn,FE,Vm,NE,zE,Jn,OE,Xm,WE,RE,LE,Ym,BE,GE,$t,Cn,ZE,wo,VE,Hm,XE,YE,Qm,HE,QE,KE,Km,e4,t4,kr,Fn,o4,Nn,r4,ld,a4,n4,s4,kt,zn,i4,On,l4,eh,d4,c4,p4,th,m4,h4,xr,Wn,u4,oh,f4,g4,xt,Rn,_4,Ln,b4,rh,v4,y4,w4,ah,T4,E4,Fe,Bn,A4,Gn,$4,nh,k4,x4,M4,To,I4,sh,S4,q4,ih,U4,D4,j4,lh,P4,J4,Mt,Zn,C4,Me,F4,dh,N4,z4,ch,O4,W4,ph,R4,L4,mh,B4,G4,Z4,Mr,V4,It,Vn,X4,Xn,Y4,hh,H4,Q4,K4,Ir,eA,Sr,Yn,tA,Hn,oA,uh,rA,aA,nA,qr,Qn,sA,fh,iA,lA,Ur,Kn,dA,es,cA,gh,pA,mA,hA,St,ts,uA,os,fA,_h,gA,_A,bA,bh,vA,yA,P,rs,wA,vh,TA,EA,yh,AA,$A,wh,kA,xA,Eo,MA,Th,IA,SA,Eh,qA,UA,DA,Dr,jA,Ah,$h,PA,JA,lt,Ie,CA,kh,FA,NA,xh,zA,OA,Mh,WA,RA,Ih,LA,BA,GA,Ao,ZA,Sh,VA,XA,qh,YA,HA,QA,dd,Uh,KA,e$,t$,qt,Dh,o$,r$,jh,a$,n$,Ph,s$,i$,l$,Jh,d$,c$,Ch,p$,m$,as,h$,Fh,u$,f$,g$,dt,_$,Nh,b$,v$,zh,y$,w$,Oh,T$,E$,A$,fe,$$,cd,k$,x$,Wh,M$,I$,Rh,S$,q$,Lh,U$,D$,Bh,j$,P$,J$,Z,C$,Gh,F$,N$,Zh,z$,O$,Vh,W$,R$,Xh,L$,B$,ns,G$,Z$,Yh,V$,X$,Hh,Y$,H$,Qh,Q$,K$,Kh,e3,t3,eu,o3,r3,a3,Se,n3,pd,s3,i3,tu,l3,d3,md,c3,p3,ou,m3,h3,u3,ru,f3,g3,jr,ss,_3,au,b3,v3,Pr,is,y3,ls,w3,nu,T3,E3,A3,Ut,ds,$3,cs,k3,su,x3,M3,I3,ps,S3,iu,q3,U3,D3,de,ms,j3,lu,P3,J3,hs,C3,du,F3,N3,z3,Jr,O3,us,W3,cu,R3,L3,B3,$o,ko,G3,pu,Z3,V3,mu,X3,Y3,H3,xo,Q3,hu,K3,ek,uu,tk,ok,rk,Mo,ak,fu,nk,sk,gu,ik,lk,dk,Dt,fs,ck,Io,pk,_u,mk,hk,bu,uk,fk,gk,vu,_k,bk,jt,gs,vk,So,yk,yu,wk,Tk,wu,Ek,Ak,$k,Tu,kk,xk,Cr,_s,Mk,ct,Ik,Eu,Sk,qk,Au,Uk,Dk,$u,jk,Pk,Jk,Fr,bs,Ck,vs,Fk,ku,Nk,zk,Ok,Ne,ys,Wk,ws,Rk,xu,Lk,Bk,Gk,Mu,Zk,Vk,Ts,Xk,hd,Yk,Hk,Qk,Pt,Es,Kk,As,ex,Iu,tx,ox,rx,Su,ax,nx,Jt,$s,sx,qu,ix,lx,Uu,dx,cx,Nr,ks,px,Du,mx,hx,Ct,xs,ux,ju,fx,gx,Pu,_x,Fv,qo,zr,Ju,Ms,bx,Cu,vx,Nv,pt,Is,yx,ze,Ss,wx,Fu,Tx,Ex,qs,Ax,Nu,$x,kx,xx,zu,Mx,Ix,ce,Us,Sx,Ou,qx,Ux,Ds,Dx,Wu,jx,Px,Jx,Or,Cx,js,Fx,Ru,Nx,zx,Ox,Uo,Do,Wx,Lu,Rx,Lx,Bu,Bx,Gx,Zx,jo,Vx,Gu,Xx,Yx,Zu,Hx,Qx,Kx,Po,eM,Vu,tM,oM,Xu,rM,aM,zv,Jo,Wr,Yu,Ps,nM,Hu,sM,Ov,q,Js,iM,Cs,lM,Qu,dM,cM,pM,Co,mM,ud,hM,uM,Fs,fM,gM,_M,ve,Ns,bM,Ku,vM,yM,Fo,wM,ef,TM,EM,tf,AM,$M,kM,No,xM,of,MM,IM,rf,SM,qM,UM,zs,DM,af,jM,PM,JM,Rr,Os,CM,nf,FM,NM,Ft,Ws,zM,sf,OM,WM,zo,RM,lf,LM,BM,df,GM,ZM,VM,Nt,Rs,XM,cf,YM,HM,Lr,QM,zt,Ls,KM,pf,e5,t5,Br,o5,Ot,Bs,r5,mf,a5,n5,Gr,s5,Wt,Gs,i5,hf,l5,d5,Zr,c5,Rt,Zs,p5,uf,m5,h5,Vr,u5,Oe,Vs,f5,ff,g5,_5,Xr,b5,Yr,v5,Lt,Xs,y5,gf,w5,T5,Hr,E5,We,Ys,A5,_f,$5,k5,Qr,x5,Kr,M5,Re,Hs,I5,bf,S5,q5,ea,U5,ta,D5,oa,Qs,j5,Ks,P5,vf,J5,C5,F5,ra,ei,N5,yf,z5,O5,aa,ti,W5,wf,R5,Wv,Oo,na,Tf,oi,L5,Ef,B5,Rv,qe,ri,G5,ai,Z5,Af,V5,X5,Y5,Wo,H5,fd,Q5,K5,ni,e9,t9,o9,sa,si,r9,Ro,a9,$f,n9,s9,kf,i9,l9,Lv,Lo,ia,xf,ii,d9,Mf,c9,Bv,ye,p9,gd,m9,h9,If,u9,f9,_d,g9,_9,Sf,b9,v9,Gv,la,y9,bd,w9,T9,Zv,da,vd,qf,E9,A9,$9,yd,Uf,k9,x9,Vv,Le,M9,Df,I9,S9,jf,q9,U9,wd,D9,j9,Xv,ca,pa,Pf,P9,J9,Jf,C9,F9,N9,Td,Cf,z9,O9,Yv,Bo,ma,Ff,li,W9,Nf,R9,Hv,Be,L9,Ed,B9,G9,zf,Z9,V9,Of,X9,Y9,Qv,Bt,H9,Wf,Q9,K9,Ad,eI,tI,Kv,ha,$d,Rf,oI,rI,aI,kd,Lf,nI,sI,ey,Ge,iI,xd,lI,dI,Bf,cI,pI,Gf,mI,hI,ty,pe,uI,Md,fI,gI,Zf,_I,bI,Vf,vI,yI,Xf,wI,TI,Id,EI,AI,oy,Sd,$I,ry,di,ay,qd,kI,ny,ci,sy,Ud,xI,iy,pi,ly,Dd,MI,dy,jd,II,cy,mi,py,ua,SI,Yf,qI,UI,my,Go,fa,Hf,hi,DI,Qf,jI,hy,we,PI,Pd,JI,CI,Kf,FI,NI,eg,zI,OI,tg,WI,RI,uy,Gt,LI,ui,BI,GI,og,ZI,VI,fy,Zo,ga,rg,fi,XI,ag,YI,gy,Jd,HI,_y,_a,QI,gi,ng,KI,eS,by,_i,vy,Zt,tS,bi,sg,oS,rS,vi,ig,aS,nS,yy,yi,wy,wi,Ty,ba,sS,Cd,iS,lS,Ey,Fd,dS,Ay,Nd,cS,$y,zd,lg,dg,pS,ky,va,mS,cg,hS,uS,xy,Od,fS,My,Ti,Iy,Vt,gS,pg,_S,bS,mg,vS,yS,Sy,Wd,wS,qy,Ei,Uy,Xt,TS,hg,ES,AS,ug,$S,kS,Dy,Yt,xS,fg,MS,IS,Ai,gg,SS,qS,jy,$i,Py,Rd,US,Jy,ki,Cy,Ld,DS,Fy,xi,Ny,Bd,jS,zy,Gd,_g,bg,PS,Oy,ya,JS,vg,CS,FS,Wy,Zd,Mi,NS,yg,zS,OS,Ry,Ii,Ly,Si,wg,WS,By,qi,Gy,Ht,RS,Tg,LS,BS,Eg,GS,ZS,Zy,Vd,VS,Vy,Ui,Xy,Xd,XS,Yy,wa,YS,Ag,HS,QS,Hy,Vo,Ta,$g,Di,KS,kg,eq,Qy,Ea,tq,Yd,oq,rq,Ky,Ze,aq,ji,nq,sq,Pi,iq,lq,Ji,dq,cq,e1,Aa,pq,Hd,mq,hq,t1,Qd,o1,Xo,$a,xg,Ci,uq,Mg,fq,r1,Kd,gq,a1,ka,_q,Fi,bq,vq,n1,ec,yq,s1,Ni,i1,tc,wq,l1,Qt,Tq,Ig,Eq,Aq,Sg,$q,kq,d1,Yo,xa,qg,zi,xq,Ug,Mq,c1,oc,Iq,p1,Ve,Sq,Dg,qq,Uq,jg,Dq,jq,Pg,Pq,Jq,m1,Kt,Cq,Jg,Fq,Nq,Cg,zq,Oq,h1,Oi,u1,Ma,Wq,Wi,Rq,Lq,f1,Ho,Ia,Fg,Ri,Bq,Ng,Gq,g1,rc,Zq,_1,Li,b1,eo,Vq,zg,Xq,Yq,Og,Hq,Qq,v1,ac,Kq,y1,Bi,w1,nc,eU,T1,Sa,tU,Wg,oU,rU,E1,mt,Rg,aU,nU,Lg,sU,iU,Bg,lU,dU,A1,sc,cU,$1,Gi,k1,ic,pU,x1,Xe,mU,Gg,hU,uU,Zg,fU,gU,Vg,_U,bU,M1,Qo,qa,Xg,Zi,vU,Yg,yU,I1,to,wU,Hg,TU,EU,Qg,AU,$U,S1,lc,kU,q1,dc,xU,U1,Ua,MU,Kg,IU,SU,D1,Vi,j1,te,qU,e_,UU,DU,t_,jU,PU,o_,JU,CU,r_,FU,NU,a_,zU,OU,n_,WU,RU,P1,cc,LU,J1,Ko,Da,s_,Xi,BU,i_,GU,C1,ja,ZU,Yi,VU,XU,F1,Hi,l_,YU,HU,N1,Qi,d_,QU,KU,z1,me,c_,Ki,eD,p_,tD,oD,rD,el,pc,m_,aD,nD,sD,er,tl,iD,h_,lD,dD,cD,ol,pD,u_,mD,hD,uD,rl,fD,f_,gD,_D,bD,g_,tr,vD,__,yD,wD,b_,TD,ED,AD,v_,ht,$D,y_,kD,xD,w_,MD,ID,T_,SD,qD,UD,E_,or,DD,A_,jD,PD,$_,JD,CD,FD,al,ut,ND,k_,zD,OD,x_,WD,RD,M_,LD,BD,GD,ft,mc,ZD,nl,ge,VD,I_,XD,YD,S_,HD,QD,q_,KD,ej,U_,tj,oj,D_,rj,aj,nj,sl,sj,j_,ij,lj,dj,gt,P_,cj,pj,J_,mj,hj,C_,uj,fj,F_,gj,_j,Pa,N_,bj,vj,z_,yj,wj,Tj,Ja,O_,Ej,Aj,W_,$j,kj,O1,hc,R_,xj,W1,uc,Ye,Mj,L_,Ij,Sj,B_,qj,Uj,Dj,jj,il,Pj,R1,rr,Ca,G_,ll,Jj,Z_,Cj,L1,oo,Fj,dl,Nj,zj,cl,Oj,Wj,B1,pl,V_,Rj,Lj,G1,ml,X_,Bj,Gj,Z1,ro,Zj,Y_,Vj,Xj,H_,Yj,Hj,V1,He,Fa,Q_,Qj,Kj,K_,eP,tP,oP,Na,eb,rP,aP,hl,nP,sP,iP,Qe,tb,lP,dP,ob,cP,pP,rb,mP,hP,ab,uP,fP,gP,fc,_P,ul,_e,bP,nb,vP,yP,sb,wP,TP,ib,EP,AP,lb,$P,kP,db,xP,MP,IP,fl,SP,cb,qP,UP,X1,ar,za,pb,gl,DP,mb,jP,Y1,Ke,PP,hb,JP,CP,_l,FP,NP,bl,zP,OP,H1,Oa,Q1,gc,ub,WP,K1,ao,fb,RP,LP,gb,BP,GP,_b,ZP,ew,nr,bb,VP,XP,vl,YP,HP,tw,_t,vb,QP,KP,yb,e6,t6,wb,o6,r6,ow,yl,rw,_c,Tb,a6,aw,Wa,wl,n6,Eb,s6,i6,l6,Ue,d6,Ab,c6,p6,$b,m6,h6,kb,u6,f6,xb,g6,_6,nw,no,b6,Mb,v6,y6,Tl,w6,T6,sw,sr,Ra,Ib,El,E6,Sb,A6,iw,bc,$6,lw,La,qb,k6,x6,Ub,M6,dw,vc,I6,cw,so,Db,io,S6,jb,q6,U6,Pb,D6,j6,Jb,P6,J6,K,Al,C6,Cb,F6,N6,z6,$l,O6,Fb,W6,R6,kl,L6,Nb,B6,G6,xl,Z6,zb,V6,X6,Ml,Y6,Ob,ir,H6,Wb,Q6,K6,Rb,eJ,tJ,pw,Il,mw,Sl,ql,oJ,Lb,rJ,aJ,hw,Ul,uw,Ba,nJ,Dl,sJ,iJ,fw,yc,lJ,gw,M,dJ,wc,cJ,Bb,pJ,Tc,mJ,Gb,hJ,Ec,uJ,Zb,fJ,Ac,gJ,Vb,_J,$c,bJ,Xb,vJ,kc,yJ,Yb,wJ,xc,TJ,Hb,EJ,Mc,AJ,Qb,$J,Ic,kJ,Kb,xJ,Sc,MJ,ev,IJ,qc,SJ,tv,qJ,Uc,UJ,ov,DJ,Dc,jJ,rv,PJ,jc,JJ,av,CJ,Pc,FJ,nv,NJ,Jc,zJ,sv,OJ,Cc,WJ,iv,RJ,Fc,LJ,lv,BJ,Nc,GJ,dv,ZJ,zc,VJ,cv,XJ,Oc,YJ,pv,HJ,Wc,QJ,mv,KJ,Rc,e8,hv,t8,_w;return h=new oe({}),_r=new ur({props:{warning:!0,$$slots:{default:[PL]},$$scope:{ctx:U}}}),yn=new D({props:{code:"ZnJvbSUyMHRvcmNoJTIwaW1wb3J0JTIwbm4lMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwVHJhaW5lciUwQSUwQSUwQWNsYXNzJTIwQ3VzdG9tVHJhaW5lcihUcmFpbmVyKSUzQSUwQSUyMCUyMCUyMCUyMGRlZiUyMGNvbXB1dGVfbG9zcyhzZWxmJTJDJTIwbW9kZWwlMkMlMjBpbnB1dHMlMkMlMjByZXR1cm5fb3V0cHV0cyUzREZhbHNlKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxhYmVscyUyMCUzRCUyMGlucHV0cy5nZXQoJTIybGFiZWxzJTIyKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMyUyMGZvcndhcmQlMjBwYXNzJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG91dHB1dHMuZ2V0KCUyMmxvZ2l0cyUyMiklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBjb21wdXRlJTIwY3VzdG9tJTIwbG9zcyUyMChzdXBwb3NlJTIwb25lJTIwaGFzJTIwMyUyMGxhYmVscyUyMHdpdGglMjBkaWZmZXJlbnQlMjB3ZWlnaHRzKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxvc3NfZmN0JTIwJTNEJTIwbm4uQ3Jvc3NFbnRyb3B5TG9zcyh3ZWlnaHQlM0R0b3JjaC50ZW5zb3IoJTVCMS4wJTJDJTIwMi4wJTJDJTIwMy4wJTVEJTJDJTIwZGV2aWNlJTNEbW9kZWwuZGV2aWNlKSklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsb3NzJTIwJTNEJTIwbG9zc19mY3QobG9naXRzLnZpZXcoLTElMkMlMjBzZWxmLm1vZGVsLmNvbmZpZy5udW1fbGFiZWxzKSUyQyUyMGxhYmVscy52aWV3KC0xKSklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjAobG9zcyUyQyUyMG91dHB1dHMpJTIwaWYlMjByZXR1cm5fb3V0cHV0cyUyMGVsc2UlMjBsb3Nz",highlighted:`<span class="hljs-keyword">from</span> torch <span class="hljs-keyword">import</span> nn
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Trainer


<span class="hljs-keyword">class</span> <span class="hljs-title class_">CustomTrainer</span>(<span class="hljs-title class_ inherited__">Trainer</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">compute_loss</span>(<span class="hljs-params">self, model, inputs, return_outputs=<span class="hljs-literal">False</span></span>):
        labels = inputs.get(<span class="hljs-string">&quot;labels&quot;</span>)
        <span class="hljs-comment"># forward pass</span>
        outputs = model(**inputs)
        logits = outputs.get(<span class="hljs-string">&quot;logits&quot;</span>)
        <span class="hljs-comment"># compute custom loss (suppose one has 3 labels with different weights)</span>
        loss_fct = nn.CrossEntropyLoss(weight=torch.tensor([<span class="hljs-number">1.0</span>, <span class="hljs-number">2.0</span>, <span class="hljs-number">3.0</span>], device=model.device))
        loss = loss_fct(logits.view(-<span class="hljs-number">1</span>, self.model.config.num_labels), labels.view(-<span class="hljs-number">1</span>))
        <span class="hljs-keyword">return</span> (loss, outputs) <span class="hljs-keyword">if</span> return_outputs <span class="hljs-keyword">else</span> loss`}}),wn=new oe({}),Tn=new S({props:{name:"class transformers.Trainer",anchor:"transformers.Trainer",parameters:[{name:"model",val:": typing.Union[transformers.modeling_utils.PreTrainedModel, torch.nn.modules.module.Module] = None"},{name:"args",val:": TrainingArguments = None"},{name:"data_collator",val:": typing.Optional[DataCollator] = None"},{name:"train_dataset",val:": typing.Optional[torch.utils.data.dataset.Dataset] = None"},{name:"eval_dataset",val:": typing.Union[torch.utils.data.dataset.Dataset, typing.Dict[str, torch.utils.data.dataset.Dataset], NoneType] = None"},{name:"tokenizer",val:": typing.Optional[transformers.tokenization_utils_base.PreTrainedTokenizerBase] = None"},{name:"model_init",val:": typing.Union[typing.Callable[[], transformers.modeling_utils.PreTrainedModel], NoneType] = None"},{name:"compute_metrics",val:": typing.Union[typing.Callable[[transformers.trainer_utils.EvalPrediction], typing.Dict], NoneType] = None"},{name:"callbacks",val:": typing.Optional[typing.List[transformers.trainer_callback.TrainerCallback]] = None"},{name:"optimizers",val:": typing.Tuple[torch.optim.optimizer.Optimizer, torch.optim.lr_scheduler.LambdaLR] = (None, None)"},{name:"preprocess_logits_for_metrics",val:": typing.Union[typing.Callable[[torch.Tensor, torch.Tensor], torch.Tensor], NoneType] = None"}],parametersDescription:[{anchor:"transformers.Trainer.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <code>torch.nn.Module</code>, <em>optional</em>) &#x2014;
The model to train, evaluate or use for predictions. If not provided, a <code>model_init</code> must be passed.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p><a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a> is optimized to work with the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> provided by the library. You can still use
your own models defined as <code>torch.nn.Module</code> as long as they work the same way as the &#x1F917; Transformers
models.</p>

					</div>`,name:"model"},{anchor:"transformers.Trainer.args",description:`<strong>args</strong> (<a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>, <em>optional</em>) &#x2014;
The arguments to tweak for training. Will default to a basic instance of <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a> with the
<code>output_dir</code> set to a directory named <em>tmp_trainer</em> in the current directory if not provided.`,name:"args"},{anchor:"transformers.Trainer.data_collator",description:`<strong>data_collator</strong> (<code>DataCollator</code>, <em>optional</em>) &#x2014;
The function to use to form a batch from a list of elements of <code>train_dataset</code> or <code>eval_dataset</code>. Will
default to <a href="/docs/transformers/v4.32.0/en/main_classes/data_collator#transformers.default_data_collator">default_data_collator()</a> if no <code>tokenizer</code> is provided, an instance of
<a href="/docs/transformers/v4.32.0/en/main_classes/data_collator#transformers.DataCollatorWithPadding">DataCollatorWithPadding</a> otherwise.`,name:"data_collator"},{anchor:"transformers.Trainer.train_dataset",description:`<strong>train_dataset</strong> (<code>torch.utils.data.Dataset</code> or <code>torch.utils.data.IterableDataset</code>, <em>optional</em>) &#x2014;
The dataset to use for training. If it is a <a href="https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset" rel="nofollow">Dataset</a>, columns not accepted by the
<code>model.forward()</code> method are automatically removed.</p>
<p>Note that if it&#x2019;s a <code>torch.utils.data.IterableDataset</code> with some randomization and you are training in a
distributed fashion, your iterable dataset should either use a internal attribute <code>generator</code> that is a
<code>torch.Generator</code> for the randomization that must be identical on all processes (and the Trainer will
manually set the seed of this <code>generator</code> at each epoch) or have a <code>set_epoch()</code> method that internally
sets the seed of the RNGs used.`,name:"train_dataset"},{anchor:"transformers.Trainer.eval_dataset",description:`<strong>eval_dataset</strong> (Union[<code>torch.utils.data.Dataset</code>, Dict[str, <code>torch.utils.data.Dataset</code>]), <em>optional</em>) &#x2014;
The dataset to use for evaluation. If it is a <a href="https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset" rel="nofollow">Dataset</a>, columns not accepted by the
<code>model.forward()</code> method are automatically removed. If it is a dictionary, it will evaluate on each
dataset prepending the dictionary key to the metric name.`,name:"eval_dataset"},{anchor:"transformers.Trainer.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase">PreTrainedTokenizerBase</a>, <em>optional</em>) &#x2014;
The tokenizer used to preprocess the data. If provided, will be used to automatically pad the inputs to the
maximum length when batching inputs, and it will be saved along the model to make it easier to rerun an
interrupted training or reuse the fine-tuned model.`,name:"tokenizer"},{anchor:"transformers.Trainer.model_init",description:`<strong>model_init</strong> (<code>Callable[[], PreTrainedModel]</code>, <em>optional</em>) &#x2014;
A function that instantiates the model to be used. If provided, each call to <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer.train">train()</a> will start
from a new instance of the model as given by this function.</p>
<p>The function may have zero argument, or a single one containing the optuna/Ray Tune/SigOpt trial object, to
be able to choose different architectures according to hyper parameters (such as layer count, sizes of
inner layers, dropout probabilities etc).`,name:"model_init"},{anchor:"transformers.Trainer.compute_metrics",description:`<strong>compute_metrics</strong> (<code>Callable[[EvalPrediction], Dict]</code>, <em>optional</em>) &#x2014;
The function that will be used to compute metrics at evaluation. Must take a <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.EvalPrediction">EvalPrediction</a> and return
a dictionary string to metric values.`,name:"compute_metrics"},{anchor:"transformers.Trainer.callbacks",description:`<strong>callbacks</strong> (List of <a href="/docs/transformers/v4.32.0/en/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a>, <em>optional</em>) &#x2014;
A list of callbacks to customize the training loop. Will add those to the list of default callbacks
detailed in <a href="callback">here</a>.</p>
<p>If you want to remove one of the default callbacks used, use the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer.remove_callback">Trainer.remove_callback()</a> method.`,name:"callbacks"},{anchor:"transformers.Trainer.optimizers",description:`<strong>optimizers</strong> (<code>Tuple[torch.optim.Optimizer, torch.optim.lr_scheduler.LambdaLR]</code>, <em>optional</em>) &#x2014; A tuple
containing the optimizer and the scheduler to use. Will default to an instance of <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.AdamW">AdamW</a> on your model
and a scheduler given by <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.get_linear_schedule_with_warmup">get_linear_schedule_with_warmup()</a> controlled by <code>args</code>.`,name:"optimizers"},{anchor:"transformers.Trainer.preprocess_logits_for_metrics",description:`<strong>preprocess_logits_for_metrics</strong> (<code>Callable[[torch.Tensor, torch.Tensor], torch.Tensor]</code>, <em>optional</em>) &#x2014;
A function that preprocess the logits right before caching them at each evaluation step. Must take two
tensors, the logits and the labels, and return the logits once processed as desired. The modifications made
by this function will be reflected in the predictions received by <code>compute_metrics</code>.</p>
<p>Note that the labels (second parameter) will be <code>None</code> if the dataset does not have them.`,name:"preprocess_logits_for_metrics"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L229"}}),En=new S({props:{name:"add_callback",anchor:"transformers.Trainer.add_callback",parameters:[{name:"callback",val:""}],parametersDescription:[{anchor:"transformers.Trainer.add_callback.callback",description:`<strong>callback</strong> (<code>type</code> or <code>~transformer.TrainerCallback</code>) &#x2014;
A <code>~transformer.TrainerCallback</code> class or an instance of a <code>~transformer.TrainerCallback</code>. In the
first case, will instantiate a member of that class.`,name:"callback"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L689"}}),$n=new S({props:{name:"autocast_smart_context_manager",anchor:"transformers.Trainer.autocast_smart_context_manager",parameters:[{name:"cache_enabled",val:": typing.Optional[bool] = True"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L2640"}}),xn=new S({props:{name:"compute_loss",anchor:"transformers.Trainer.compute_loss",parameters:[{name:"model",val:""},{name:"inputs",val:""},{name:"return_outputs",val:" = False"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L2697"}}),Mn=new S({props:{name:"compute_loss_context_manager",anchor:"transformers.Trainer.compute_loss_context_manager",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L2634"}}),In=new S({props:{name:"create_model_card",anchor:"transformers.Trainer.create_model_card",parameters:[{name:"language",val:": typing.Optional[str] = None"},{name:"license",val:": typing.Optional[str] = None"},{name:"tags",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"model_name",val:": typing.Optional[str] = None"},{name:"finetuned_from",val:": typing.Optional[str] = None"},{name:"tasks",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"dataset_tags",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"dataset",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"dataset_args",val:": typing.Union[str, typing.List[str], NoneType] = None"}],parametersDescription:[{anchor:"transformers.Trainer.create_model_card.language",description:`<strong>language</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The language of the model (if applicable)`,name:"language"},{anchor:"transformers.Trainer.create_model_card.license",description:`<strong>license</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The license of the model. Will default to the license of the pretrained model used, if the original
model given to the <code>Trainer</code> comes from a repo on the Hub.`,name:"license"},{anchor:"transformers.Trainer.create_model_card.tags",description:`<strong>tags</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Some tags to be included in the metadata of the model card.`,name:"tags"},{anchor:"transformers.Trainer.create_model_card.model_name",description:`<strong>model_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name of the model.`,name:"model_name"},{anchor:"transformers.Trainer.create_model_card.finetuned_from",description:`<strong>finetuned_from</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name of the model used to fine-tune this one (if applicable). Will default to the name of the repo
of the original model given to the <code>Trainer</code> (if it comes from the Hub).`,name:"finetuned_from"},{anchor:"transformers.Trainer.create_model_card.tasks",description:`<strong>tasks</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
One or several task identifiers, to be included in the metadata of the model card.`,name:"tasks"},{anchor:"transformers.Trainer.create_model_card.dataset_tags",description:`<strong>dataset_tags</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
One or several dataset tags, to be included in the metadata of the model card.`,name:"dataset_tags"},{anchor:"transformers.Trainer.create_model_card.dataset",description:`<strong>dataset</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
One or several dataset identifiers, to be included in the metadata of the model card.`,name:"dataset"},{anchor:"transformers.Trainer.create_model_card.dataset_args",description:`<strong>dataset_args</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
One or several dataset arguments, to be included in the metadata of the model card.`,name:"dataset_args"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L3496"}}),qn=new S({props:{name:"create_optimizer",anchor:"transformers.Trainer.create_optimizer",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L947"}}),Dn=new S({props:{name:"create_optimizer_and_scheduler",anchor:"transformers.Trainer.create_optimizer_and_scheduler",parameters:[{name:"num_training_steps",val:": int"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L931"}}),jn=new S({props:{name:"create_scheduler",anchor:"transformers.Trainer.create_scheduler",parameters:[{name:"num_training_steps",val:": int"},{name:"optimizer",val:": Optimizer = None"}],parametersDescription:[{anchor:"transformers.Trainer.create_scheduler.num_training_steps",description:"<strong>num_training_steps</strong> (int) &#x2014; The number of training steps to do.",name:"num_training_steps"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L1125"}}),Pn=new S({props:{name:"evaluate",anchor:"transformers.Trainer.evaluate",parameters:[{name:"eval_dataset",val:": typing.Optional[torch.utils.data.dataset.Dataset] = None"},{name:"ignore_keys",val:": typing.Optional[typing.List[str]] = None"},{name:"metric_key_prefix",val:": str = 'eval'"}],parametersDescription:[{anchor:"transformers.Trainer.evaluate.eval_dataset",description:`<strong>eval_dataset</strong> (<code>Dataset</code>, <em>optional</em>) &#x2014;
Pass a dataset if you wish to override <code>self.eval_dataset</code>. If it is a <a href="https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset" rel="nofollow">Dataset</a>, columns
not accepted by the <code>model.forward()</code> method are automatically removed. It must implement the <code>__len__</code>
method.`,name:"eval_dataset"},{anchor:"transformers.Trainer.evaluate.ignore_keys",description:`<strong>ignore_keys</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
A list of keys in the output of your model (if it is a dictionary) that should be ignored when
gathering predictions.`,name:"ignore_keys"},{anchor:"transformers.Trainer.evaluate.metric_key_prefix",description:`<strong>metric_key_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;eval&quot;</code>) &#x2014;
An optional prefix to be used as the metrics key prefix. For example the metrics &#x201C;bleu&#x201D; will be named
&#x201C;eval_bleu&#x201D; if the prefix is &#x201C;eval&#x201D; (default)`,name:"metric_key_prefix"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L2935",returnDescription:`
<p>A dictionary containing the evaluation loss and the potential metrics computed from the predictions. The
dictionary also contains the epoch number which comes from the training state.</p>
`}}),Cn=new S({props:{name:"evaluation_loop",anchor:"transformers.Trainer.evaluation_loop",parameters:[{name:"dataloader",val:": DataLoader"},{name:"description",val:": str"},{name:"prediction_loss_only",val:": typing.Optional[bool] = None"},{name:"ignore_keys",val:": typing.Optional[typing.List[str]] = None"},{name:"metric_key_prefix",val:": str = 'eval'"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L3068"}}),Fn=new S({props:{name:"floating_point_ops",anchor:"transformers.Trainer.floating_point_ops",parameters:[{name:"inputs",val:": typing.Dict[str, typing.Union[torch.Tensor, typing.Any]]"}],parametersDescription:[{anchor:"transformers.Trainer.floating_point_ops.inputs",description:`<strong>inputs</strong> (<code>Dict[str, Union[torch.Tensor, Any]]</code>) &#x2014;
The inputs and targets of the model.`,name:"inputs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L3404",returnDescription:`
<p>The number of floating-point operations.</p>
`,returnType:`
<p><code>int</code></p>
`}}),zn=new S({props:{name:"get_eval_dataloader",anchor:"transformers.Trainer.get_eval_dataloader",parameters:[{name:"eval_dataset",val:": typing.Optional[torch.utils.data.dataset.Dataset] = None"}],parametersDescription:[{anchor:"transformers.Trainer.get_eval_dataloader.eval_dataset",description:`<strong>eval_dataset</strong> (<code>torch.utils.data.Dataset</code>, <em>optional</em>) &#x2014;
If provided, will override <code>self.eval_dataset</code>. If it is a <a href="https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset" rel="nofollow">Dataset</a>, columns not accepted
by the <code>model.forward()</code> method are automatically removed. It must implement <code>__len__</code>.`,name:"eval_dataset"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L865"}}),Wn=new S({props:{name:"get_optimizer_cls_and_kwargs",anchor:"transformers.Trainer.get_optimizer_cls_and_kwargs",parameters:[{name:"args",val:": TrainingArguments"}],parametersDescription:[{anchor:"transformers.Trainer.get_optimizer_cls_and_kwargs.args",description:`<strong>args</strong> (<code>transformers.training_args.TrainingArguments</code>) &#x2014;
The training arguments for the training session.`,name:"args"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L1003"}}),Rn=new S({props:{name:"get_test_dataloader",anchor:"transformers.Trainer.get_test_dataloader",parameters:[{name:"test_dataset",val:": Dataset"}],parametersDescription:[{anchor:"transformers.Trainer.get_test_dataloader.test_dataset",description:`<strong>test_dataset</strong> (<code>torch.utils.data.Dataset</code>, <em>optional</em>) &#x2014;
The test dataset to use. If it is a <a href="https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset" rel="nofollow">Dataset</a>, columns not accepted by the
<code>model.forward()</code> method are automatically removed. It must implement <code>__len__</code>.`,name:"test_dataset"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L899"}}),Bn=new S({props:{name:"get_train_dataloader",anchor:"transformers.Trainer.get_train_dataloader",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L810"}}),Zn=new S({props:{name:"hyperparameter_search",anchor:"transformers.Trainer.hyperparameter_search",parameters:[{name:"hp_space",val:": typing.Union[typing.Callable[[ForwardRef('optuna.Trial')], typing.Dict[str, float]], NoneType] = None"},{name:"compute_objective",val:": typing.Union[typing.Callable[[typing.Dict[str, float]], float], NoneType] = None"},{name:"n_trials",val:": int = 20"},{name:"direction",val:": str = 'minimize'"},{name:"backend",val:": typing.Union[ForwardRef('str'), transformers.trainer_utils.HPSearchBackend, NoneType] = None"},{name:"hp_name",val:": typing.Union[typing.Callable[[ForwardRef('optuna.Trial')], str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Trainer.hyperparameter_search.hp_space",description:`<strong>hp_space</strong> (<code>Callable[[&quot;optuna.Trial&quot;], Dict[str, float]]</code>, <em>optional</em>) &#x2014;
A function that defines the hyperparameter search space. Will default to
<code>default_hp_space_optuna()</code> or <code>default_hp_space_ray()</code> or
<code>default_hp_space_sigopt()</code> depending on your backend.`,name:"hp_space"},{anchor:"transformers.Trainer.hyperparameter_search.compute_objective",description:`<strong>compute_objective</strong> (<code>Callable[[Dict[str, float]], float]</code>, <em>optional</em>) &#x2014;
A function computing the objective to minimize or maximize from the metrics returned by the <code>evaluate</code>
method. Will default to <code>default_compute_objective()</code>.`,name:"compute_objective"},{anchor:"transformers.Trainer.hyperparameter_search.n_trials",description:`<strong>n_trials</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of trial runs to test.`,name:"n_trials"},{anchor:"transformers.Trainer.hyperparameter_search.direction",description:`<strong>direction</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;minimize&quot;</code>) &#x2014;
Whether to optimize greater or lower objects. Can be <code>&quot;minimize&quot;</code> or <code>&quot;maximize&quot;</code>, you should pick
<code>&quot;minimize&quot;</code> when optimizing the validation loss, <code>&quot;maximize&quot;</code> when optimizing one or several metrics.`,name:"direction"},{anchor:"transformers.Trainer.hyperparameter_search.backend",description:`<strong>backend</strong> (<code>str</code> or <code>~training_utils.HPSearchBackend</code>, <em>optional</em>) &#x2014;
The backend to use for hyperparameter search. Will default to optuna or Ray Tune or SigOpt, depending
on which one is installed. If all are installed, will default to optuna.`,name:"backend"},{anchor:"transformers.Trainer.hyperparameter_search.hp_name",description:`<strong>hp_name</strong> (<code>Callable[[&quot;optuna.Trial&quot;], str]]</code>, <em>optional</em>) &#x2014;
A function that defines the trial/run name. Will default to None.`,name:"hp_name"},{anchor:"transformers.Trainer.hyperparameter_search.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments passed along to <code>optuna.create_study</code> or <code>ray.tune.run</code>. For more
information see:</p>
<ul>
<li>the documentation of
<a href="https://optuna.readthedocs.io/en/stable/reference/generated/optuna.study.create_study.html" rel="nofollow">optuna.create_study</a></li>
<li>the documentation of <a href="https://docs.ray.io/en/latest/tune/api_docs/execution.html#tune-run" rel="nofollow">tune.run</a></li>
<li>the documentation of <a href="https://app.sigopt.com/docs/endpoints/experiments/create" rel="nofollow">sigopt</a></li>
</ul>`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L2508",returnDescription:`
<p>All the information about the best run. Experiment summary can be found in
<code>run_summary</code> attribute for Ray backend.</p>
`,returnType:`
<p><code>trainer_utils.BestRun</code></p>
`}}),Mr=new ur({props:{warning:!0,$$slots:{default:[JL]},$$scope:{ctx:U}}}),Vn=new S({props:{name:"init_git_repo",anchor:"transformers.Trainer.init_git_repo",parameters:[{name:"at_init",val:": bool = False"}],parametersDescription:[{anchor:"transformers.Trainer.init_git_repo.at_init",description:`<strong>at_init</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether this function is called before any training or not. If <code>self.args.overwrite_output_dir</code> is
<code>True</code> and <code>at_init</code> is <code>True</code>, the path to the repo (which is <code>self.args.output_dir</code>) might be wiped
out.`,name:"at_init"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L3439"}}),Ir=new ur({props:{warning:!0,$$slots:{default:[CL]},$$scope:{ctx:U}}}),Yn=new S({props:{name:"init_hf_repo",anchor:"transformers.Trainer.init_hf_repo",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L3422"}}),Qn=new S({props:{name:"is_local_process_zero",anchor:"transformers.Trainer.is_local_process_zero",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L2733"}}),Kn=new S({props:{name:"is_world_process_zero",anchor:"transformers.Trainer.is_world_process_zero",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L2740"}}),ts=new S({props:{name:"log",anchor:"transformers.Trainer.log",parameters:[{name:"logs",val:": typing.Dict[str, float]"}],parametersDescription:[{anchor:"transformers.Trainer.log.logs",description:`<strong>logs</strong> (<code>Dict[str, float]</code>) &#x2014;
The values to log.`,name:"logs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L2583"}}),rs=new S({props:{name:"log_metrics",anchor:"transformers.Trainer.log_metrics",parameters:[{name:"split",val:""},{name:"metrics",val:""}],parametersDescription:[{anchor:"transformers.Trainer.log_metrics.split",description:`<strong>split</strong> (<code>str</code>) &#x2014;
Mode/split name: one of <code>train</code>, <code>eval</code>, <code>test</code>`,name:"split"},{anchor:"transformers.Trainer.log_metrics.metrics",description:`<strong>metrics</strong> (<code>Dict[str, float]</code>) &#x2014;
The metrics returned from train/evaluate/predictmetrics: metrics dict`,name:"metrics"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_pt_utils.py#L898"}}),Dr=new _o({props:{anchor:"transformers.Trainer.log_metrics.example",$$slots:{default:[FL]},$$scope:{ctx:U}}}),ss=new S({props:{name:"metrics_format",anchor:"transformers.Trainer.metrics_format",parameters:[{name:"metrics",val:": typing.Dict[str, float]"}],parametersDescription:[{anchor:"transformers.Trainer.metrics_format.metrics",description:`<strong>metrics</strong> (<code>Dict[str, float]</code>) &#x2014;
The metrics returned from train/evaluate/predict`,name:"metrics"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_pt_utils.py#L872",returnDescription:`
<p>The reformatted metrics</p>
`,returnType:`
<p>metrics (<code>Dict[str, float]</code>)</p>
`}}),is=new S({props:{name:"num_examples",anchor:"transformers.Trainer.num_examples",parameters:[{name:"dataloader",val:": DataLoader"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L1143"}}),ds=new S({props:{name:"pop_callback",anchor:"transformers.Trainer.pop_callback",parameters:[{name:"callback",val:""}],parametersDescription:[{anchor:"transformers.Trainer.pop_callback.callback",description:`<strong>callback</strong> (<code>type</code> or <code>~transformer.TrainerCallback</code>) &#x2014;
A <code>~transformer.TrainerCallback</code> class or an instance of a <code>~transformer.TrainerCallback</code>. In the
first case, will pop the first member of that class found in the list of callbacks.`,name:"callback"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L700",returnDescription:`
<p>The callback removed, if found.</p>
`,returnType:`
<p><code>~transformer.TrainerCallback</code></p>
`}}),ms=new S({props:{name:"predict",anchor:"transformers.Trainer.predict",parameters:[{name:"test_dataset",val:": Dataset"},{name:"ignore_keys",val:": typing.Optional[typing.List[str]] = None"},{name:"metric_key_prefix",val:": str = 'test'"}],parametersDescription:[{anchor:"transformers.Trainer.predict.test_dataset",description:`<strong>test_dataset</strong> (<code>Dataset</code>) &#x2014;
Dataset to run the predictions on. If it is an <code>datasets.Dataset</code>, columns not accepted by the
<code>model.forward()</code> method are automatically removed. Has to implement the method <code>__len__</code>`,name:"test_dataset"},{anchor:"transformers.Trainer.predict.ignore_keys",description:`<strong>ignore_keys</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
A list of keys in the output of your model (if it is a dictionary) that should be ignored when
gathering predictions.`,name:"ignore_keys"},{anchor:"transformers.Trainer.predict.metric_key_prefix",description:`<strong>metric_key_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;test&quot;</code>) &#x2014;
An optional prefix to be used as the metrics key prefix. For example the metrics &#x201C;bleu&#x201D; will be named
&#x201C;test_bleu&#x201D; if the prefix is &#x201C;test&#x201D; (default)`,name:"metric_key_prefix"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L3006"}}),Jr=new ur({props:{$$slots:{default:[NL]},$$scope:{ctx:U}}}),fs=new S({props:{name:"prediction_loop",anchor:"transformers.Trainer.prediction_loop",parameters:[{name:"dataloader",val:": DataLoader"},{name:"description",val:": str"},{name:"prediction_loss_only",val:": typing.Optional[bool] = None"},{name:"ignore_keys",val:": typing.Optional[typing.List[str]] = None"},{name:"metric_key_prefix",val:": str = 'eval'"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L3669"}}),gs=new S({props:{name:"prediction_step",anchor:"transformers.Trainer.prediction_step",parameters:[{name:"model",val:": Module"},{name:"inputs",val:": typing.Dict[str, typing.Union[torch.Tensor, typing.Any]]"},{name:"prediction_loss_only",val:": bool"},{name:"ignore_keys",val:": typing.Optional[typing.List[str]] = None"}],parametersDescription:[{anchor:"transformers.Trainer.prediction_step.model",description:`<strong>model</strong> (<code>nn.Module</code>) &#x2014;
The model to evaluate.`,name:"model"},{anchor:"transformers.Trainer.prediction_step.inputs",description:`<strong>inputs</strong> (<code>Dict[str, Union[torch.Tensor, Any]]</code>) &#x2014;
The inputs and targets of the model.</p>
<p>The dictionary will be unpacked before being fed to the model. Most models expect the targets under the
argument <code>labels</code>. Check your model&#x2019;s documentation for all accepted arguments.`,name:"inputs"},{anchor:"transformers.Trainer.prediction_step.prediction_loss_only",description:`<strong>prediction_loss_only</strong> (<code>bool</code>) &#x2014;
Whether or not to return the loss only.`,name:"prediction_loss_only"},{anchor:"transformers.Trainer.prediction_step.ignore_keys",description:`<strong>ignore_keys</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
A list of keys in the output of your model (if it is a dictionary) that should be ignored when
gathering predictions.`,name:"ignore_keys"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L3299",returnDescription:`
<p>A tuple with the loss,
logits and labels (each being optional).</p>
`,returnType:`
<p>Tuple[Optional[torch.Tensor], Optional[torch.Tensor], Optional[torch.Tensor]]</p>
`}}),_s=new S({props:{name:"push_to_hub",anchor:"transformers.Trainer.push_to_hub",parameters:[{name:"commit_message",val:": typing.Optional[str] = 'End of training'"},{name:"blocking",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Trainer.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;End of training&quot;</code>) &#x2014;
Message to commit while pushing.`,name:"commit_message"},{anchor:"transformers.Trainer.push_to_hub.blocking",description:`<strong>blocking</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the function should return only when the <code>git push</code> has finished.`,name:"blocking"},{anchor:"transformers.Trainer.push_to_hub.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments passed along to <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer.create_model_card">create_model_card()</a>.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L3616",returnDescription:`
<p>The URL of the repository where the model was pushed if <code>blocking=False</code>, or a <code>Future</code> object tracking the
progress of the commit if <code>blocking=True</code>.</p>
`}}),bs=new S({props:{name:"remove_callback",anchor:"transformers.Trainer.remove_callback",parameters:[{name:"callback",val:""}],parametersDescription:[{anchor:"transformers.Trainer.remove_callback.callback",description:`<strong>callback</strong> (<code>type</code> or <code>~transformer.TrainerCallback</code>) &#x2014;
A <code>~transformer.TrainerCallback</code> class or an instance of a <code>~transformer.TrainerCallback</code>. In the
first case, will remove the first member of that class found in the list of callbacks.`,name:"callback"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L716"}}),ys=new S({props:{name:"save_metrics",anchor:"transformers.Trainer.save_metrics",parameters:[{name:"split",val:""},{name:"metrics",val:""},{name:"combined",val:" = True"}],parametersDescription:[{anchor:"transformers.Trainer.save_metrics.split",description:`<strong>split</strong> (<code>str</code>) &#x2014;
Mode/split name: one of <code>train</code>, <code>eval</code>, <code>test</code>, <code>all</code>`,name:"split"},{anchor:"transformers.Trainer.save_metrics.metrics",description:`<strong>metrics</strong> (<code>Dict[str, float]</code>) &#x2014;
The metrics returned from train/evaluate/predict`,name:"metrics"},{anchor:"transformers.Trainer.save_metrics.combined",description:`<strong>combined</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Creates combined metrics by updating <code>all_results.json</code> with metrics of this call`,name:"combined"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_pt_utils.py#L988"}}),Es=new S({props:{name:"save_model",anchor:"transformers.Trainer.save_model",parameters:[{name:"output_dir",val:": typing.Optional[str] = None"},{name:"_internal_call",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L2752"}}),$s=new S({props:{name:"save_state",anchor:"transformers.Trainer.save_state",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_pt_utils.py#L1026"}}),ks=new S({props:{name:"train",anchor:"transformers.Trainer.train",parameters:[{name:"resume_from_checkpoint",val:": typing.Union[bool, str, NoneType] = None"},{name:"trial",val:": typing.Union[ForwardRef('optuna.Trial'), typing.Dict[str, typing.Any]] = None"},{name:"ignore_keys_for_eval",val:": typing.Optional[typing.List[str]] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Trainer.train.resume_from_checkpoint",description:`<strong>resume_from_checkpoint</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
If a <code>str</code>, local path to a saved checkpoint as saved by a previous instance of <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>. If a
<code>bool</code> and equals <code>True</code>, load the last checkpoint in <em>args.output_dir</em> as saved by a previous instance
of <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>. If present, training will resume from the model/optimizer/scheduler states loaded here.`,name:"resume_from_checkpoint"},{anchor:"transformers.Trainer.train.trial",description:`<strong>trial</strong> (<code>optuna.Trial</code> or <code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
The trial run or the hyperparameter dictionary for hyperparameter search.`,name:"trial"},{anchor:"transformers.Trainer.train.ignore_keys_for_eval",description:`<strong>ignore_keys_for_eval</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
A list of keys in the output of your model (if it is a dictionary) that should be ignored when
gathering predictions for evaluation during the training.`,name:"ignore_keys_for_eval"},{anchor:"transformers.Trainer.train.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments used to hide deprecated arguments`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L1458"}}),xs=new S({props:{name:"training_step",anchor:"transformers.Trainer.training_step",parameters:[{name:"model",val:": Module"},{name:"inputs",val:": typing.Dict[str, typing.Union[torch.Tensor, typing.Any]]"}],parametersDescription:[{anchor:"transformers.Trainer.training_step.model",description:`<strong>model</strong> (<code>nn.Module</code>) &#x2014;
The model to train.`,name:"model"},{anchor:"transformers.Trainer.training_step.inputs",description:`<strong>inputs</strong> (<code>Dict[str, Union[torch.Tensor, Any]]</code>) &#x2014;
The inputs and targets of the model.</p>
<p>The dictionary will be unpacked before being fed to the model. Most models expect the targets under the
argument <code>labels</code>. Check your model&#x2019;s documentation for all accepted arguments.`,name:"inputs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer.py#L2656",returnDescription:`
<p>The tensor with training loss on this batch.</p>
`,returnType:`
<p><code>torch.Tensor</code></p>
`}}),Ms=new oe({}),Is=new S({props:{name:"class transformers.Seq2SeqTrainer",anchor:"transformers.Seq2SeqTrainer",parameters:[{name:"model",val:": typing.Union[ForwardRef('PreTrainedModel'), torch.nn.modules.module.Module] = None"},{name:"args",val:": TrainingArguments = None"},{name:"data_collator",val:": typing.Optional[ForwardRef('DataCollator')] = None"},{name:"train_dataset",val:": typing.Optional[torch.utils.data.dataset.Dataset] = None"},{name:"eval_dataset",val:": typing.Union[torch.utils.data.dataset.Dataset, typing.Dict[str, torch.utils.data.dataset.Dataset], NoneType] = None"},{name:"tokenizer",val:": typing.Optional[ForwardRef('PreTrainedTokenizerBase')] = None"},{name:"model_init",val:": typing.Union[typing.Callable[[], ForwardRef('PreTrainedModel')], NoneType] = None"},{name:"compute_metrics",val:": typing.Union[typing.Callable[[ForwardRef('EvalPrediction')], typing.Dict], NoneType] = None"},{name:"callbacks",val:": typing.Optional[typing.List[ForwardRef('TrainerCallback')]] = None"},{name:"optimizers",val:": typing.Tuple[torch.optim.optimizer.Optimizer, torch.optim.lr_scheduler.LambdaLR] = (None, None)"},{name:"preprocess_logits_for_metrics",val:": typing.Union[typing.Callable[[torch.Tensor, torch.Tensor], torch.Tensor], NoneType] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_seq2seq.py#L41"}}),Ss=new S({props:{name:"evaluate",anchor:"transformers.Seq2SeqTrainer.evaluate",parameters:[{name:"eval_dataset",val:": typing.Optional[torch.utils.data.dataset.Dataset] = None"},{name:"ignore_keys",val:": typing.Optional[typing.List[str]] = None"},{name:"metric_key_prefix",val:": str = 'eval'"},{name:"**gen_kwargs",val:""}],parametersDescription:[{anchor:"transformers.Seq2SeqTrainer.evaluate.eval_dataset",description:`<strong>eval_dataset</strong> (<code>Dataset</code>, <em>optional</em>) &#x2014;
Pass a dataset if you wish to override <code>self.eval_dataset</code>. If it is an <a href="https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset" rel="nofollow">Dataset</a>, columns
not accepted by the <code>model.forward()</code> method are automatically removed. It must implement the <code>__len__</code>
method.`,name:"eval_dataset"},{anchor:"transformers.Seq2SeqTrainer.evaluate.ignore_keys",description:`<strong>ignore_keys</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
A list of keys in the output of your model (if it is a dictionary) that should be ignored when
gathering predictions.`,name:"ignore_keys"},{anchor:"transformers.Seq2SeqTrainer.evaluate.metric_key_prefix",description:`<strong>metric_key_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;eval&quot;</code>) &#x2014;
An optional prefix to be used as the metrics key prefix. For example the metrics &#x201C;bleu&#x201D; will be named
&#x201C;eval_bleu&#x201D; if the prefix is <code>&quot;eval&quot;</code> (default)`,name:"metric_key_prefix"},{anchor:"transformers.Seq2SeqTrainer.evaluate.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum target length to use when predicting with the generate method.`,name:"max_length"},{anchor:"transformers.Seq2SeqTrainer.evaluate.num_beams",description:`<strong>num_beams</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of beams for beam search that will be used when predicting with the generate method. 1 means no
beam search.
gen_kwargs &#x2014;
Additional <code>generate</code> specific kwargs.`,name:"num_beams"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_seq2seq.py#L112",returnDescription:`
<p>A dictionary containing the evaluation loss and the potential metrics computed from the predictions. The
dictionary also contains the epoch number which comes from the training state.</p>
`}}),Us=new S({props:{name:"predict",anchor:"transformers.Seq2SeqTrainer.predict",parameters:[{name:"test_dataset",val:": Dataset"},{name:"ignore_keys",val:": typing.Optional[typing.List[str]] = None"},{name:"metric_key_prefix",val:": str = 'test'"},{name:"**gen_kwargs",val:""}],parametersDescription:[{anchor:"transformers.Seq2SeqTrainer.predict.test_dataset",description:`<strong>test_dataset</strong> (<code>Dataset</code>) &#x2014;
Dataset to run the predictions on. If it is a <a href="https://huggingface.co/docs/datasets/v2.14.4/en/package_reference/main_classes#datasets.Dataset" rel="nofollow">Dataset</a>, columns not accepted by the
<code>model.forward()</code> method are automatically removed. Has to implement the method <code>__len__</code>`,name:"test_dataset"},{anchor:"transformers.Seq2SeqTrainer.predict.ignore_keys",description:`<strong>ignore_keys</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
A list of keys in the output of your model (if it is a dictionary) that should be ignored when
gathering predictions.`,name:"ignore_keys"},{anchor:"transformers.Seq2SeqTrainer.predict.metric_key_prefix",description:`<strong>metric_key_prefix</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;eval&quot;</code>) &#x2014;
An optional prefix to be used as the metrics key prefix. For example the metrics &#x201C;bleu&#x201D; will be named
&#x201C;eval_bleu&#x201D; if the prefix is <code>&quot;eval&quot;</code> (default)`,name:"metric_key_prefix"},{anchor:"transformers.Seq2SeqTrainer.predict.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum target length to use when predicting with the generate method.`,name:"max_length"},{anchor:"transformers.Seq2SeqTrainer.predict.num_beams",description:`<strong>num_beams</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of beams for beam search that will be used when predicting with the generate method. 1 means no
beam search.
gen_kwargs &#x2014;
Additional <code>generate</code> specific kwargs.`,name:"num_beams"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_seq2seq.py#L161"}}),Or=new ur({props:{$$slots:{default:[zL]},$$scope:{ctx:U}}}),Ps=new oe({}),Js=new S({props:{name:"class transformers.TrainingArguments",anchor:"transformers.TrainingArguments",parameters:[{name:"output_dir",val:": str"},{name:"overwrite_output_dir",val:": bool = False"},{name:"do_train",val:": bool = False"},{name:"do_eval",val:": bool = False"},{name:"do_predict",val:": bool = False"},{name:"evaluation_strategy",val:": typing.Union[transformers.trainer_utils.IntervalStrategy, str] = 'no'"},{name:"prediction_loss_only",val:": bool = False"},{name:"per_device_train_batch_size",val:": int = 8"},{name:"per_device_eval_batch_size",val:": int = 8"},{name:"per_gpu_train_batch_size",val:": typing.Optional[int] = None"},{name:"per_gpu_eval_batch_size",val:": typing.Optional[int] = None"},{name:"gradient_accumulation_steps",val:": int = 1"},{name:"eval_accumulation_steps",val:": typing.Optional[int] = None"},{name:"eval_delay",val:": typing.Optional[float] = 0"},{name:"learning_rate",val:": float = 5e-05"},{name:"weight_decay",val:": float = 0.0"},{name:"adam_beta1",val:": float = 0.9"},{name:"adam_beta2",val:": float = 0.999"},{name:"adam_epsilon",val:": float = 1e-08"},{name:"max_grad_norm",val:": float = 1.0"},{name:"num_train_epochs",val:": float = 3.0"},{name:"max_steps",val:": int = -1"},{name:"lr_scheduler_type",val:": typing.Union[transformers.trainer_utils.SchedulerType, str] = 'linear'"},{name:"warmup_ratio",val:": float = 0.0"},{name:"warmup_steps",val:": int = 0"},{name:"log_level",val:": typing.Optional[str] = 'passive'"},{name:"log_level_replica",val:": typing.Optional[str] = 'warning'"},{name:"log_on_each_node",val:": bool = True"},{name:"logging_dir",val:": typing.Optional[str] = None"},{name:"logging_strategy",val:": typing.Union[transformers.trainer_utils.IntervalStrategy, str] = 'steps'"},{name:"logging_first_step",val:": bool = False"},{name:"logging_steps",val:": float = 500"},{name:"logging_nan_inf_filter",val:": bool = True"},{name:"save_strategy",val:": typing.Union[transformers.trainer_utils.IntervalStrategy, str] = 'steps'"},{name:"save_steps",val:": float = 500"},{name:"save_total_limit",val:": typing.Optional[int] = None"},{name:"save_safetensors",val:": typing.Optional[bool] = False"},{name:"save_on_each_node",val:": bool = False"},{name:"no_cuda",val:": bool = False"},{name:"use_cpu",val:": bool = False"},{name:"use_mps_device",val:": bool = False"},{name:"seed",val:": int = 42"},{name:"data_seed",val:": typing.Optional[int] = None"},{name:"jit_mode_eval",val:": bool = False"},{name:"use_ipex",val:": bool = False"},{name:"bf16",val:": bool = False"},{name:"fp16",val:": bool = False"},{name:"fp16_opt_level",val:": str = 'O1'"},{name:"half_precision_backend",val:": str = 'auto'"},{name:"bf16_full_eval",val:": bool = False"},{name:"fp16_full_eval",val:": bool = False"},{name:"tf32",val:": typing.Optional[bool] = None"},{name:"local_rank",val:": int = -1"},{name:"ddp_backend",val:": typing.Optional[str] = None"},{name:"tpu_num_cores",val:": typing.Optional[int] = None"},{name:"tpu_metrics_debug",val:": bool = False"},{name:"debug",val:": typing.Union[str, typing.List[transformers.debug_utils.DebugOption]] = ''"},{name:"dataloader_drop_last",val:": bool = False"},{name:"eval_steps",val:": typing.Optional[float] = None"},{name:"dataloader_num_workers",val:": int = 0"},{name:"past_index",val:": int = -1"},{name:"run_name",val:": typing.Optional[str] = None"},{name:"disable_tqdm",val:": typing.Optional[bool] = None"},{name:"remove_unused_columns",val:": typing.Optional[bool] = True"},{name:"label_names",val:": typing.Optional[typing.List[str]] = None"},{name:"load_best_model_at_end",val:": typing.Optional[bool] = False"},{name:"metric_for_best_model",val:": typing.Optional[str] = None"},{name:"greater_is_better",val:": typing.Optional[bool] = None"},{name:"ignore_data_skip",val:": bool = False"},{name:"sharded_ddp",val:": typing.Union[typing.List[transformers.trainer_utils.ShardedDDPOption], str, NoneType] = ''"},{name:"fsdp",val:": typing.Union[typing.List[transformers.trainer_utils.FSDPOption], str, NoneType] = ''"},{name:"fsdp_min_num_params",val:": int = 0"},{name:"fsdp_config",val:": typing.Optional[str] = None"},{name:"fsdp_transformer_layer_cls_to_wrap",val:": typing.Optional[str] = None"},{name:"deepspeed",val:": typing.Optional[str] = None"},{name:"label_smoothing_factor",val:": float = 0.0"},{name:"optim",val:": typing.Union[transformers.training_args.OptimizerNames, str] = 'adamw_torch'"},{name:"optim_args",val:": typing.Optional[str] = None"},{name:"adafactor",val:": bool = False"},{name:"group_by_length",val:": bool = False"},{name:"length_column_name",val:": typing.Optional[str] = 'length'"},{name:"report_to",val:": typing.Optional[typing.List[str]] = None"},{name:"ddp_find_unused_parameters",val:": typing.Optional[bool] = None"},{name:"ddp_bucket_cap_mb",val:": typing.Optional[int] = None"},{name:"ddp_broadcast_buffers",val:": typing.Optional[bool] = None"},{name:"dataloader_pin_memory",val:": bool = True"},{name:"skip_memory_metrics",val:": bool = True"},{name:"use_legacy_prediction_loop",val:": bool = False"},{name:"push_to_hub",val:": bool = False"},{name:"resume_from_checkpoint",val:": typing.Optional[str] = None"},{name:"hub_model_id",val:": typing.Optional[str] = None"},{name:"hub_strategy",val:": typing.Union[transformers.trainer_utils.HubStrategy, str] = 'every_save'"},{name:"hub_token",val:": typing.Optional[str] = None"},{name:"hub_private_repo",val:": bool = False"},{name:"hub_always_push",val:": bool = False"},{name:"gradient_checkpointing",val:": bool = False"},{name:"include_inputs_for_metrics",val:": bool = False"},{name:"fp16_backend",val:": str = 'auto'"},{name:"push_to_hub_model_id",val:": typing.Optional[str] = None"},{name:"push_to_hub_organization",val:": typing.Optional[str] = None"},{name:"push_to_hub_token",val:": typing.Optional[str] = None"},{name:"mp_parameters",val:": str = ''"},{name:"auto_find_batch_size",val:": bool = False"},{name:"full_determinism",val:": bool = False"},{name:"torchdynamo",val:": typing.Optional[str] = None"},{name:"ray_scope",val:": typing.Optional[str] = 'last'"},{name:"ddp_timeout",val:": typing.Optional[int] = 1800"},{name:"torch_compile",val:": bool = False"},{name:"torch_compile_backend",val:": typing.Optional[str] = None"},{name:"torch_compile_mode",val:": typing.Optional[str] = None"},{name:"dispatch_batches",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.TrainingArguments.output_dir",description:`<strong>output_dir</strong> (<code>str</code>) &#x2014;
The output directory where the model predictions and checkpoints will be written.`,name:"output_dir"},{anchor:"transformers.TrainingArguments.overwrite_output_dir",description:`<strong>overwrite_output_dir</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, overwrite the content of the output directory. Use this to continue training if <code>output_dir</code>
points to a checkpoint directory.`,name:"overwrite_output_dir"},{anchor:"transformers.TrainingArguments.do_train",description:`<strong>do_train</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to run training or not. This argument is not directly used by <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>, it&#x2019;s intended to be used
by your training/evaluation scripts instead. See the <a href="https://github.com/huggingface/transformers/tree/main/examples" rel="nofollow">example
scripts</a> for more details.`,name:"do_train"},{anchor:"transformers.TrainingArguments.do_eval",description:`<strong>do_eval</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to run evaluation on the validation set or not. Will be set to <code>True</code> if <code>evaluation_strategy</code> is
different from <code>&quot;no&quot;</code>. This argument is not directly used by <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>, it&#x2019;s intended to be used by your
training/evaluation scripts instead. See the <a href="https://github.com/huggingface/transformers/tree/main/examples" rel="nofollow">example
scripts</a> for more details.`,name:"do_eval"},{anchor:"transformers.TrainingArguments.do_predict",description:`<strong>do_predict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to run predictions on the test set or not. This argument is not directly used by <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>, it&#x2019;s
intended to be used by your training/evaluation scripts instead. See the <a href="https://github.com/huggingface/transformers/tree/main/examples" rel="nofollow">example
scripts</a> for more details.`,name:"do_predict"},{anchor:"transformers.TrainingArguments.evaluation_strategy",description:`<strong>evaluation_strategy</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.IntervalStrategy">IntervalStrategy</a>, <em>optional</em>, defaults to <code>&quot;no&quot;</code>) &#x2014;
The evaluation strategy to adopt during training. Possible values are:</p>
<ul>
<li><code>&quot;no&quot;</code>: No evaluation is done during training.</li>
<li><code>&quot;steps&quot;</code>: Evaluation is done (and logged) every <code>eval_steps</code>.</li>
<li><code>&quot;epoch&quot;</code>: Evaluation is done at the end of each epoch.</li>
</ul>`,name:"evaluation_strategy"},{anchor:"transformers.TrainingArguments.prediction_loss_only",description:`<strong>prediction_loss_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
When performing evaluation and generating predictions, only returns the loss.`,name:"prediction_loss_only"},{anchor:"transformers.TrainingArguments.per_device_train_batch_size",description:`<strong>per_device_train_batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
The batch size per GPU/TPU/MPS/NPU core/CPU for training.`,name:"per_device_train_batch_size"},{anchor:"transformers.TrainingArguments.per_device_eval_batch_size",description:`<strong>per_device_eval_batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
The batch size per GPU/TPU/MPS/NPU core/CPU for evaluation.`,name:"per_device_eval_batch_size"},{anchor:"transformers.TrainingArguments.gradient_accumulation_steps",description:`<strong>gradient_accumulation_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of updates steps to accumulate the gradients for, before performing a backward/update pass.</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>When using gradient accumulation, one step is counted as one step with backward pass. Therefore, logging,
evaluation, save will be conducted every <code>gradient_accumulation_steps * xxx_step</code> training examples.</p>

					</div>`,name:"gradient_accumulation_steps"},{anchor:"transformers.TrainingArguments.eval_accumulation_steps",description:`<strong>eval_accumulation_steps</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of predictions steps to accumulate the output tensors for, before moving the results to the CPU. If
left unset, the whole predictions are accumulated on GPU/TPU before being moved to the CPU (faster but
requires more memory).`,name:"eval_accumulation_steps"},{anchor:"transformers.TrainingArguments.eval_delay",description:`<strong>eval_delay</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Number of epochs or steps to wait for before the first evaluation can be performed, depending on the
evaluation_strategy.`,name:"eval_delay"},{anchor:"transformers.TrainingArguments.learning_rate",description:`<strong>learning_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 5e-5) &#x2014;
The initial learning rate for <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.AdamW">AdamW</a> optimizer.`,name:"learning_rate"},{anchor:"transformers.TrainingArguments.weight_decay",description:`<strong>weight_decay</strong> (<code>float</code>, <em>optional</em>, defaults to 0) &#x2014;
The weight decay to apply (if not zero) to all layers except all bias and LayerNorm weights in <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.AdamW">AdamW</a>
optimizer.`,name:"weight_decay"},{anchor:"transformers.TrainingArguments.adam_beta1",description:`<strong>adam_beta1</strong> (<code>float</code>, <em>optional</em>, defaults to 0.9) &#x2014;
The beta1 hyperparameter for the <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.AdamW">AdamW</a> optimizer.`,name:"adam_beta1"},{anchor:"transformers.TrainingArguments.adam_beta2",description:`<strong>adam_beta2</strong> (<code>float</code>, <em>optional</em>, defaults to 0.999) &#x2014;
The beta2 hyperparameter for the <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.AdamW">AdamW</a> optimizer.`,name:"adam_beta2"},{anchor:"transformers.TrainingArguments.adam_epsilon",description:`<strong>adam_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-8) &#x2014;
The epsilon hyperparameter for the <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.AdamW">AdamW</a> optimizer.`,name:"adam_epsilon"},{anchor:"transformers.TrainingArguments.max_grad_norm",description:`<strong>max_grad_norm</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Maximum gradient norm (for gradient clipping).`,name:"max_grad_norm"},{anchor:"transformers.TrainingArguments.num_train_epochs(float,",description:`<strong>num_train_epochs(<code>float</code>,</strong> <em>optional</em>, defaults to 3.0) &#x2014;
Total number of training epochs to perform (if not an integer, will perform the decimal part percents of
the last epoch before stopping training).`,name:"num_train_epochs(float,"},{anchor:"transformers.TrainingArguments.max_steps",description:`<strong>max_steps</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
If set to a positive number, the total number of training steps to perform. Overrides <code>num_train_epochs</code>.
In case of using a finite iterable dataset the training may stop before reaching the set number of steps
when all data is exhausted`,name:"max_steps"},{anchor:"transformers.TrainingArguments.lr_scheduler_type",description:`<strong>lr_scheduler_type</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.SchedulerType">SchedulerType</a>, <em>optional</em>, defaults to <code>&quot;linear&quot;</code>) &#x2014;
The scheduler type to use. See the documentation of <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.SchedulerType">SchedulerType</a> for all possible values.`,name:"lr_scheduler_type"},{anchor:"transformers.TrainingArguments.warmup_ratio",description:`<strong>warmup_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Ratio of total training steps used for a linear warmup from 0 to <code>learning_rate</code>.`,name:"warmup_ratio"},{anchor:"transformers.TrainingArguments.warmup_steps",description:`<strong>warmup_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Number of steps used for a linear warmup from 0 to <code>learning_rate</code>. Overrides any effect of <code>warmup_ratio</code>.`,name:"warmup_steps"},{anchor:"transformers.TrainingArguments.log_level",description:`<strong>log_level</strong> (<code>str</code>, <em>optional</em>, defaults to <code>passive</code>) &#x2014;
Logger log level to use on the main process. Possible choices are the log levels as strings: &#x2018;debug&#x2019;,
&#x2018;info&#x2019;, &#x2018;warning&#x2019;, &#x2018;error&#x2019; and &#x2018;critical&#x2019;, plus a &#x2018;passive&#x2019; level which doesn&#x2019;t set anything and keeps the
current log level for the Transformers library (which will be <code>&quot;warning&quot;</code> by default).`,name:"log_level"},{anchor:"transformers.TrainingArguments.log_level_replica",description:`<strong>log_level_replica</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;warning&quot;</code>) &#x2014;
Logger log level to use on replicas. Same choices as <code>log_level</code>&#x201D;`,name:"log_level_replica"},{anchor:"transformers.TrainingArguments.log_on_each_node",description:`<strong>log_on_each_node</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
In multinode distributed training, whether to log using <code>log_level</code> once per node, or only on the main
node.`,name:"log_on_each_node"},{anchor:"transformers.TrainingArguments.logging_dir",description:`<strong>logging_dir</strong> (<code>str</code>, <em>optional</em>) &#x2014;
<a href="https://www.tensorflow.org/tensorboard" rel="nofollow">TensorBoard</a> log directory. Will default to
*output_dir/runs/<strong>CURRENT_DATETIME_HOSTNAME*</strong>.`,name:"logging_dir"},{anchor:"transformers.TrainingArguments.logging_strategy",description:`<strong>logging_strategy</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.IntervalStrategy">IntervalStrategy</a>, <em>optional</em>, defaults to <code>&quot;steps&quot;</code>) &#x2014;
The logging strategy to adopt during training. Possible values are:</p>
<ul>
<li><code>&quot;no&quot;</code>: No logging is done during training.</li>
<li><code>&quot;epoch&quot;</code>: Logging is done at the end of each epoch.</li>
<li><code>&quot;steps&quot;</code>: Logging is done every <code>logging_steps</code>.</li>
</ul>`,name:"logging_strategy"},{anchor:"transformers.TrainingArguments.logging_first_step",description:`<strong>logging_first_step</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to log and evaluate the first <code>global_step</code> or not.`,name:"logging_first_step"},{anchor:"transformers.TrainingArguments.logging_steps",description:`<strong>logging_steps</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to 500) &#x2014;
Number of update steps between two logs if <code>logging_strategy=&quot;steps&quot;</code>. Should be an integer or a float in
range <code>[0,1)</code>. If smaller than 1, will be interpreted as ratio of total training steps.`,name:"logging_steps"},{anchor:"transformers.TrainingArguments.logging_nan_inf_filter",description:`<strong>logging_nan_inf_filter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to filter <code>nan</code> and <code>inf</code> losses for logging. If set to <code>True</code> the loss of every step that is <code>nan</code>
or <code>inf</code> is filtered and the average loss of the current logging window is taken instead.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p><code>logging_nan_inf_filter</code> only influences the logging of loss values, it does not change the behavior the
gradient is computed or applied to the model.</p>

					</div>`,name:"logging_nan_inf_filter"},{anchor:"transformers.TrainingArguments.save_strategy",description:`<strong>save_strategy</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.IntervalStrategy">IntervalStrategy</a>, <em>optional</em>, defaults to <code>&quot;steps&quot;</code>) &#x2014;
The checkpoint save strategy to adopt during training. Possible values are:</p>
<ul>
<li><code>&quot;no&quot;</code>: No save is done during training.</li>
<li><code>&quot;epoch&quot;</code>: Save is done at the end of each epoch.</li>
<li><code>&quot;steps&quot;</code>: Save is done every <code>save_steps</code>.</li>
</ul>`,name:"save_strategy"},{anchor:"transformers.TrainingArguments.save_steps",description:`<strong>save_steps</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to 500) &#x2014;
Number of updates steps before two checkpoint saves if <code>save_strategy=&quot;steps&quot;</code>. Should be an integer or a
float in range <code>[0,1)</code>. If smaller than 1, will be interpreted as ratio of total training steps.`,name:"save_steps"},{anchor:"transformers.TrainingArguments.save_total_limit",description:`<strong>save_total_limit</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a value is passed, will limit the total amount of checkpoints. Deletes the older checkpoints in
<code>output_dir</code>. When <code>load_best_model_at_end</code> is enabled, the &#x201C;best&#x201D; checkpoint according to
<code>metric_for_best_model</code> will always be retained in addition to the most recent ones. For example, for
<code>save_total_limit=5</code> and <code>load_best_model_at_end</code>, the four last checkpoints will always be retained
alongside the best model. When <code>save_total_limit=1</code> and <code>load_best_model_at_end</code>, it is possible that two
checkpoints are saved: the last one and the best one (if they are different).`,name:"save_total_limit"},{anchor:"transformers.TrainingArguments.save_safetensors",description:`<strong>save_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Use <a href="https://huggingface.co/docs/safetensors" rel="nofollow">safetensors</a> saving and loading for state dicts instead of
default <code>torch.load</code> and <code>torch.save</code>.`,name:"save_safetensors"},{anchor:"transformers.TrainingArguments.save_on_each_node",description:`<strong>save_on_each_node</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
When doing multi-node distributed training, whether to save models and checkpoints on each node, or only on
the main one.</p>
<p>This should not be activated when the different nodes use the same storage as the files will be saved with
the same names for each node.`,name:"save_on_each_node"},{anchor:"transformers.TrainingArguments.use_cpu",description:`<strong>use_cpu</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use cpu. If set to False, we will use cuda or mps device if available.`,name:"use_cpu"},{anchor:"transformers.TrainingArguments.seed",description:`<strong>seed</strong> (<code>int</code>, <em>optional</em>, defaults to 42) &#x2014;
Random seed that will be set at the beginning of training. To ensure reproducibility across runs, use the
<code>~Trainer.model_init</code> function to instantiate the model if it has some randomly initialized parameters.`,name:"seed"},{anchor:"transformers.TrainingArguments.data_seed",description:`<strong>data_seed</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Random seed to be used with data samplers. If not set, random generators for data sampling will use the
same seed as <code>seed</code>. This can be used to ensure reproducibility of data sampling, independent of the model
seed.`,name:"data_seed"},{anchor:"transformers.TrainingArguments.jit_mode_eval",description:`<strong>jit_mode_eval</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use PyTorch jit trace for inference.`,name:"jit_mode_eval"},{anchor:"transformers.TrainingArguments.use_ipex",description:`<strong>use_ipex</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Use Intel extension for PyTorch when it is available. <a href="https://github.com/intel/intel-extension-for-pytorch" rel="nofollow">IPEX
installation</a>.`,name:"use_ipex"},{anchor:"transformers.TrainingArguments.bf16",description:`<strong>bf16</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use bf16 16-bit (mixed) precision training instead of 32-bit training. Requires Ampere or higher
NVIDIA architecture or using CPU (use_cpu). This is an experimental API and it may change.`,name:"bf16"},{anchor:"transformers.TrainingArguments.fp16",description:`<strong>fp16</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use fp16 16-bit (mixed) precision training instead of 32-bit training.`,name:"fp16"},{anchor:"transformers.TrainingArguments.fp16_opt_level",description:`<strong>fp16_opt_level</strong> (<code>str</code>, <em>optional</em>, defaults to &#x2018;O1&#x2019;) &#x2014;
For <code>fp16</code> training, Apex AMP optimization level selected in [&#x2018;O0&#x2019;, &#x2018;O1&#x2019;, &#x2018;O2&#x2019;, and &#x2018;O3&#x2019;]. See details on
the <a href="https://nvidia.github.io/apex/amp" rel="nofollow">Apex documentation</a>.`,name:"fp16_opt_level"},{anchor:"transformers.TrainingArguments.fp16_backend",description:`<strong>fp16_backend</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
This argument is deprecated. Use <code>half_precision_backend</code> instead.`,name:"fp16_backend"},{anchor:"transformers.TrainingArguments.half_precision_backend",description:`<strong>half_precision_backend</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
The backend to use for mixed precision training. Must be one of <code>&quot;auto&quot;, &quot;cuda_amp&quot;, &quot;apex&quot;, &quot;cpu_amp&quot;</code>.
<code>&quot;auto&quot;</code> will use CPU/CUDA AMP or APEX depending on the PyTorch version detected, while the other choices
will force the requested backend.`,name:"half_precision_backend"},{anchor:"transformers.TrainingArguments.bf16_full_eval",description:`<strong>bf16_full_eval</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use full bfloat16 evaluation instead of 32-bit. This will be faster and save memory but can harm
metric values. This is an experimental API and it may change.`,name:"bf16_full_eval"},{anchor:"transformers.TrainingArguments.fp16_full_eval",description:`<strong>fp16_full_eval</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use full float16 evaluation instead of 32-bit. This will be faster and save memory but can harm
metric values.`,name:"fp16_full_eval"},{anchor:"transformers.TrainingArguments.tf32",description:`<strong>tf32</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to enable the TF32 mode, available in Ampere and newer GPU architectures. The default value depends
on PyTorch&#x2019;s version default of <code>torch.backends.cuda.matmul.allow_tf32</code>. For more details please refer to
the <a href="https://huggingface.co/docs/transformers/performance#tf32" rel="nofollow">TF32</a> documentation. This is an
experimental API and it may change.`,name:"tf32"},{anchor:"transformers.TrainingArguments.local_rank",description:`<strong>local_rank</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Rank of the process during distributed training.`,name:"local_rank"},{anchor:"transformers.TrainingArguments.ddp_backend",description:`<strong>ddp_backend</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The backend to use for distributed training. Must be one of <code>&quot;nccl&quot;</code>, <code>&quot;mpi&quot;</code>, <code>&quot;ccl&quot;</code>, <code>&quot;gloo&quot;</code>.`,name:"ddp_backend"},{anchor:"transformers.TrainingArguments.tpu_num_cores",description:`<strong>tpu_num_cores</strong> (<code>int</code>, <em>optional</em>) &#x2014;
When training on TPU, the number of TPU cores (automatically passed by launcher script).`,name:"tpu_num_cores"},{anchor:"transformers.TrainingArguments.dataloader_drop_last",description:`<strong>dataloader_drop_last</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to drop the last incomplete batch (if the length of the dataset is not divisible by the batch size)
or not.`,name:"dataloader_drop_last"},{anchor:"transformers.TrainingArguments.eval_steps",description:`<strong>eval_steps</strong> (<code>int</code> or <code>float</code>, <em>optional</em>) &#x2014;
Number of update steps between two evaluations if <code>evaluation_strategy=&quot;steps&quot;</code>. Will default to the same
value as <code>logging_steps</code> if not set. Should be an integer or a float in range <code>[0,1)</code>. If smaller than 1,
will be interpreted as ratio of total training steps.`,name:"eval_steps"},{anchor:"transformers.TrainingArguments.dataloader_num_workers",description:`<strong>dataloader_num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Number of subprocesses to use for data loading (PyTorch only). 0 means that the data will be loaded in the
main process.`,name:"dataloader_num_workers"},{anchor:"transformers.TrainingArguments.past_index",description:`<strong>past_index</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Some models like <a href="../model_doc/transformerxl">TransformerXL</a> or <a href="../model_doc/xlnet">XLNet</a> can make use of
the past hidden states for their predictions. If this argument is set to a positive int, the <code>Trainer</code> will
use the corresponding output (usually index 2) as the past state and feed it to the model at the next
training step under the keyword argument <code>mems</code>.`,name:"past_index"},{anchor:"transformers.TrainingArguments.run_name",description:`<strong>run_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A descriptor for the run. Typically used for <a href="https://www.wandb.com/" rel="nofollow">wandb</a> and
<a href="https://www.mlflow.org/" rel="nofollow">mlflow</a> logging.`,name:"run_name"},{anchor:"transformers.TrainingArguments.disable_tqdm",description:`<strong>disable_tqdm</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to disable the tqdm progress bars and table of metrics produced by
<code>~notebook.NotebookTrainingTracker</code> in Jupyter Notebooks. Will default to <code>True</code> if the logging level is
set to warn or lower (default), <code>False</code> otherwise.`,name:"disable_tqdm"},{anchor:"transformers.TrainingArguments.remove_unused_columns",description:`<strong>remove_unused_columns</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to automatically remove the columns unused by the model forward method.</p>
<p>(Note that this behavior is not implemented for <code>TFTrainer</code> yet.)`,name:"remove_unused_columns"},{anchor:"transformers.TrainingArguments.label_names",description:`<strong>label_names</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
The list of keys in your dictionary of inputs that correspond to the labels.</p>
<p>Will eventually default to the list of argument names accepted by the model that contain the word &#x201C;label&#x201D;,
except if the model used is one of the <code>XxxForQuestionAnswering</code> in which case it will also include the
<code>[&quot;start_positions&quot;, &quot;end_positions&quot;]</code> keys.`,name:"label_names"},{anchor:"transformers.TrainingArguments.load_best_model_at_end",description:`<strong>load_best_model_at_end</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to load the best model found during training at the end of training. When this option is
enabled, the best checkpoint will always be saved. See
<a href="https://huggingface.co/docs/transformers/main_classes/trainer#transformers.TrainingArguments.save_total_limit" rel="nofollow"><code>save_total_limit</code></a>
for more.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When set to <code>True</code>, the parameters <code>save_strategy</code> needs to be the same as <code>evaluation_strategy</code>, and in
the case it is &#x201C;steps&#x201D;, <code>save_steps</code> must be a round multiple of <code>eval_steps</code>.</p>

					</div>`,name:"load_best_model_at_end"},{anchor:"transformers.TrainingArguments.metric_for_best_model",description:`<strong>metric_for_best_model</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Use in conjunction with <code>load_best_model_at_end</code> to specify the metric to use to compare two different
models. Must be the name of a metric returned by the evaluation with or without the prefix <code>&quot;eval_&quot;</code>. Will
default to <code>&quot;loss&quot;</code> if unspecified and <code>load_best_model_at_end=True</code> (to use the evaluation loss).</p>
<p>If you set this value, <code>greater_is_better</code> will default to <code>True</code>. Don&#x2019;t forget to set it to <code>False</code> if
your metric is better when lower.`,name:"metric_for_best_model"},{anchor:"transformers.TrainingArguments.greater_is_better",description:`<strong>greater_is_better</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Use in conjunction with <code>load_best_model_at_end</code> and <code>metric_for_best_model</code> to specify if better models
should have a greater metric or not. Will default to:</p>
<ul>
<li><code>True</code> if <code>metric_for_best_model</code> is set to a value that isn&#x2019;t <code>&quot;loss&quot;</code> or <code>&quot;eval_loss&quot;</code>.</li>
<li><code>False</code> if <code>metric_for_best_model</code> is not set, or set to <code>&quot;loss&quot;</code> or <code>&quot;eval_loss&quot;</code>.</li>
</ul>`,name:"greater_is_better"},{anchor:"transformers.TrainingArguments.ignore_data_skip",description:`<strong>ignore_data_skip</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
When resuming training, whether or not to skip the epochs and batches to get the data loading at the same
stage as in the previous training. If set to <code>True</code>, the training will begin faster (as that skipping step
can take a long time) but will not yield the same results as the interrupted training would have.`,name:"ignore_data_skip"},{anchor:"transformers.TrainingArguments.sharded_ddp",description:`<strong>sharded_ddp</strong> (<code>bool</code>, <code>str</code> or list of <code>ShardedDDPOption</code>, <em>optional</em>, defaults to <code>&apos;&apos;</code>) &#x2014;
Use Sharded DDP training from <a href="https://github.com/facebookresearch/fairscale" rel="nofollow">FairScale</a> (in distributed
training only). This is an experimental feature.</p>
<p>A list of options along the following:</p>
<ul>
<li><code>&quot;simple&quot;</code>: to use first instance of sharded DDP released by fairscale (<code>ShardedDDP</code>) similar to ZeRO-2.</li>
<li><code>&quot;zero_dp_2&quot;</code>: to use the second instance of sharded DPP released by fairscale (<code>FullyShardedDDP</code>) in
Zero-2 mode (with <code>reshard_after_forward=False</code>).</li>
<li><code>&quot;zero_dp_3&quot;</code>: to use the second instance of sharded DPP released by fairscale (<code>FullyShardedDDP</code>) in
Zero-3 mode (with <code>reshard_after_forward=True</code>).</li>
<li><code>&quot;offload&quot;</code>: to add ZeRO-offload (only compatible with <code>&quot;zero_dp_2&quot;</code> and <code>&quot;zero_dp_3&quot;</code>).</li>
</ul>
<p>If a string is passed, it will be split on space. If a bool is passed, it will be converted to an empty
list for <code>False</code> and <code>[&quot;simple&quot;]</code> for <code>True</code>.`,name:"sharded_ddp"},{anchor:"transformers.TrainingArguments.fsdp",description:`<strong>fsdp</strong> (<code>bool</code>, <code>str</code> or list of <code>FSDPOption</code>, <em>optional</em>, defaults to <code>&apos;&apos;</code>) &#x2014;
Use PyTorch Distributed Parallel Training (in distributed training only).</p>
<p>A list of options along the following:</p>
<ul>
<li><code>&quot;full_shard&quot;</code>: Shard parameters, gradients and optimizer states.</li>
<li><code>&quot;shard_grad_op&quot;</code>: Shard optimizer states and gradients.</li>
<li><code>&quot;offload&quot;</code>: Offload parameters and gradients to CPUs (only compatible with <code>&quot;full_shard&quot;</code> and
<code>&quot;shard_grad_op&quot;</code>).</li>
<li><code>&quot;auto_wrap&quot;</code>: Automatically recursively wrap layers with FSDP using <code>default_auto_wrap_policy</code>.</li>
</ul>`,name:"fsdp"},{anchor:"transformers.TrainingArguments.fsdp_config",description:`<strong>fsdp_config</strong> (<code>str</code> or <code>dict</code>, <em>optional</em>) &#x2014;
Config to be used with fsdp (Pytorch Distributed Parallel Training). The value is either a location of
deepspeed json config file (e.g., <code>ds_config.json</code>) or an already loaded json file as <code>dict</code>.</p>
<p>A List of config and its options:</p>
<ul>
<li>
<p>min_num_params (<code>int</code>, <em>optional</em>, defaults to <code>0</code>):
FSDP&#x2019;s minimum number of parameters for Default Auto Wrapping. (useful only when <code>fsdp</code> field is
passed).</p>
</li>
<li>
<p>transformer_layer_cls_to_wrap (<code>List[str]</code>, <em>optional</em>):
List of transformer layer class names (case-sensitive) to wrap, e.g, <code>BertLayer</code>, <code>GPTJBlock</code>,
<code>T5Block</code> &#x2026; (useful only when <code>fsdp</code> flag is passed).</p>
</li>
<li>
<p>backward_prefetch (<code>str</code>, <em>optional</em>)
FSDP&#x2019;s backward prefetch mode. Controls when to prefetch next set of parameters (useful only when
<code>fsdp</code> field is passed).</p>
<p>A list of options along the following:</p>
<ul>
<li><code>&quot;backward_pre&quot;</code> : Prefetches the next set of parameters before the current set of parameter&#x2019;s
gradient
computation.</li>
<li><code>&quot;backward_post&quot;</code> : This prefetches the next set of parameters after the current set of
parameter&#x2019;s
gradient computation.</li>
</ul>
</li>
<li>
<p>forward_prefetch (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>)
FSDP&#x2019;s forward prefetch mode (useful only when <code>fsdp</code> field is passed).
If <code>&quot;True&quot;</code>, then FSDP explicitly prefetches the next upcoming all-gather while executing in the
forward pass.</p>
</li>
<li>
<p>limit_all_gathers (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>)
FSDP&#x2019;s limit_all_gathers (useful only when <code>fsdp</code> field is passed).
If <code>&quot;True&quot;</code>, FSDP explicitly synchronizes the CPU thread to prevent too many in-flight
all-gathers.</p>
</li>
<li>
<p>use_orig_params (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>)
If <code>&quot;True&quot;</code>, allows non-uniform <code>requires_grad</code> during init, which means support for interspersed
frozen and trainable paramteres. Useful in cases such as parameter-efficient fine-tuning. Please
refer this
[blog](<a href="https://dev-discuss.pytorch.org/t/rethinking-pytorch-fully-sharded-data-parallel-fsdp-from-first-principles/1019" rel="nofollow">https://dev-discuss.pytorch.org/t/rethinking-pytorch-fully-sharded-data-parallel-fsdp-from-first-principles/1019</a></p>
</li>
<li>
<p>sync_module_states (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>)
If <code>&quot;True&quot;</code>, each individually wrapped FSDP unit will broadcast module parameters from rank 0 to
ensure they are the same across all ranks after initialization</p>
</li>
<li>
<p>xla (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>):
Whether to use PyTorch/XLA Fully Sharded Data Parallel Training. This is an experimental feature
and its API may evolve in the future.</p>
</li>
<li>
<p>xla_fsdp_settings (<code>dict</code>, <em>optional</em>)
The value is a dictionary which stores the XLA FSDP wrapping parameters.</p>
<p>For a complete list of options, please see <a href="https://github.com/pytorch/xla/blob/master/torch_xla/distributed/fsdp/xla_fully_sharded_data_parallel.py" rel="nofollow">here</a>.</p>
</li>
<li>
<p>xla_fsdp_grad_ckpt (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>):
Will use gradient checkpointing over each nested XLA FSDP wrapped layer. This setting can only be
used when the xla flag is set to true, and an auto wrapping policy is specified through
fsdp_min_num_params or fsdp_transformer_layer_cls_to_wrap.</p>
</li>
</ul>`,name:"fsdp_config"},{anchor:"transformers.TrainingArguments.deepspeed",description:`<strong>deepspeed</strong> (<code>str</code> or <code>dict</code>, <em>optional</em>) &#x2014;
Use <a href="https://github.com/microsoft/deepspeed" rel="nofollow">Deepspeed</a>. This is an experimental feature and its API may
evolve in the future. The value is either the location of DeepSpeed json config file (e.g.,
<code>ds_config.json</code>) or an already loaded json file as a <code>dict</code>&#x201D;`,name:"deepspeed"},{anchor:"transformers.TrainingArguments.label_smoothing_factor",description:`<strong>label_smoothing_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The label smoothing factor to use. Zero means no label smoothing, otherwise the underlying onehot-encoded
labels are changed from 0s and 1s to <code>label_smoothing_factor/num_labels</code> and <code>1 - label_smoothing_factor + label_smoothing_factor/num_labels</code> respectively.`,name:"label_smoothing_factor"},{anchor:"transformers.TrainingArguments.debug",description:`<strong>debug</strong> (<code>str</code> or list of <code>DebugOption</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
Enable one or more debug features. This is an experimental feature.</p>
<p>Possible options are:</p>
<ul>
<li><code>&quot;underflow_overflow&quot;</code>: detects overflow in model&#x2019;s input/outputs and reports the last frames that led to
the event</li>
<li><code>&quot;tpu_metrics_debug&quot;</code>: print debug metrics on TPU</li>
</ul>
<p>The options should be separated by whitespaces.`,name:"debug"},{anchor:"transformers.TrainingArguments.optim",description:`<strong>optim</strong> (<code>str</code> or <code>training_args.OptimizerNames</code>, <em>optional</em>, defaults to <code>&quot;adamw_torch&quot;</code>) &#x2014;
The optimizer to use: adamw_hf, adamw_torch, adamw_torch_fused, adamw_apex_fused, adamw_anyprecision or
adafactor.`,name:"optim"},{anchor:"transformers.TrainingArguments.optim_args",description:`<strong>optim_args</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Optional arguments that are supplied to AnyPrecisionAdamW.`,name:"optim_args"},{anchor:"transformers.TrainingArguments.group_by_length",description:`<strong>group_by_length</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to group together samples of roughly the same length in the training dataset (to minimize
padding applied and be more efficient). Only useful if applying dynamic padding.`,name:"group_by_length"},{anchor:"transformers.TrainingArguments.length_column_name",description:`<strong>length_column_name</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;length&quot;</code>) &#x2014;
Column name for precomputed lengths. If the column exists, grouping by length will use these values rather
than computing them on train startup. Ignored unless <code>group_by_length</code> is <code>True</code> and the dataset is an
instance of <code>Dataset</code>.`,name:"length_column_name"},{anchor:"transformers.TrainingArguments.report_to",description:`<strong>report_to</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>, defaults to <code>&quot;all&quot;</code>) &#x2014;
The list of integrations to report the results and logs to. Supported platforms are <code>&quot;azure_ml&quot;</code>,
<code>&quot;clearml&quot;</code>, <code>&quot;codecarbon&quot;</code>, <code>&quot;comet_ml&quot;</code>, <code>&quot;dagshub&quot;</code>, <code>&quot;flyte&quot;</code>, <code>&quot;mlflow&quot;</code>, <code>&quot;neptune&quot;</code>,
<code>&quot;tensorboard&quot;</code>, and <code>&quot;wandb&quot;</code>. Use <code>&quot;all&quot;</code> to report to all integrations installed, <code>&quot;none&quot;</code> for no
integrations.`,name:"report_to"},{anchor:"transformers.TrainingArguments.ddp_find_unused_parameters",description:`<strong>ddp_find_unused_parameters</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
When using distributed training, the value of the flag <code>find_unused_parameters</code> passed to
<code>DistributedDataParallel</code>. Will default to <code>False</code> if gradient checkpointing is used, <code>True</code> otherwise.`,name:"ddp_find_unused_parameters"},{anchor:"transformers.TrainingArguments.ddp_bucket_cap_mb",description:`<strong>ddp_bucket_cap_mb</strong> (<code>int</code>, <em>optional</em>) &#x2014;
When using distributed training, the value of the flag <code>bucket_cap_mb</code> passed to <code>DistributedDataParallel</code>.`,name:"ddp_bucket_cap_mb"},{anchor:"transformers.TrainingArguments.ddp_broadcast_buffers",description:`<strong>ddp_broadcast_buffers</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
When using distributed training, the value of the flag <code>broadcast_buffers</code> passed to
<code>DistributedDataParallel</code>. Will default to <code>False</code> if gradient checkpointing is used, <code>True</code> otherwise.`,name:"ddp_broadcast_buffers"},{anchor:"transformers.TrainingArguments.dataloader_pin_memory",description:`<strong>dataloader_pin_memory</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether you want to pin memory in data loaders or not. Will default to <code>True</code>.`,name:"dataloader_pin_memory"},{anchor:"transformers.TrainingArguments.skip_memory_metrics",description:`<strong>skip_memory_metrics</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to skip adding of memory profiler reports to metrics. This is skipped by default because it slows
down the training and evaluation speed.`,name:"skip_memory_metrics"},{anchor:"transformers.TrainingArguments.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push the model to the Hub every time the model is saved. If this is activated,
<code>output_dir</code> will begin a git directory synced with the repo (determined by <code>hub_model_id</code>) and the content
will be pushed each time a save is triggered (depending on your <code>save_strategy</code>). Calling
<a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer.save_model">save_model()</a> will also trigger a push.</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>If <code>output_dir</code> exists, it needs to be a local clone of the repository to which the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a> will be
pushed.</p>

					</div>`,name:"push_to_hub"},{anchor:"transformers.TrainingArguments.resume_from_checkpoint",description:`<strong>resume_from_checkpoint</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The path to a folder with a valid checkpoint for your model. This argument is not directly used by
<a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>, it&#x2019;s intended to be used by your training/evaluation scripts instead. See the <a href="https://github.com/huggingface/transformers/tree/main/examples" rel="nofollow">example
scripts</a> for more details.`,name:"resume_from_checkpoint"},{anchor:"transformers.TrainingArguments.hub_model_id",description:`<strong>hub_model_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name of the repository to keep in sync with the local <em>output_dir</em>. It can be a simple model ID in
which case the model will be pushed in your namespace. Otherwise it should be the whole repository name,
for instance <code>&quot;user_name/model&quot;</code>, which allows you to push to an organization you are a member of with
<code>&quot;organization_name/model&quot;</code>. Will default to <code>user_name/output_dir_name</code> with <em>output_dir_name</em> being the
name of <code>output_dir</code>.</p>
<p>Will default to the name of <code>output_dir</code>.`,name:"hub_model_id"},{anchor:"transformers.TrainingArguments.hub_strategy",description:`<strong>hub_strategy</strong> (<code>str</code> or <code>HubStrategy</code>, <em>optional</em>, defaults to <code>&quot;every_save&quot;</code>) &#x2014;
Defines the scope of what is pushed to the Hub and when. Possible values are:</p>
<ul>
<li><code>&quot;end&quot;</code>: push the model, its configuration, the tokenizer (if passed along to the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>) and a
draft of a model card when the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer.save_model">save_model()</a> method is called.</li>
<li><code>&quot;every_save&quot;</code>: push the model, its configuration, the tokenizer (if passed along to the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>) and
a draft of a model card each time there is a model save. The pushes are asynchronous to not block
training, and in case the save are very frequent, a new push is only attempted if the previous one is
finished. A last push is made with the final model at the end of training.</li>
<li><code>&quot;checkpoint&quot;</code>: like <code>&quot;every_save&quot;</code> but the latest checkpoint is also pushed in a subfolder named
last-checkpoint, allowing you to resume training easily with
<code>trainer.train(resume_from_checkpoint=&quot;last-checkpoint&quot;)</code>.</li>
<li><code>&quot;all_checkpoints&quot;</code>: like <code>&quot;checkpoint&quot;</code> but all checkpoints are pushed like they appear in the output
folder (so you will get one checkpoint folder per folder in your final repository)</li>
</ul>`,name:"hub_strategy"},{anchor:"transformers.TrainingArguments.hub_token",description:`<strong>hub_token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to use to push the model to the Hub. Will default to the token in the cache folder obtained with
<code>huggingface-cli login</code>.`,name:"hub_token"},{anchor:"transformers.TrainingArguments.hub_private_repo",description:`<strong>hub_private_repo</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If True, the Hub repo will be set to private.`,name:"hub_private_repo"},{anchor:"transformers.TrainingArguments.hub_always_push",description:`<strong>hub_always_push</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Unless this is <code>True</code>, the <code>Trainer</code> will skip pushing a checkpoint when the previous push is not finished.`,name:"hub_always_push"},{anchor:"transformers.TrainingArguments.gradient_checkpointing",description:`<strong>gradient_checkpointing</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If True, use gradient checkpointing to save memory at the expense of slower backward pass.`,name:"gradient_checkpointing"},{anchor:"transformers.TrainingArguments.include_inputs_for_metrics",description:`<strong>include_inputs_for_metrics</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the inputs will be passed to the <code>compute_metrics</code> function. This is intended for metrics
that need inputs, predictions and references for scoring calculation in Metric class.`,name:"include_inputs_for_metrics"},{anchor:"transformers.TrainingArguments.auto_find_batch_size",description:`<strong>auto_find_batch_size</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to find a batch size that will fit into memory automatically through exponential decay, avoiding
CUDA Out-of-Memory errors. Requires accelerate to be installed (<code>pip install accelerate</code>)`,name:"auto_find_batch_size"},{anchor:"transformers.TrainingArguments.full_determinism",description:`<strong>full_determinism</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.enable_full_determinism">enable_full_determinism()</a> is called instead of <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.set_seed">set_seed()</a> to ensure reproducible results in
distributed training. Important: this will negatively impact the performance, so only use it for debugging.`,name:"full_determinism"},{anchor:"transformers.TrainingArguments.torchdynamo",description:`<strong>torchdynamo</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If set, the backend compiler for TorchDynamo. Possible choices are <code>&quot;eager&quot;</code>, <code>&quot;aot_eager&quot;</code>, <code>&quot;inductor&quot;</code>,
<code>&quot;nvfuser&quot;</code>, <code>&quot;aot_nvfuser&quot;</code>, <code>&quot;aot_cudagraphs&quot;</code>, <code>&quot;ofi&quot;</code>, <code>&quot;fx2trt&quot;</code>, <code>&quot;onnxrt&quot;</code> and <code>&quot;ipex&quot;</code>.`,name:"torchdynamo"},{anchor:"transformers.TrainingArguments.ray_scope",description:`<strong>ray_scope</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;last&quot;</code>) &#x2014;
The scope to use when doing hyperparameter search with Ray. By default, <code>&quot;last&quot;</code> will be used. Ray will
then use the last checkpoint of all trials, compare those, and select the best one. However, other options
are also available. See the <a href="https://docs.ray.io/en/latest/tune/api_docs/analysis.html#ray.tune.ExperimentAnalysis.get_best_trial" rel="nofollow">Ray documentation</a> for
more options.`,name:"ray_scope"},{anchor:"transformers.TrainingArguments.ddp_timeout",description:`<strong>ddp_timeout</strong> (<code>int</code>, <em>optional</em>, defaults to 1800) &#x2014;
The timeout for <code>torch.distributed.init_process_group</code> calls, used to avoid GPU socket timeouts when
performing slow operations in distributed runnings. Please refer the [PyTorch documentation]
(<a href="https://pytorch.org/docs/stable/distributed.html#torch.distributed.init_process_group" rel="nofollow">https://pytorch.org/docs/stable/distributed.html#torch.distributed.init_process_group</a>) for more
information.`,name:"ddp_timeout"},{anchor:"transformers.TrainingArguments.use_mps_device",description:`<strong>use_mps_device</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
This argument is deprecated.<code>mps</code> device will be used if it is available similar to <code>cuda</code> device.`,name:"use_mps_device"},{anchor:"transformers.TrainingArguments.torch_compile",description:`<strong>torch_compile</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to compile the model using PyTorch 2.0
<a href="https://pytorch.org/get-started/pytorch-2.0/" rel="nofollow"><code>torch.compile</code></a>.</p>
<p>This will use the best defaults for the <a href="https://pytorch.org/docs/stable/generated/torch.compile.html?highlight=torch+compile#torch.compile" rel="nofollow"><code>torch.compile</code>
API</a>.
You can customize the defaults with the argument <code>torch_compile_backend</code> and <code>torch_compile_mode</code> but we
don&#x2019;t guarantee any of them will work as the support is progressively rolled in in PyTorch.</p>
<p>This flag and the whole compile API is experimental and subject to change in future releases.`,name:"torch_compile"},{anchor:"transformers.TrainingArguments.torch_compile_backend",description:`<strong>torch_compile_backend</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The backend to use in <code>torch.compile</code>. If set to any value, <code>torch_compile</code> will be set to <code>True</code>.</p>
<p>Refer to the PyTorch doc for possible values and note that they may change across PyTorch versions.</p>
<p>This flag is experimental and subject to change in future releases.`,name:"torch_compile_backend"},{anchor:"transformers.TrainingArguments.torch_compile_mode",description:`<strong>torch_compile_mode</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The mode to use in <code>torch.compile</code>. If set to any value, <code>torch_compile</code> will be set to <code>True</code>.</p>
<p>Refer to the PyTorch doc for possible values and note that they may change across PyTorch versions.</p>
<p>This flag is experimental and subject to change in future releases.`,name:"torch_compile_mode"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L158"}}),Ns=new S({props:{name:"get_process_log_level",anchor:"transformers.TrainingArguments.get_process_log_level",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L1964"}}),Os=new S({props:{name:"get_warmup_steps",anchor:"transformers.TrainingArguments.get_warmup_steps",parameters:[{name:"num_training_steps",val:": int"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2053"}}),Ws=new S({props:{name:"main_process_first",anchor:"transformers.TrainingArguments.main_process_first",parameters:[{name:"local",val:" = True"},{name:"desc",val:" = 'work'"}],parametersDescription:[{anchor:"transformers.TrainingArguments.main_process_first.local",description:`<strong>local</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
if <code>True</code> first means process of rank 0 of each node if <code>False</code> first means process of rank 0 of node
rank 0 In multi-node environment with a shared filesystem you most likely will want to use
<code>local=False</code> so that only the main process of the first node will do the processing. If however, the
filesystem is not shared, then the main process of each node will need to do the processing, which is
the default behavior.`,name:"local"},{anchor:"transformers.TrainingArguments.main_process_first.desc",description:`<strong>desc</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;work&quot;</code>) &#x2014;
a work description to be used in debug logs`,name:"desc"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2002"}}),Rs=new S({props:{name:"set_dataloader",anchor:"transformers.TrainingArguments.set_dataloader",parameters:[{name:"train_batch_size",val:": int = 8"},{name:"eval_batch_size",val:": int = 8"},{name:"drop_last",val:": bool = False"},{name:"num_workers",val:": int = 0"},{name:"pin_memory",val:": bool = True"},{name:"auto_find_batch_size",val:": bool = False"},{name:"ignore_data_skip",val:": bool = False"},{name:"sampler_seed",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.TrainingArguments.set_dataloader.drop_last",description:`<strong>drop_last</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to drop the last incomplete batch (if the length of the dataset is not divisible by the batch
size) or not.`,name:"drop_last"},{anchor:"transformers.TrainingArguments.set_dataloader.num_workers",description:`<strong>num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Number of subprocesses to use for data loading (PyTorch only). 0 means that the data will be loaded in
the main process.`,name:"num_workers"},{anchor:"transformers.TrainingArguments.set_dataloader.pin_memory",description:`<strong>pin_memory</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether you want to pin memory in data loaders or not. Will default to <code>True</code>.`,name:"pin_memory"},{anchor:"transformers.TrainingArguments.set_dataloader.auto_find_batch_size",description:`<strong>auto_find_batch_size</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to find a batch size that will fit into memory automatically through exponential decay,
avoiding CUDA Out-of-Memory errors. Requires accelerate to be installed (<code>pip install accelerate</code>)`,name:"auto_find_batch_size"},{anchor:"transformers.TrainingArguments.set_dataloader.ignore_data_skip",description:`<strong>ignore_data_skip</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
When resuming training, whether or not to skip the epochs and batches to get the data loading at the
same stage as in the previous training. If set to <code>True</code>, the training will begin faster (as that
skipping step can take a long time) but will not yield the same results as the interrupted training
would have.`,name:"ignore_data_skip"},{anchor:"transformers.TrainingArguments.set_dataloader.sampler_seed",description:`<strong>sampler_seed</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Random seed to be used with data samplers. If not set, random generators for data sampling will use the
same seed as <code>self.seed</code>. This can be used to ensure reproducibility of data sampling, independent of
the model seed.`,name:"sampler_seed"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2564"}}),Lr=new _o({props:{anchor:"transformers.TrainingArguments.set_dataloader.example",$$slots:{default:[OL]},$$scope:{ctx:U}}}),Ls=new S({props:{name:"set_evaluate",anchor:"transformers.TrainingArguments.set_evaluate",parameters:[{name:"strategy",val:": typing.Union[str, transformers.trainer_utils.IntervalStrategy] = 'no'"},{name:"steps",val:": int = 500"},{name:"batch_size",val:": int = 8"},{name:"accumulation_steps",val:": typing.Optional[int] = None"},{name:"delay",val:": typing.Optional[float] = None"},{name:"loss_only",val:": bool = False"},{name:"jit_mode",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TrainingArguments.set_evaluate.strategy",description:`<strong>strategy</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.IntervalStrategy">IntervalStrategy</a>, <em>optional</em>, defaults to <code>&quot;no&quot;</code>) &#x2014;
The evaluation strategy to adopt during training. Possible values are:</p>
<ul>
<li><code>&quot;no&quot;</code>: No evaluation is done during training.</li>
<li><code>&quot;steps&quot;</code>: Evaluation is done (and logged) every <code>steps</code>.</li>
<li><code>&quot;epoch&quot;</code>: Evaluation is done at the end of each epoch.</li>
</ul>
<p>Setting a <code>strategy</code> different from <code>&quot;no&quot;</code> will set <code>self.do_eval</code> to <code>True</code>.`,name:"strategy"},{anchor:"transformers.TrainingArguments.set_evaluate.steps",description:`<strong>steps</strong> (<code>int</code>, <em>optional</em>, defaults to 500) &#x2014;
Number of update steps between two evaluations if <code>strategy=&quot;steps&quot;</code>.`,name:"steps"},{anchor:"transformers.TrainingArguments.set_evaluate.batch_size",description:`<strong>batch_size</strong> (<code>int</code> <em>optional</em>, defaults to 8) &#x2014;
The batch size per device (GPU/TPU core/CPU&#x2026;) used for evaluation.`,name:"batch_size"},{anchor:"transformers.TrainingArguments.set_evaluate.accumulation_steps",description:`<strong>accumulation_steps</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of predictions steps to accumulate the output tensors for, before moving the results to the CPU.
If left unset, the whole predictions are accumulated on GPU/TPU before being moved to the CPU (faster
but requires more memory).`,name:"accumulation_steps"},{anchor:"transformers.TrainingArguments.set_evaluate.delay",description:`<strong>delay</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Number of epochs or steps to wait for before the first evaluation can be performed, depending on the
evaluation_strategy.`,name:"delay"},{anchor:"transformers.TrainingArguments.set_evaluate.loss_only",description:`<strong>loss_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Ignores all outputs except the loss.`,name:"loss_only"},{anchor:"transformers.TrainingArguments.set_evaluate.jit_mode",description:`<strong>jit_mode</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to use PyTorch jit trace for inference.`,name:"jit_mode"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2174"}}),Br=new _o({props:{anchor:"transformers.TrainingArguments.set_evaluate.example",$$slots:{default:[WL]},$$scope:{ctx:U}}}),Bs=new S({props:{name:"set_logging",anchor:"transformers.TrainingArguments.set_logging",parameters:[{name:"strategy",val:": typing.Union[str, transformers.trainer_utils.IntervalStrategy] = 'steps'"},{name:"steps",val:": int = 500"},{name:"report_to",val:": typing.Union[str, typing.List[str]] = 'none'"},{name:"level",val:": str = 'passive'"},{name:"first_step",val:": bool = False"},{name:"nan_inf_filter",val:": bool = False"},{name:"on_each_node",val:": bool = False"},{name:"replica_level",val:": str = 'passive'"}],parametersDescription:[{anchor:"transformers.TrainingArguments.set_logging.strategy",description:`<strong>strategy</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.IntervalStrategy">IntervalStrategy</a>, <em>optional</em>, defaults to <code>&quot;steps&quot;</code>) &#x2014;
The logging strategy to adopt during training. Possible values are:</p>
<ul>
<li><code>&quot;no&quot;</code>: No save is done during training.</li>
<li><code>&quot;epoch&quot;</code>: Save is done at the end of each epoch.</li>
<li><code>&quot;steps&quot;</code>: Save is done every <code>save_steps</code>.</li>
</ul>`,name:"strategy"},{anchor:"transformers.TrainingArguments.set_logging.steps",description:`<strong>steps</strong> (<code>int</code>, <em>optional</em>, defaults to 500) &#x2014;
Number of update steps between two logs if <code>strategy=&quot;steps&quot;</code>.`,name:"steps"},{anchor:"transformers.TrainingArguments.set_logging.level",description:`<strong>level</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;passive&quot;</code>) &#x2014;
Logger log level to use on the main process. Possible choices are the log levels as strings: <code>&quot;debug&quot;</code>,
<code>&quot;info&quot;</code>, <code>&quot;warning&quot;</code>, <code>&quot;error&quot;</code> and <code>&quot;critical&quot;</code>, plus a <code>&quot;passive&quot;</code> level which doesn&#x2019;t set anything
and lets the application set the level.`,name:"level"},{anchor:"transformers.TrainingArguments.set_logging.report_to",description:`<strong>report_to</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>, defaults to <code>&quot;none&quot;</code>) &#x2014;
The list of integrations to report the results and logs to. Supported platforms are <code>&quot;azure_ml&quot;</code>,
<code>&quot;comet_ml&quot;</code>, <code>&quot;mlflow&quot;</code>, <code>&quot;neptune&quot;</code>, <code>&quot;tensorboard&quot;</code>,<code>&quot;clearml&quot;</code> and <code>&quot;wandb&quot;</code>. Use <code>&quot;all&quot;</code> to report
to all integrations installed, <code>&quot;none&quot;</code> for no integrations.`,name:"report_to"},{anchor:"transformers.TrainingArguments.set_logging.first_step",description:`<strong>first_step</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to log and evaluate the first <code>global_step</code> or not.`,name:"first_step"},{anchor:"transformers.TrainingArguments.set_logging.nan_inf_filter",description:`<strong>nan_inf_filter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to filter <code>nan</code> and <code>inf</code> losses for logging. If set to <code>True</code> the loss of every step that is
<code>nan</code> or <code>inf</code> is filtered and the average loss of the current logging window is taken instead.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p><code>nan_inf_filter</code> only influences the logging of loss values, it does not change the behavior the
gradient is computed or applied to the model.</p>

					</div>`,name:"nan_inf_filter"},{anchor:"transformers.TrainingArguments.set_logging.on_each_node",description:`<strong>on_each_node</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
In multinode distributed training, whether to log using <code>log_level</code> once per node, or only on the main
node.`,name:"on_each_node"},{anchor:"transformers.TrainingArguments.set_logging.replica_level",description:`<strong>replica_level</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;passive&quot;</code>) &#x2014;
Logger log level to use on replicas. Same choices as <code>log_level</code>`,name:"replica_level"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2324"}}),Gr=new _o({props:{anchor:"transformers.TrainingArguments.set_logging.example",$$slots:{default:[RL]},$$scope:{ctx:U}}}),Gs=new S({props:{name:"set_lr_scheduler",anchor:"transformers.TrainingArguments.set_lr_scheduler",parameters:[{name:"name",val:": typing.Union[str, transformers.trainer_utils.SchedulerType] = 'linear'"},{name:"num_epochs",val:": float = 3.0"},{name:"max_steps",val:": int = -1"},{name:"warmup_ratio",val:": float = 0"},{name:"warmup_steps",val:": int = 0"}],parametersDescription:[{anchor:"transformers.TrainingArguments.set_lr_scheduler.name",description:`<strong>name</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.SchedulerType">SchedulerType</a>, <em>optional</em>, defaults to <code>&quot;linear&quot;</code>) &#x2014;
The scheduler type to use. See the documentation of <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.SchedulerType">SchedulerType</a> for all possible values.`,name:"name"},{anchor:"transformers.TrainingArguments.set_lr_scheduler.num_epochs(float,",description:`<strong>num_epochs(<code>float</code>,</strong> <em>optional</em>, defaults to 3.0) &#x2014;
Total number of training epochs to perform (if not an integer, will perform the decimal part percents
of the last epoch before stopping training).`,name:"num_epochs(float,"},{anchor:"transformers.TrainingArguments.set_lr_scheduler.max_steps",description:`<strong>max_steps</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
If set to a positive number, the total number of training steps to perform. Overrides
<code>num_train_epochs</code>. In case of using a finite iterable dataset the training may stop before reaching
the set number of steps when all data is exhausted.`,name:"max_steps"},{anchor:"transformers.TrainingArguments.set_lr_scheduler.warmup_ratio",description:`<strong>warmup_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Ratio of total training steps used for a linear warmup from 0 to <code>learning_rate</code>.`,name:"warmup_ratio"},{anchor:"transformers.TrainingArguments.set_lr_scheduler.warmup_steps",description:`<strong>warmup_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Number of steps used for a linear warmup from 0 to <code>learning_rate</code>. Overrides any effect of
<code>warmup_ratio</code>.`,name:"warmup_steps"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2519"}}),Zr=new _o({props:{anchor:"transformers.TrainingArguments.set_lr_scheduler.example",$$slots:{default:[LL]},$$scope:{ctx:U}}}),Zs=new S({props:{name:"set_optimizer",anchor:"transformers.TrainingArguments.set_optimizer",parameters:[{name:"name",val:": typing.Union[str, transformers.training_args.OptimizerNames] = 'adamw_torch'"},{name:"learning_rate",val:": float = 5e-05"},{name:"weight_decay",val:": float = 0"},{name:"beta1",val:": float = 0.9"},{name:"beta2",val:": float = 0.999"},{name:"epsilon",val:": float = 1e-08"},{name:"args",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"transformers.TrainingArguments.set_optimizer.name",description:`<strong>name</strong> (<code>str</code> or <code>training_args.OptimizerNames</code>, <em>optional</em>, defaults to <code>&quot;adamw_torch&quot;</code>) &#x2014;
The optimizer to use: <code>&quot;adamw_hf&quot;</code>, <code>&quot;adamw_torch&quot;</code>, <code>&quot;adamw_torch_fused&quot;</code>, <code>&quot;adamw_apex_fused&quot;</code>,
<code>&quot;adamw_anyprecision&quot;</code> or <code>&quot;adafactor&quot;</code>.`,name:"name"},{anchor:"transformers.TrainingArguments.set_optimizer.learning_rate",description:`<strong>learning_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 5e-5) &#x2014;
The initial learning rate.`,name:"learning_rate"},{anchor:"transformers.TrainingArguments.set_optimizer.weight_decay",description:`<strong>weight_decay</strong> (<code>float</code>, <em>optional</em>, defaults to 0) &#x2014;
The weight decay to apply (if not zero) to all layers except all bias and LayerNorm weights.`,name:"weight_decay"},{anchor:"transformers.TrainingArguments.set_optimizer.beta1",description:`<strong>beta1</strong> (<code>float</code>, <em>optional</em>, defaults to 0.9) &#x2014;
The beta1 hyperparameter for the adam optimizer or its variants.`,name:"beta1"},{anchor:"transformers.TrainingArguments.set_optimizer.beta2",description:`<strong>beta2</strong> (<code>float</code>, <em>optional</em>, defaults to 0.999) &#x2014;
The beta2 hyperparameter for the adam optimizer or its variants.`,name:"beta2"},{anchor:"transformers.TrainingArguments.set_optimizer.epsilon",description:`<strong>epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-8) &#x2014;
The epsilon hyperparameter for the adam optimizer or its variants.`,name:"epsilon"},{anchor:"transformers.TrainingArguments.set_optimizer.args",description:`<strong>args</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Optional arguments that are supplied to AnyPrecisionAdamW (only useful when
<code>optim=&quot;adamw_anyprecision&quot;</code>).`,name:"args"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2468"}}),Vr=new _o({props:{anchor:"transformers.TrainingArguments.set_optimizer.example",$$slots:{default:[BL]},$$scope:{ctx:U}}}),Vs=new S({props:{name:"set_push_to_hub",anchor:"transformers.TrainingArguments.set_push_to_hub",parameters:[{name:"model_id",val:": str"},{name:"strategy",val:": typing.Union[str, transformers.trainer_utils.HubStrategy] = 'every_save'"},{name:"token",val:": typing.Optional[str] = None"},{name:"private_repo",val:": bool = False"},{name:"always_push",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TrainingArguments.set_push_to_hub.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The name of the repository to keep in sync with the local <em>output_dir</em>. It can be a simple model ID in
which case the model will be pushed in your namespace. Otherwise it should be the whole repository
name, for instance <code>&quot;user_name/model&quot;</code>, which allows you to push to an organization you are a member of
with <code>&quot;organization_name/model&quot;</code>.`,name:"model_id"},{anchor:"transformers.TrainingArguments.set_push_to_hub.strategy",description:`<strong>strategy</strong> (<code>str</code> or <code>HubStrategy</code>, <em>optional</em>, defaults to <code>&quot;every_save&quot;</code>) &#x2014;
Defines the scope of what is pushed to the Hub and when. Possible values are:</p>
<ul>
<li><code>&quot;end&quot;</code>: push the model, its configuration, the tokenizer (if passed along to the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>) and a
draft of a model card when the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer.save_model">save_model()</a> method is called.</li>
<li><code>&quot;every_save&quot;</code>: push the model, its configuration, the tokenizer (if passed along to the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>)
and
a draft of a model card each time there is a model save. The pushes are asynchronous to not block
training, and in case the save are very frequent, a new push is only attempted if the previous one is
finished. A last push is made with the final model at the end of training.</li>
<li><code>&quot;checkpoint&quot;</code>: like <code>&quot;every_save&quot;</code> but the latest checkpoint is also pushed in a subfolder named
last-checkpoint, allowing you to resume training easily with
<code>trainer.train(resume_from_checkpoint=&quot;last-checkpoint&quot;)</code>.</li>
<li><code>&quot;all_checkpoints&quot;</code>: like <code>&quot;checkpoint&quot;</code> but all checkpoints are pushed like they appear in the
output
folder (so you will get one checkpoint folder per folder in your final repository)</li>
</ul>`,name:"strategy"},{anchor:"transformers.TrainingArguments.set_push_to_hub.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to use to push the model to the Hub. Will default to the token in the cache folder obtained
with <code>huggingface-cli login</code>.`,name:"token"},{anchor:"transformers.TrainingArguments.set_push_to_hub.private_repo",description:`<strong>private_repo</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If True, the Hub repo will be set to private.`,name:"private_repo"},{anchor:"transformers.TrainingArguments.set_push_to_hub.always_push",description:`<strong>always_push</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Unless this is <code>True</code>, the <code>Trainer</code> will skip pushing a checkpoint when the previous push is not
finished.`,name:"always_push"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2398"}}),Xr=new ur({props:{$$slots:{default:[GL]},$$scope:{ctx:U}}}),Yr=new _o({props:{anchor:"transformers.TrainingArguments.set_push_to_hub.example",$$slots:{default:[ZL]},$$scope:{ctx:U}}}),Xs=new S({props:{name:"set_save",anchor:"transformers.TrainingArguments.set_save",parameters:[{name:"strategy",val:": typing.Union[str, transformers.trainer_utils.IntervalStrategy] = 'steps'"},{name:"steps",val:": int = 500"},{name:"total_limit",val:": typing.Optional[int] = None"},{name:"on_each_node",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TrainingArguments.set_save.strategy",description:`<strong>strategy</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.IntervalStrategy">IntervalStrategy</a>, <em>optional</em>, defaults to <code>&quot;steps&quot;</code>) &#x2014;
The checkpoint save strategy to adopt during training. Possible values are:</p>
<ul>
<li><code>&quot;no&quot;</code>: No save is done during training.</li>
<li><code>&quot;epoch&quot;</code>: Save is done at the end of each epoch.</li>
<li><code>&quot;steps&quot;</code>: Save is done every <code>save_steps</code>.</li>
</ul>`,name:"strategy"},{anchor:"transformers.TrainingArguments.set_save.steps",description:`<strong>steps</strong> (<code>int</code>, <em>optional</em>, defaults to 500) &#x2014;
Number of updates steps before two checkpoint saves if <code>strategy=&quot;steps&quot;</code>.`,name:"steps"},{anchor:"transformers.TrainingArguments.set_save.total_limit",description:`<strong>total_limit</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a value is passed, will limit the total amount of checkpoints. Deletes the older checkpoints in
<code>output_dir</code>.`,name:"total_limit"},{anchor:"transformers.TrainingArguments.set_save.on_each_node",description:`<strong>on_each_node</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
When doing multi-node distributed training, whether to save models and checkpoints on each node, or
only on the main one.</p>
<p>This should not be activated when the different nodes use the same storage as the files will be saved
with the same names for each node.`,name:"on_each_node"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2275"}}),Hr=new _o({props:{anchor:"transformers.TrainingArguments.set_save.example",$$slots:{default:[VL]},$$scope:{ctx:U}}}),Ys=new S({props:{name:"set_testing",anchor:"transformers.TrainingArguments.set_testing",parameters:[{name:"batch_size",val:": int = 8"},{name:"loss_only",val:": bool = False"},{name:"jit_mode",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TrainingArguments.set_testing.batch_size",description:`<strong>batch_size</strong> (<code>int</code> <em>optional</em>, defaults to 8) &#x2014;
The batch size per device (GPU/TPU core/CPU&#x2026;) used for testing.`,name:"batch_size"},{anchor:"transformers.TrainingArguments.set_testing.loss_only",description:`<strong>loss_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Ignores all outputs except the loss.`,name:"loss_only"},{anchor:"transformers.TrainingArguments.set_testing.jit_mode",description:`<strong>jit_mode</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to use PyTorch jit trace for inference.`,name:"jit_mode"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2235"}}),Qr=new ur({props:{$$slots:{default:[XL]},$$scope:{ctx:U}}}),Kr=new _o({props:{anchor:"transformers.TrainingArguments.set_testing.example",$$slots:{default:[YL]},$$scope:{ctx:U}}}),Hs=new S({props:{name:"set_training",anchor:"transformers.TrainingArguments.set_training",parameters:[{name:"learning_rate",val:": float = 5e-05"},{name:"batch_size",val:": int = 8"},{name:"weight_decay",val:": float = 0"},{name:"num_epochs",val:": float = 3"},{name:"max_steps",val:": int = -1"},{name:"gradient_accumulation_steps",val:": int = 1"},{name:"seed",val:": int = 42"},{name:"gradient_checkpointing",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TrainingArguments.set_training.learning_rate",description:`<strong>learning_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 5e-5) &#x2014;
The initial learning rate for the optimizer.`,name:"learning_rate"},{anchor:"transformers.TrainingArguments.set_training.batch_size",description:`<strong>batch_size</strong> (<code>int</code> <em>optional</em>, defaults to 8) &#x2014;
The batch size per device (GPU/TPU core/CPU&#x2026;) used for training.`,name:"batch_size"},{anchor:"transformers.TrainingArguments.set_training.weight_decay",description:`<strong>weight_decay</strong> (<code>float</code>, <em>optional</em>, defaults to 0) &#x2014;
The weight decay to apply (if not zero) to all layers except all bias and LayerNorm weights in the
optimizer.`,name:"weight_decay"},{anchor:"transformers.TrainingArguments.set_training.num_train_epochs(float,",description:`<strong>num_train_epochs(<code>float</code>,</strong> <em>optional</em>, defaults to 3.0) &#x2014;
Total number of training epochs to perform (if not an integer, will perform the decimal part percents
of the last epoch before stopping training).`,name:"num_train_epochs(float,"},{anchor:"transformers.TrainingArguments.set_training.max_steps",description:`<strong>max_steps</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
If set to a positive number, the total number of training steps to perform. Overrides
<code>num_train_epochs</code>. In case of using a finite iterable dataset the training may stop before reaching
the set number of steps when all data is exhausted.`,name:"max_steps"},{anchor:"transformers.TrainingArguments.set_training.gradient_accumulation_steps",description:`<strong>gradient_accumulation_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of updates steps to accumulate the gradients for, before performing a backward/update pass.</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>When using gradient accumulation, one step is counted as one step with backward pass. Therefore,
logging, evaluation, save will be conducted every <code>gradient_accumulation_steps * xxx_step</code> training
examples.</p>

					</div>`,name:"gradient_accumulation_steps"},{anchor:"transformers.TrainingArguments.set_training.seed",description:`<strong>seed</strong> (<code>int</code>, <em>optional</em>, defaults to 42) &#x2014;
Random seed that will be set at the beginning of training. To ensure reproducibility across runs, use
the <code>~Trainer.model_init</code> function to instantiate the model if it has some randomly initialized
parameters.`,name:"seed"},{anchor:"transformers.TrainingArguments.set_training.gradient_checkpointing",description:`<strong>gradient_checkpointing</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If True, use gradient checkpointing to save memory at the expense of slower backward pass.`,name:"gradient_checkpointing"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2099"}}),ea=new ur({props:{$$slots:{default:[HL]},$$scope:{ctx:U}}}),ta=new _o({props:{anchor:"transformers.TrainingArguments.set_training.example",$$slots:{default:[QL]},$$scope:{ctx:U}}}),Qs=new S({props:{name:"to_dict",anchor:"transformers.TrainingArguments.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2062"}}),ei=new S({props:{name:"to_json_string",anchor:"transformers.TrainingArguments.to_json_string",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2079"}}),ti=new S({props:{name:"to_sanitized_dict",anchor:"transformers.TrainingArguments.to_sanitized_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args.py#L2085"}}),oi=new oe({}),ri=new S({props:{name:"class transformers.Seq2SeqTrainingArguments",anchor:"transformers.Seq2SeqTrainingArguments",parameters:[{name:"output_dir",val:": str"},{name:"overwrite_output_dir",val:": bool = False"},{name:"do_train",val:": bool = False"},{name:"do_eval",val:": bool = False"},{name:"do_predict",val:": bool = False"},{name:"evaluation_strategy",val:": typing.Union[transformers.trainer_utils.IntervalStrategy, str] = 'no'"},{name:"prediction_loss_only",val:": bool = False"},{name:"per_device_train_batch_size",val:": int = 8"},{name:"per_device_eval_batch_size",val:": int = 8"},{name:"per_gpu_train_batch_size",val:": typing.Optional[int] = None"},{name:"per_gpu_eval_batch_size",val:": typing.Optional[int] = None"},{name:"gradient_accumulation_steps",val:": int = 1"},{name:"eval_accumulation_steps",val:": typing.Optional[int] = None"},{name:"eval_delay",val:": typing.Optional[float] = 0"},{name:"learning_rate",val:": float = 5e-05"},{name:"weight_decay",val:": float = 0.0"},{name:"adam_beta1",val:": float = 0.9"},{name:"adam_beta2",val:": float = 0.999"},{name:"adam_epsilon",val:": float = 1e-08"},{name:"max_grad_norm",val:": float = 1.0"},{name:"num_train_epochs",val:": float = 3.0"},{name:"max_steps",val:": int = -1"},{name:"lr_scheduler_type",val:": typing.Union[transformers.trainer_utils.SchedulerType, str] = 'linear'"},{name:"warmup_ratio",val:": float = 0.0"},{name:"warmup_steps",val:": int = 0"},{name:"log_level",val:": typing.Optional[str] = 'passive'"},{name:"log_level_replica",val:": typing.Optional[str] = 'warning'"},{name:"log_on_each_node",val:": bool = True"},{name:"logging_dir",val:": typing.Optional[str] = None"},{name:"logging_strategy",val:": typing.Union[transformers.trainer_utils.IntervalStrategy, str] = 'steps'"},{name:"logging_first_step",val:": bool = False"},{name:"logging_steps",val:": float = 500"},{name:"logging_nan_inf_filter",val:": bool = True"},{name:"save_strategy",val:": typing.Union[transformers.trainer_utils.IntervalStrategy, str] = 'steps'"},{name:"save_steps",val:": float = 500"},{name:"save_total_limit",val:": typing.Optional[int] = None"},{name:"save_safetensors",val:": typing.Optional[bool] = False"},{name:"save_on_each_node",val:": bool = False"},{name:"no_cuda",val:": bool = False"},{name:"use_cpu",val:": bool = False"},{name:"use_mps_device",val:": bool = False"},{name:"seed",val:": int = 42"},{name:"data_seed",val:": typing.Optional[int] = None"},{name:"jit_mode_eval",val:": bool = False"},{name:"use_ipex",val:": bool = False"},{name:"bf16",val:": bool = False"},{name:"fp16",val:": bool = False"},{name:"fp16_opt_level",val:": str = 'O1'"},{name:"half_precision_backend",val:": str = 'auto'"},{name:"bf16_full_eval",val:": bool = False"},{name:"fp16_full_eval",val:": bool = False"},{name:"tf32",val:": typing.Optional[bool] = None"},{name:"local_rank",val:": int = -1"},{name:"ddp_backend",val:": typing.Optional[str] = None"},{name:"tpu_num_cores",val:": typing.Optional[int] = None"},{name:"tpu_metrics_debug",val:": bool = False"},{name:"debug",val:": typing.Union[str, typing.List[transformers.debug_utils.DebugOption]] = ''"},{name:"dataloader_drop_last",val:": bool = False"},{name:"eval_steps",val:": typing.Optional[float] = None"},{name:"dataloader_num_workers",val:": int = 0"},{name:"past_index",val:": int = -1"},{name:"run_name",val:": typing.Optional[str] = None"},{name:"disable_tqdm",val:": typing.Optional[bool] = None"},{name:"remove_unused_columns",val:": typing.Optional[bool] = True"},{name:"label_names",val:": typing.Optional[typing.List[str]] = None"},{name:"load_best_model_at_end",val:": typing.Optional[bool] = False"},{name:"metric_for_best_model",val:": typing.Optional[str] = None"},{name:"greater_is_better",val:": typing.Optional[bool] = None"},{name:"ignore_data_skip",val:": bool = False"},{name:"sharded_ddp",val:": typing.Union[typing.List[transformers.trainer_utils.ShardedDDPOption], str, NoneType] = ''"},{name:"fsdp",val:": typing.Union[typing.List[transformers.trainer_utils.FSDPOption], str, NoneType] = ''"},{name:"fsdp_min_num_params",val:": int = 0"},{name:"fsdp_config",val:": typing.Optional[str] = None"},{name:"fsdp_transformer_layer_cls_to_wrap",val:": typing.Optional[str] = None"},{name:"deepspeed",val:": typing.Optional[str] = None"},{name:"label_smoothing_factor",val:": float = 0.0"},{name:"optim",val:": typing.Union[transformers.training_args.OptimizerNames, str] = 'adamw_torch'"},{name:"optim_args",val:": typing.Optional[str] = None"},{name:"adafactor",val:": bool = False"},{name:"group_by_length",val:": bool = False"},{name:"length_column_name",val:": typing.Optional[str] = 'length'"},{name:"report_to",val:": typing.Optional[typing.List[str]] = None"},{name:"ddp_find_unused_parameters",val:": typing.Optional[bool] = None"},{name:"ddp_bucket_cap_mb",val:": typing.Optional[int] = None"},{name:"ddp_broadcast_buffers",val:": typing.Optional[bool] = None"},{name:"dataloader_pin_memory",val:": bool = True"},{name:"skip_memory_metrics",val:": bool = True"},{name:"use_legacy_prediction_loop",val:": bool = False"},{name:"push_to_hub",val:": bool = False"},{name:"resume_from_checkpoint",val:": typing.Optional[str] = None"},{name:"hub_model_id",val:": typing.Optional[str] = None"},{name:"hub_strategy",val:": typing.Union[transformers.trainer_utils.HubStrategy, str] = 'every_save'"},{name:"hub_token",val:": typing.Optional[str] = None"},{name:"hub_private_repo",val:": bool = False"},{name:"hub_always_push",val:": bool = False"},{name:"gradient_checkpointing",val:": bool = False"},{name:"include_inputs_for_metrics",val:": bool = False"},{name:"fp16_backend",val:": str = 'auto'"},{name:"push_to_hub_model_id",val:": typing.Optional[str] = None"},{name:"push_to_hub_organization",val:": typing.Optional[str] = None"},{name:"push_to_hub_token",val:": typing.Optional[str] = None"},{name:"mp_parameters",val:": str = ''"},{name:"auto_find_batch_size",val:": bool = False"},{name:"full_determinism",val:": bool = False"},{name:"torchdynamo",val:": typing.Optional[str] = None"},{name:"ray_scope",val:": typing.Optional[str] = 'last'"},{name:"ddp_timeout",val:": typing.Optional[int] = 1800"},{name:"torch_compile",val:": bool = False"},{name:"torch_compile_backend",val:": typing.Optional[str] = None"},{name:"torch_compile_mode",val:": typing.Optional[str] = None"},{name:"dispatch_batches",val:": typing.Optional[bool] = None"},{name:"sortish_sampler",val:": bool = False"},{name:"predict_with_generate",val:": bool = False"},{name:"generation_max_length",val:": typing.Optional[int] = None"},{name:"generation_num_beams",val:": typing.Optional[int] = None"},{name:"generation_config",val:": typing.Union[str, pathlib.Path, transformers.generation.configuration_utils.GenerationConfig, NoneType] = None"}],parametersDescription:[{anchor:"transformers.Seq2SeqTrainingArguments.output_dir",description:`<strong>output_dir</strong> (<code>str</code>) &#x2014;
The output directory where the model predictions and checkpoints will be written.`,name:"output_dir"},{anchor:"transformers.Seq2SeqTrainingArguments.overwrite_output_dir",description:`<strong>overwrite_output_dir</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, overwrite the content of the output directory. Use this to continue training if <code>output_dir</code>
points to a checkpoint directory.`,name:"overwrite_output_dir"},{anchor:"transformers.Seq2SeqTrainingArguments.do_train",description:`<strong>do_train</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to run training or not. This argument is not directly used by <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>, it&#x2019;s intended to be used
by your training/evaluation scripts instead. See the <a href="https://github.com/huggingface/transformers/tree/main/examples" rel="nofollow">example
scripts</a> for more details.`,name:"do_train"},{anchor:"transformers.Seq2SeqTrainingArguments.do_eval",description:`<strong>do_eval</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to run evaluation on the validation set or not. Will be set to <code>True</code> if <code>evaluation_strategy</code> is
different from <code>&quot;no&quot;</code>. This argument is not directly used by <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>, it&#x2019;s intended to be used by your
training/evaluation scripts instead. See the <a href="https://github.com/huggingface/transformers/tree/main/examples" rel="nofollow">example
scripts</a> for more details.`,name:"do_eval"},{anchor:"transformers.Seq2SeqTrainingArguments.do_predict",description:`<strong>do_predict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to run predictions on the test set or not. This argument is not directly used by <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>, it&#x2019;s
intended to be used by your training/evaluation scripts instead. See the <a href="https://github.com/huggingface/transformers/tree/main/examples" rel="nofollow">example
scripts</a> for more details.`,name:"do_predict"},{anchor:"transformers.Seq2SeqTrainingArguments.evaluation_strategy",description:`<strong>evaluation_strategy</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.IntervalStrategy">IntervalStrategy</a>, <em>optional</em>, defaults to <code>&quot;no&quot;</code>) &#x2014;
The evaluation strategy to adopt during training. Possible values are:</p>
<ul>
<li><code>&quot;no&quot;</code>: No evaluation is done during training.</li>
<li><code>&quot;steps&quot;</code>: Evaluation is done (and logged) every <code>eval_steps</code>.</li>
<li><code>&quot;epoch&quot;</code>: Evaluation is done at the end of each epoch.</li>
</ul>`,name:"evaluation_strategy"},{anchor:"transformers.Seq2SeqTrainingArguments.prediction_loss_only",description:`<strong>prediction_loss_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
When performing evaluation and generating predictions, only returns the loss.`,name:"prediction_loss_only"},{anchor:"transformers.Seq2SeqTrainingArguments.per_device_train_batch_size",description:`<strong>per_device_train_batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
The batch size per GPU/TPU/MPS/NPU core/CPU for training.`,name:"per_device_train_batch_size"},{anchor:"transformers.Seq2SeqTrainingArguments.per_device_eval_batch_size",description:`<strong>per_device_eval_batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
The batch size per GPU/TPU/MPS/NPU core/CPU for evaluation.`,name:"per_device_eval_batch_size"},{anchor:"transformers.Seq2SeqTrainingArguments.gradient_accumulation_steps",description:`<strong>gradient_accumulation_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of updates steps to accumulate the gradients for, before performing a backward/update pass.</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>When using gradient accumulation, one step is counted as one step with backward pass. Therefore, logging,
evaluation, save will be conducted every <code>gradient_accumulation_steps * xxx_step</code> training examples.</p>

					</div>`,name:"gradient_accumulation_steps"},{anchor:"transformers.Seq2SeqTrainingArguments.eval_accumulation_steps",description:`<strong>eval_accumulation_steps</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of predictions steps to accumulate the output tensors for, before moving the results to the CPU. If
left unset, the whole predictions are accumulated on GPU/TPU before being moved to the CPU (faster but
requires more memory).`,name:"eval_accumulation_steps"},{anchor:"transformers.Seq2SeqTrainingArguments.eval_delay",description:`<strong>eval_delay</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Number of epochs or steps to wait for before the first evaluation can be performed, depending on the
evaluation_strategy.`,name:"eval_delay"},{anchor:"transformers.Seq2SeqTrainingArguments.learning_rate",description:`<strong>learning_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 5e-5) &#x2014;
The initial learning rate for <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.AdamW">AdamW</a> optimizer.`,name:"learning_rate"},{anchor:"transformers.Seq2SeqTrainingArguments.weight_decay",description:`<strong>weight_decay</strong> (<code>float</code>, <em>optional</em>, defaults to 0) &#x2014;
The weight decay to apply (if not zero) to all layers except all bias and LayerNorm weights in <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.AdamW">AdamW</a>
optimizer.`,name:"weight_decay"},{anchor:"transformers.Seq2SeqTrainingArguments.adam_beta1",description:`<strong>adam_beta1</strong> (<code>float</code>, <em>optional</em>, defaults to 0.9) &#x2014;
The beta1 hyperparameter for the <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.AdamW">AdamW</a> optimizer.`,name:"adam_beta1"},{anchor:"transformers.Seq2SeqTrainingArguments.adam_beta2",description:`<strong>adam_beta2</strong> (<code>float</code>, <em>optional</em>, defaults to 0.999) &#x2014;
The beta2 hyperparameter for the <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.AdamW">AdamW</a> optimizer.`,name:"adam_beta2"},{anchor:"transformers.Seq2SeqTrainingArguments.adam_epsilon",description:`<strong>adam_epsilon</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-8) &#x2014;
The epsilon hyperparameter for the <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.AdamW">AdamW</a> optimizer.`,name:"adam_epsilon"},{anchor:"transformers.Seq2SeqTrainingArguments.max_grad_norm",description:`<strong>max_grad_norm</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
Maximum gradient norm (for gradient clipping).`,name:"max_grad_norm"},{anchor:"transformers.Seq2SeqTrainingArguments.num_train_epochs(float,",description:`<strong>num_train_epochs(<code>float</code>,</strong> <em>optional</em>, defaults to 3.0) &#x2014;
Total number of training epochs to perform (if not an integer, will perform the decimal part percents of
the last epoch before stopping training).`,name:"num_train_epochs(float,"},{anchor:"transformers.Seq2SeqTrainingArguments.max_steps",description:`<strong>max_steps</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
If set to a positive number, the total number of training steps to perform. Overrides <code>num_train_epochs</code>.
In case of using a finite iterable dataset the training may stop before reaching the set number of steps
when all data is exhausted`,name:"max_steps"},{anchor:"transformers.Seq2SeqTrainingArguments.lr_scheduler_type",description:`<strong>lr_scheduler_type</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.SchedulerType">SchedulerType</a>, <em>optional</em>, defaults to <code>&quot;linear&quot;</code>) &#x2014;
The scheduler type to use. See the documentation of <a href="/docs/transformers/v4.32.0/en/main_classes/optimizer_schedules#transformers.SchedulerType">SchedulerType</a> for all possible values.`,name:"lr_scheduler_type"},{anchor:"transformers.Seq2SeqTrainingArguments.warmup_ratio",description:`<strong>warmup_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Ratio of total training steps used for a linear warmup from 0 to <code>learning_rate</code>.`,name:"warmup_ratio"},{anchor:"transformers.Seq2SeqTrainingArguments.warmup_steps",description:`<strong>warmup_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Number of steps used for a linear warmup from 0 to <code>learning_rate</code>. Overrides any effect of <code>warmup_ratio</code>.`,name:"warmup_steps"},{anchor:"transformers.Seq2SeqTrainingArguments.log_level",description:`<strong>log_level</strong> (<code>str</code>, <em>optional</em>, defaults to <code>passive</code>) &#x2014;
Logger log level to use on the main process. Possible choices are the log levels as strings: &#x2018;debug&#x2019;,
&#x2018;info&#x2019;, &#x2018;warning&#x2019;, &#x2018;error&#x2019; and &#x2018;critical&#x2019;, plus a &#x2018;passive&#x2019; level which doesn&#x2019;t set anything and keeps the
current log level for the Transformers library (which will be <code>&quot;warning&quot;</code> by default).`,name:"log_level"},{anchor:"transformers.Seq2SeqTrainingArguments.log_level_replica",description:`<strong>log_level_replica</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;warning&quot;</code>) &#x2014;
Logger log level to use on replicas. Same choices as <code>log_level</code>&#x201D;`,name:"log_level_replica"},{anchor:"transformers.Seq2SeqTrainingArguments.log_on_each_node",description:`<strong>log_on_each_node</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
In multinode distributed training, whether to log using <code>log_level</code> once per node, or only on the main
node.`,name:"log_on_each_node"},{anchor:"transformers.Seq2SeqTrainingArguments.logging_dir",description:`<strong>logging_dir</strong> (<code>str</code>, <em>optional</em>) &#x2014;
<a href="https://www.tensorflow.org/tensorboard" rel="nofollow">TensorBoard</a> log directory. Will default to
*output_dir/runs/<strong>CURRENT_DATETIME_HOSTNAME*</strong>.`,name:"logging_dir"},{anchor:"transformers.Seq2SeqTrainingArguments.logging_strategy",description:`<strong>logging_strategy</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.IntervalStrategy">IntervalStrategy</a>, <em>optional</em>, defaults to <code>&quot;steps&quot;</code>) &#x2014;
The logging strategy to adopt during training. Possible values are:</p>
<ul>
<li><code>&quot;no&quot;</code>: No logging is done during training.</li>
<li><code>&quot;epoch&quot;</code>: Logging is done at the end of each epoch.</li>
<li><code>&quot;steps&quot;</code>: Logging is done every <code>logging_steps</code>.</li>
</ul>`,name:"logging_strategy"},{anchor:"transformers.Seq2SeqTrainingArguments.logging_first_step",description:`<strong>logging_first_step</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to log and evaluate the first <code>global_step</code> or not.`,name:"logging_first_step"},{anchor:"transformers.Seq2SeqTrainingArguments.logging_steps",description:`<strong>logging_steps</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to 500) &#x2014;
Number of update steps between two logs if <code>logging_strategy=&quot;steps&quot;</code>. Should be an integer or a float in
range <code>[0,1)</code>. If smaller than 1, will be interpreted as ratio of total training steps.`,name:"logging_steps"},{anchor:"transformers.Seq2SeqTrainingArguments.logging_nan_inf_filter",description:`<strong>logging_nan_inf_filter</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to filter <code>nan</code> and <code>inf</code> losses for logging. If set to <code>True</code> the loss of every step that is <code>nan</code>
or <code>inf</code> is filtered and the average loss of the current logging window is taken instead.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p><code>logging_nan_inf_filter</code> only influences the logging of loss values, it does not change the behavior the
gradient is computed or applied to the model.</p>

					</div>`,name:"logging_nan_inf_filter"},{anchor:"transformers.Seq2SeqTrainingArguments.save_strategy",description:`<strong>save_strategy</strong> (<code>str</code> or <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.IntervalStrategy">IntervalStrategy</a>, <em>optional</em>, defaults to <code>&quot;steps&quot;</code>) &#x2014;
The checkpoint save strategy to adopt during training. Possible values are:</p>
<ul>
<li><code>&quot;no&quot;</code>: No save is done during training.</li>
<li><code>&quot;epoch&quot;</code>: Save is done at the end of each epoch.</li>
<li><code>&quot;steps&quot;</code>: Save is done every <code>save_steps</code>.</li>
</ul>`,name:"save_strategy"},{anchor:"transformers.Seq2SeqTrainingArguments.save_steps",description:`<strong>save_steps</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to 500) &#x2014;
Number of updates steps before two checkpoint saves if <code>save_strategy=&quot;steps&quot;</code>. Should be an integer or a
float in range <code>[0,1)</code>. If smaller than 1, will be interpreted as ratio of total training steps.`,name:"save_steps"},{anchor:"transformers.Seq2SeqTrainingArguments.save_total_limit",description:`<strong>save_total_limit</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a value is passed, will limit the total amount of checkpoints. Deletes the older checkpoints in
<code>output_dir</code>. When <code>load_best_model_at_end</code> is enabled, the &#x201C;best&#x201D; checkpoint according to
<code>metric_for_best_model</code> will always be retained in addition to the most recent ones. For example, for
<code>save_total_limit=5</code> and <code>load_best_model_at_end</code>, the four last checkpoints will always be retained
alongside the best model. When <code>save_total_limit=1</code> and <code>load_best_model_at_end</code>, it is possible that two
checkpoints are saved: the last one and the best one (if they are different).`,name:"save_total_limit"},{anchor:"transformers.Seq2SeqTrainingArguments.save_safetensors",description:`<strong>save_safetensors</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Use <a href="https://huggingface.co/docs/safetensors" rel="nofollow">safetensors</a> saving and loading for state dicts instead of
default <code>torch.load</code> and <code>torch.save</code>.`,name:"save_safetensors"},{anchor:"transformers.Seq2SeqTrainingArguments.save_on_each_node",description:`<strong>save_on_each_node</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
When doing multi-node distributed training, whether to save models and checkpoints on each node, or only on
the main one.</p>
<p>This should not be activated when the different nodes use the same storage as the files will be saved with
the same names for each node.`,name:"save_on_each_node"},{anchor:"transformers.Seq2SeqTrainingArguments.use_cpu",description:`<strong>use_cpu</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use cpu. If set to False, we will use cuda or mps device if available.`,name:"use_cpu"},{anchor:"transformers.Seq2SeqTrainingArguments.seed",description:`<strong>seed</strong> (<code>int</code>, <em>optional</em>, defaults to 42) &#x2014;
Random seed that will be set at the beginning of training. To ensure reproducibility across runs, use the
<code>~Trainer.model_init</code> function to instantiate the model if it has some randomly initialized parameters.`,name:"seed"},{anchor:"transformers.Seq2SeqTrainingArguments.data_seed",description:`<strong>data_seed</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Random seed to be used with data samplers. If not set, random generators for data sampling will use the
same seed as <code>seed</code>. This can be used to ensure reproducibility of data sampling, independent of the model
seed.`,name:"data_seed"},{anchor:"transformers.Seq2SeqTrainingArguments.jit_mode_eval",description:`<strong>jit_mode_eval</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use PyTorch jit trace for inference.`,name:"jit_mode_eval"},{anchor:"transformers.Seq2SeqTrainingArguments.use_ipex",description:`<strong>use_ipex</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Use Intel extension for PyTorch when it is available. <a href="https://github.com/intel/intel-extension-for-pytorch" rel="nofollow">IPEX
installation</a>.`,name:"use_ipex"},{anchor:"transformers.Seq2SeqTrainingArguments.bf16",description:`<strong>bf16</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use bf16 16-bit (mixed) precision training instead of 32-bit training. Requires Ampere or higher
NVIDIA architecture or using CPU (use_cpu). This is an experimental API and it may change.`,name:"bf16"},{anchor:"transformers.Seq2SeqTrainingArguments.fp16",description:`<strong>fp16</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use fp16 16-bit (mixed) precision training instead of 32-bit training.`,name:"fp16"},{anchor:"transformers.Seq2SeqTrainingArguments.fp16_opt_level",description:`<strong>fp16_opt_level</strong> (<code>str</code>, <em>optional</em>, defaults to &#x2018;O1&#x2019;) &#x2014;
For <code>fp16</code> training, Apex AMP optimization level selected in [&#x2018;O0&#x2019;, &#x2018;O1&#x2019;, &#x2018;O2&#x2019;, and &#x2018;O3&#x2019;]. See details on
the <a href="https://nvidia.github.io/apex/amp" rel="nofollow">Apex documentation</a>.`,name:"fp16_opt_level"},{anchor:"transformers.Seq2SeqTrainingArguments.fp16_backend",description:`<strong>fp16_backend</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
This argument is deprecated. Use <code>half_precision_backend</code> instead.`,name:"fp16_backend"},{anchor:"transformers.Seq2SeqTrainingArguments.half_precision_backend",description:`<strong>half_precision_backend</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
The backend to use for mixed precision training. Must be one of <code>&quot;auto&quot;, &quot;cuda_amp&quot;, &quot;apex&quot;, &quot;cpu_amp&quot;</code>.
<code>&quot;auto&quot;</code> will use CPU/CUDA AMP or APEX depending on the PyTorch version detected, while the other choices
will force the requested backend.`,name:"half_precision_backend"},{anchor:"transformers.Seq2SeqTrainingArguments.bf16_full_eval",description:`<strong>bf16_full_eval</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use full bfloat16 evaluation instead of 32-bit. This will be faster and save memory but can harm
metric values. This is an experimental API and it may change.`,name:"bf16_full_eval"},{anchor:"transformers.Seq2SeqTrainingArguments.fp16_full_eval",description:`<strong>fp16_full_eval</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use full float16 evaluation instead of 32-bit. This will be faster and save memory but can harm
metric values.`,name:"fp16_full_eval"},{anchor:"transformers.Seq2SeqTrainingArguments.tf32",description:`<strong>tf32</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to enable the TF32 mode, available in Ampere and newer GPU architectures. The default value depends
on PyTorch&#x2019;s version default of <code>torch.backends.cuda.matmul.allow_tf32</code>. For more details please refer to
the <a href="https://huggingface.co/docs/transformers/performance#tf32" rel="nofollow">TF32</a> documentation. This is an
experimental API and it may change.`,name:"tf32"},{anchor:"transformers.Seq2SeqTrainingArguments.local_rank",description:`<strong>local_rank</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Rank of the process during distributed training.`,name:"local_rank"},{anchor:"transformers.Seq2SeqTrainingArguments.ddp_backend",description:`<strong>ddp_backend</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The backend to use for distributed training. Must be one of <code>&quot;nccl&quot;</code>, <code>&quot;mpi&quot;</code>, <code>&quot;ccl&quot;</code>, <code>&quot;gloo&quot;</code>.`,name:"ddp_backend"},{anchor:"transformers.Seq2SeqTrainingArguments.tpu_num_cores",description:`<strong>tpu_num_cores</strong> (<code>int</code>, <em>optional</em>) &#x2014;
When training on TPU, the number of TPU cores (automatically passed by launcher script).`,name:"tpu_num_cores"},{anchor:"transformers.Seq2SeqTrainingArguments.dataloader_drop_last",description:`<strong>dataloader_drop_last</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to drop the last incomplete batch (if the length of the dataset is not divisible by the batch size)
or not.`,name:"dataloader_drop_last"},{anchor:"transformers.Seq2SeqTrainingArguments.eval_steps",description:`<strong>eval_steps</strong> (<code>int</code> or <code>float</code>, <em>optional</em>) &#x2014;
Number of update steps between two evaluations if <code>evaluation_strategy=&quot;steps&quot;</code>. Will default to the same
value as <code>logging_steps</code> if not set. Should be an integer or a float in range <code>[0,1)</code>. If smaller than 1,
will be interpreted as ratio of total training steps.`,name:"eval_steps"},{anchor:"transformers.Seq2SeqTrainingArguments.dataloader_num_workers",description:`<strong>dataloader_num_workers</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Number of subprocesses to use for data loading (PyTorch only). 0 means that the data will be loaded in the
main process.`,name:"dataloader_num_workers"},{anchor:"transformers.Seq2SeqTrainingArguments.past_index",description:`<strong>past_index</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Some models like <a href="../model_doc/transformerxl">TransformerXL</a> or <a href="../model_doc/xlnet">XLNet</a> can make use of
the past hidden states for their predictions. If this argument is set to a positive int, the <code>Trainer</code> will
use the corresponding output (usually index 2) as the past state and feed it to the model at the next
training step under the keyword argument <code>mems</code>.`,name:"past_index"},{anchor:"transformers.Seq2SeqTrainingArguments.run_name",description:`<strong>run_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
A descriptor for the run. Typically used for <a href="https://www.wandb.com/" rel="nofollow">wandb</a> and
<a href="https://www.mlflow.org/" rel="nofollow">mlflow</a> logging.`,name:"run_name"},{anchor:"transformers.Seq2SeqTrainingArguments.disable_tqdm",description:`<strong>disable_tqdm</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to disable the tqdm progress bars and table of metrics produced by
<code>~notebook.NotebookTrainingTracker</code> in Jupyter Notebooks. Will default to <code>True</code> if the logging level is
set to warn or lower (default), <code>False</code> otherwise.`,name:"disable_tqdm"},{anchor:"transformers.Seq2SeqTrainingArguments.remove_unused_columns",description:`<strong>remove_unused_columns</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to automatically remove the columns unused by the model forward method.</p>
<p>(Note that this behavior is not implemented for <code>TFTrainer</code> yet.)`,name:"remove_unused_columns"},{anchor:"transformers.Seq2SeqTrainingArguments.label_names",description:`<strong>label_names</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
The list of keys in your dictionary of inputs that correspond to the labels.</p>
<p>Will eventually default to the list of argument names accepted by the model that contain the word &#x201C;label&#x201D;,
except if the model used is one of the <code>XxxForQuestionAnswering</code> in which case it will also include the
<code>[&quot;start_positions&quot;, &quot;end_positions&quot;]</code> keys.`,name:"label_names"},{anchor:"transformers.Seq2SeqTrainingArguments.load_best_model_at_end",description:`<strong>load_best_model_at_end</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to load the best model found during training at the end of training. When this option is
enabled, the best checkpoint will always be saved. See
<a href="https://huggingface.co/docs/transformers/main_classes/trainer#transformers.TrainingArguments.save_total_limit" rel="nofollow"><code>save_total_limit</code></a>
for more.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When set to <code>True</code>, the parameters <code>save_strategy</code> needs to be the same as <code>evaluation_strategy</code>, and in
the case it is &#x201C;steps&#x201D;, <code>save_steps</code> must be a round multiple of <code>eval_steps</code>.</p>

					</div>`,name:"load_best_model_at_end"},{anchor:"transformers.Seq2SeqTrainingArguments.metric_for_best_model",description:`<strong>metric_for_best_model</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Use in conjunction with <code>load_best_model_at_end</code> to specify the metric to use to compare two different
models. Must be the name of a metric returned by the evaluation with or without the prefix <code>&quot;eval_&quot;</code>. Will
default to <code>&quot;loss&quot;</code> if unspecified and <code>load_best_model_at_end=True</code> (to use the evaluation loss).</p>
<p>If you set this value, <code>greater_is_better</code> will default to <code>True</code>. Don&#x2019;t forget to set it to <code>False</code> if
your metric is better when lower.`,name:"metric_for_best_model"},{anchor:"transformers.Seq2SeqTrainingArguments.greater_is_better",description:`<strong>greater_is_better</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Use in conjunction with <code>load_best_model_at_end</code> and <code>metric_for_best_model</code> to specify if better models
should have a greater metric or not. Will default to:</p>
<ul>
<li><code>True</code> if <code>metric_for_best_model</code> is set to a value that isn&#x2019;t <code>&quot;loss&quot;</code> or <code>&quot;eval_loss&quot;</code>.</li>
<li><code>False</code> if <code>metric_for_best_model</code> is not set, or set to <code>&quot;loss&quot;</code> or <code>&quot;eval_loss&quot;</code>.</li>
</ul>`,name:"greater_is_better"},{anchor:"transformers.Seq2SeqTrainingArguments.ignore_data_skip",description:`<strong>ignore_data_skip</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
When resuming training, whether or not to skip the epochs and batches to get the data loading at the same
stage as in the previous training. If set to <code>True</code>, the training will begin faster (as that skipping step
can take a long time) but will not yield the same results as the interrupted training would have.`,name:"ignore_data_skip"},{anchor:"transformers.Seq2SeqTrainingArguments.sharded_ddp",description:`<strong>sharded_ddp</strong> (<code>bool</code>, <code>str</code> or list of <code>ShardedDDPOption</code>, <em>optional</em>, defaults to <code>&apos;&apos;</code>) &#x2014;
Use Sharded DDP training from <a href="https://github.com/facebookresearch/fairscale" rel="nofollow">FairScale</a> (in distributed
training only). This is an experimental feature.</p>
<p>A list of options along the following:</p>
<ul>
<li><code>&quot;simple&quot;</code>: to use first instance of sharded DDP released by fairscale (<code>ShardedDDP</code>) similar to ZeRO-2.</li>
<li><code>&quot;zero_dp_2&quot;</code>: to use the second instance of sharded DPP released by fairscale (<code>FullyShardedDDP</code>) in
Zero-2 mode (with <code>reshard_after_forward=False</code>).</li>
<li><code>&quot;zero_dp_3&quot;</code>: to use the second instance of sharded DPP released by fairscale (<code>FullyShardedDDP</code>) in
Zero-3 mode (with <code>reshard_after_forward=True</code>).</li>
<li><code>&quot;offload&quot;</code>: to add ZeRO-offload (only compatible with <code>&quot;zero_dp_2&quot;</code> and <code>&quot;zero_dp_3&quot;</code>).</li>
</ul>
<p>If a string is passed, it will be split on space. If a bool is passed, it will be converted to an empty
list for <code>False</code> and <code>[&quot;simple&quot;]</code> for <code>True</code>.`,name:"sharded_ddp"},{anchor:"transformers.Seq2SeqTrainingArguments.fsdp",description:`<strong>fsdp</strong> (<code>bool</code>, <code>str</code> or list of <code>FSDPOption</code>, <em>optional</em>, defaults to <code>&apos;&apos;</code>) &#x2014;
Use PyTorch Distributed Parallel Training (in distributed training only).</p>
<p>A list of options along the following:</p>
<ul>
<li><code>&quot;full_shard&quot;</code>: Shard parameters, gradients and optimizer states.</li>
<li><code>&quot;shard_grad_op&quot;</code>: Shard optimizer states and gradients.</li>
<li><code>&quot;offload&quot;</code>: Offload parameters and gradients to CPUs (only compatible with <code>&quot;full_shard&quot;</code> and
<code>&quot;shard_grad_op&quot;</code>).</li>
<li><code>&quot;auto_wrap&quot;</code>: Automatically recursively wrap layers with FSDP using <code>default_auto_wrap_policy</code>.</li>
</ul>`,name:"fsdp"},{anchor:"transformers.Seq2SeqTrainingArguments.fsdp_config",description:`<strong>fsdp_config</strong> (<code>str</code> or <code>dict</code>, <em>optional</em>) &#x2014;
Config to be used with fsdp (Pytorch Distributed Parallel Training). The value is either a location of
deepspeed json config file (e.g., <code>ds_config.json</code>) or an already loaded json file as <code>dict</code>.</p>
<p>A List of config and its options:</p>
<ul>
<li>
<p>min_num_params (<code>int</code>, <em>optional</em>, defaults to <code>0</code>):
FSDP&#x2019;s minimum number of parameters for Default Auto Wrapping. (useful only when <code>fsdp</code> field is
passed).</p>
</li>
<li>
<p>transformer_layer_cls_to_wrap (<code>List[str]</code>, <em>optional</em>):
List of transformer layer class names (case-sensitive) to wrap, e.g, <code>BertLayer</code>, <code>GPTJBlock</code>,
<code>T5Block</code> &#x2026; (useful only when <code>fsdp</code> flag is passed).</p>
</li>
<li>
<p>backward_prefetch (<code>str</code>, <em>optional</em>)
FSDP&#x2019;s backward prefetch mode. Controls when to prefetch next set of parameters (useful only when
<code>fsdp</code> field is passed).</p>
<p>A list of options along the following:</p>
<ul>
<li><code>&quot;backward_pre&quot;</code> : Prefetches the next set of parameters before the current set of parameter&#x2019;s
gradient
computation.</li>
<li><code>&quot;backward_post&quot;</code> : This prefetches the next set of parameters after the current set of
parameter&#x2019;s
gradient computation.</li>
</ul>
</li>
<li>
<p>forward_prefetch (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>)
FSDP&#x2019;s forward prefetch mode (useful only when <code>fsdp</code> field is passed).
If <code>&quot;True&quot;</code>, then FSDP explicitly prefetches the next upcoming all-gather while executing in the
forward pass.</p>
</li>
<li>
<p>limit_all_gathers (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>)
FSDP&#x2019;s limit_all_gathers (useful only when <code>fsdp</code> field is passed).
If <code>&quot;True&quot;</code>, FSDP explicitly synchronizes the CPU thread to prevent too many in-flight
all-gathers.</p>
</li>
<li>
<p>use_orig_params (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>)
If <code>&quot;True&quot;</code>, allows non-uniform <code>requires_grad</code> during init, which means support for interspersed
frozen and trainable paramteres. Useful in cases such as parameter-efficient fine-tuning. Please
refer this
[blog](<a href="https://dev-discuss.pytorch.org/t/rethinking-pytorch-fully-sharded-data-parallel-fsdp-from-first-principles/1019" rel="nofollow">https://dev-discuss.pytorch.org/t/rethinking-pytorch-fully-sharded-data-parallel-fsdp-from-first-principles/1019</a></p>
</li>
<li>
<p>sync_module_states (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>)
If <code>&quot;True&quot;</code>, each individually wrapped FSDP unit will broadcast module parameters from rank 0 to
ensure they are the same across all ranks after initialization</p>
</li>
<li>
<p>xla (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>):
Whether to use PyTorch/XLA Fully Sharded Data Parallel Training. This is an experimental feature
and its API may evolve in the future.</p>
</li>
<li>
<p>xla_fsdp_settings (<code>dict</code>, <em>optional</em>)
The value is a dictionary which stores the XLA FSDP wrapping parameters.</p>
<p>For a complete list of options, please see <a href="https://github.com/pytorch/xla/blob/master/torch_xla/distributed/fsdp/xla_fully_sharded_data_parallel.py" rel="nofollow">here</a>.</p>
</li>
<li>
<p>xla_fsdp_grad_ckpt (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>):
Will use gradient checkpointing over each nested XLA FSDP wrapped layer. This setting can only be
used when the xla flag is set to true, and an auto wrapping policy is specified through
fsdp_min_num_params or fsdp_transformer_layer_cls_to_wrap.</p>
</li>
</ul>`,name:"fsdp_config"},{anchor:"transformers.Seq2SeqTrainingArguments.deepspeed",description:`<strong>deepspeed</strong> (<code>str</code> or <code>dict</code>, <em>optional</em>) &#x2014;
Use <a href="https://github.com/microsoft/deepspeed" rel="nofollow">Deepspeed</a>. This is an experimental feature and its API may
evolve in the future. The value is either the location of DeepSpeed json config file (e.g.,
<code>ds_config.json</code>) or an already loaded json file as a <code>dict</code>&#x201D;`,name:"deepspeed"},{anchor:"transformers.Seq2SeqTrainingArguments.label_smoothing_factor",description:`<strong>label_smoothing_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The label smoothing factor to use. Zero means no label smoothing, otherwise the underlying onehot-encoded
labels are changed from 0s and 1s to <code>label_smoothing_factor/num_labels</code> and <code>1 - label_smoothing_factor + label_smoothing_factor/num_labels</code> respectively.`,name:"label_smoothing_factor"},{anchor:"transformers.Seq2SeqTrainingArguments.debug",description:`<strong>debug</strong> (<code>str</code> or list of <code>DebugOption</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
Enable one or more debug features. This is an experimental feature.</p>
<p>Possible options are:</p>
<ul>
<li><code>&quot;underflow_overflow&quot;</code>: detects overflow in model&#x2019;s input/outputs and reports the last frames that led to
the event</li>
<li><code>&quot;tpu_metrics_debug&quot;</code>: print debug metrics on TPU</li>
</ul>
<p>The options should be separated by whitespaces.`,name:"debug"},{anchor:"transformers.Seq2SeqTrainingArguments.optim",description:`<strong>optim</strong> (<code>str</code> or <code>training_args.OptimizerNames</code>, <em>optional</em>, defaults to <code>&quot;adamw_torch&quot;</code>) &#x2014;
The optimizer to use: adamw_hf, adamw_torch, adamw_torch_fused, adamw_apex_fused, adamw_anyprecision or
adafactor.`,name:"optim"},{anchor:"transformers.Seq2SeqTrainingArguments.optim_args",description:`<strong>optim_args</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Optional arguments that are supplied to AnyPrecisionAdamW.`,name:"optim_args"},{anchor:"transformers.Seq2SeqTrainingArguments.group_by_length",description:`<strong>group_by_length</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to group together samples of roughly the same length in the training dataset (to minimize
padding applied and be more efficient). Only useful if applying dynamic padding.`,name:"group_by_length"},{anchor:"transformers.Seq2SeqTrainingArguments.length_column_name",description:`<strong>length_column_name</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;length&quot;</code>) &#x2014;
Column name for precomputed lengths. If the column exists, grouping by length will use these values rather
than computing them on train startup. Ignored unless <code>group_by_length</code> is <code>True</code> and the dataset is an
instance of <code>Dataset</code>.`,name:"length_column_name"},{anchor:"transformers.Seq2SeqTrainingArguments.report_to",description:`<strong>report_to</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>, defaults to <code>&quot;all&quot;</code>) &#x2014;
The list of integrations to report the results and logs to. Supported platforms are <code>&quot;azure_ml&quot;</code>,
<code>&quot;clearml&quot;</code>, <code>&quot;codecarbon&quot;</code>, <code>&quot;comet_ml&quot;</code>, <code>&quot;dagshub&quot;</code>, <code>&quot;flyte&quot;</code>, <code>&quot;mlflow&quot;</code>, <code>&quot;neptune&quot;</code>,
<code>&quot;tensorboard&quot;</code>, and <code>&quot;wandb&quot;</code>. Use <code>&quot;all&quot;</code> to report to all integrations installed, <code>&quot;none&quot;</code> for no
integrations.`,name:"report_to"},{anchor:"transformers.Seq2SeqTrainingArguments.ddp_find_unused_parameters",description:`<strong>ddp_find_unused_parameters</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
When using distributed training, the value of the flag <code>find_unused_parameters</code> passed to
<code>DistributedDataParallel</code>. Will default to <code>False</code> if gradient checkpointing is used, <code>True</code> otherwise.`,name:"ddp_find_unused_parameters"},{anchor:"transformers.Seq2SeqTrainingArguments.ddp_bucket_cap_mb",description:`<strong>ddp_bucket_cap_mb</strong> (<code>int</code>, <em>optional</em>) &#x2014;
When using distributed training, the value of the flag <code>bucket_cap_mb</code> passed to <code>DistributedDataParallel</code>.`,name:"ddp_bucket_cap_mb"},{anchor:"transformers.Seq2SeqTrainingArguments.ddp_broadcast_buffers",description:`<strong>ddp_broadcast_buffers</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
When using distributed training, the value of the flag <code>broadcast_buffers</code> passed to
<code>DistributedDataParallel</code>. Will default to <code>False</code> if gradient checkpointing is used, <code>True</code> otherwise.`,name:"ddp_broadcast_buffers"},{anchor:"transformers.Seq2SeqTrainingArguments.dataloader_pin_memory",description:`<strong>dataloader_pin_memory</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether you want to pin memory in data loaders or not. Will default to <code>True</code>.`,name:"dataloader_pin_memory"},{anchor:"transformers.Seq2SeqTrainingArguments.skip_memory_metrics",description:`<strong>skip_memory_metrics</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to skip adding of memory profiler reports to metrics. This is skipped by default because it slows
down the training and evaluation speed.`,name:"skip_memory_metrics"},{anchor:"transformers.Seq2SeqTrainingArguments.push_to_hub",description:`<strong>push_to_hub</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to push the model to the Hub every time the model is saved. If this is activated,
<code>output_dir</code> will begin a git directory synced with the repo (determined by <code>hub_model_id</code>) and the content
will be pushed each time a save is triggered (depending on your <code>save_strategy</code>). Calling
<a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer.save_model">save_model()</a> will also trigger a push.</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>If <code>output_dir</code> exists, it needs to be a local clone of the repository to which the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a> will be
pushed.</p>

					</div>`,name:"push_to_hub"},{anchor:"transformers.Seq2SeqTrainingArguments.resume_from_checkpoint",description:`<strong>resume_from_checkpoint</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The path to a folder with a valid checkpoint for your model. This argument is not directly used by
<a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>, it&#x2019;s intended to be used by your training/evaluation scripts instead. See the <a href="https://github.com/huggingface/transformers/tree/main/examples" rel="nofollow">example
scripts</a> for more details.`,name:"resume_from_checkpoint"},{anchor:"transformers.Seq2SeqTrainingArguments.hub_model_id",description:`<strong>hub_model_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name of the repository to keep in sync with the local <em>output_dir</em>. It can be a simple model ID in
which case the model will be pushed in your namespace. Otherwise it should be the whole repository name,
for instance <code>&quot;user_name/model&quot;</code>, which allows you to push to an organization you are a member of with
<code>&quot;organization_name/model&quot;</code>. Will default to <code>user_name/output_dir_name</code> with <em>output_dir_name</em> being the
name of <code>output_dir</code>.</p>
<p>Will default to the name of <code>output_dir</code>.`,name:"hub_model_id"},{anchor:"transformers.Seq2SeqTrainingArguments.hub_strategy",description:`<strong>hub_strategy</strong> (<code>str</code> or <code>HubStrategy</code>, <em>optional</em>, defaults to <code>&quot;every_save&quot;</code>) &#x2014;
Defines the scope of what is pushed to the Hub and when. Possible values are:</p>
<ul>
<li><code>&quot;end&quot;</code>: push the model, its configuration, the tokenizer (if passed along to the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>) and a
draft of a model card when the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer.save_model">save_model()</a> method is called.</li>
<li><code>&quot;every_save&quot;</code>: push the model, its configuration, the tokenizer (if passed along to the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>) and
a draft of a model card each time there is a model save. The pushes are asynchronous to not block
training, and in case the save are very frequent, a new push is only attempted if the previous one is
finished. A last push is made with the final model at the end of training.</li>
<li><code>&quot;checkpoint&quot;</code>: like <code>&quot;every_save&quot;</code> but the latest checkpoint is also pushed in a subfolder named
last-checkpoint, allowing you to resume training easily with
<code>trainer.train(resume_from_checkpoint=&quot;last-checkpoint&quot;)</code>.</li>
<li><code>&quot;all_checkpoints&quot;</code>: like <code>&quot;checkpoint&quot;</code> but all checkpoints are pushed like they appear in the output
folder (so you will get one checkpoint folder per folder in your final repository)</li>
</ul>`,name:"hub_strategy"},{anchor:"transformers.Seq2SeqTrainingArguments.hub_token",description:`<strong>hub_token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to use to push the model to the Hub. Will default to the token in the cache folder obtained with
<code>huggingface-cli login</code>.`,name:"hub_token"},{anchor:"transformers.Seq2SeqTrainingArguments.hub_private_repo",description:`<strong>hub_private_repo</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If True, the Hub repo will be set to private.`,name:"hub_private_repo"},{anchor:"transformers.Seq2SeqTrainingArguments.hub_always_push",description:`<strong>hub_always_push</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Unless this is <code>True</code>, the <code>Trainer</code> will skip pushing a checkpoint when the previous push is not finished.`,name:"hub_always_push"},{anchor:"transformers.Seq2SeqTrainingArguments.gradient_checkpointing",description:`<strong>gradient_checkpointing</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If True, use gradient checkpointing to save memory at the expense of slower backward pass.`,name:"gradient_checkpointing"},{anchor:"transformers.Seq2SeqTrainingArguments.include_inputs_for_metrics",description:`<strong>include_inputs_for_metrics</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the inputs will be passed to the <code>compute_metrics</code> function. This is intended for metrics
that need inputs, predictions and references for scoring calculation in Metric class.`,name:"include_inputs_for_metrics"},{anchor:"transformers.Seq2SeqTrainingArguments.auto_find_batch_size",description:`<strong>auto_find_batch_size</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to find a batch size that will fit into memory automatically through exponential decay, avoiding
CUDA Out-of-Memory errors. Requires accelerate to be installed (<code>pip install accelerate</code>)`,name:"auto_find_batch_size"},{anchor:"transformers.Seq2SeqTrainingArguments.full_determinism",description:`<strong>full_determinism</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.enable_full_determinism">enable_full_determinism()</a> is called instead of <a href="/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.set_seed">set_seed()</a> to ensure reproducible results in
distributed training. Important: this will negatively impact the performance, so only use it for debugging.`,name:"full_determinism"},{anchor:"transformers.Seq2SeqTrainingArguments.torchdynamo",description:`<strong>torchdynamo</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If set, the backend compiler for TorchDynamo. Possible choices are <code>&quot;eager&quot;</code>, <code>&quot;aot_eager&quot;</code>, <code>&quot;inductor&quot;</code>,
<code>&quot;nvfuser&quot;</code>, <code>&quot;aot_nvfuser&quot;</code>, <code>&quot;aot_cudagraphs&quot;</code>, <code>&quot;ofi&quot;</code>, <code>&quot;fx2trt&quot;</code>, <code>&quot;onnxrt&quot;</code> and <code>&quot;ipex&quot;</code>.`,name:"torchdynamo"},{anchor:"transformers.Seq2SeqTrainingArguments.ray_scope",description:`<strong>ray_scope</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;last&quot;</code>) &#x2014;
The scope to use when doing hyperparameter search with Ray. By default, <code>&quot;last&quot;</code> will be used. Ray will
then use the last checkpoint of all trials, compare those, and select the best one. However, other options
are also available. See the <a href="https://docs.ray.io/en/latest/tune/api_docs/analysis.html#ray.tune.ExperimentAnalysis.get_best_trial" rel="nofollow">Ray documentation</a> for
more options.`,name:"ray_scope"},{anchor:"transformers.Seq2SeqTrainingArguments.ddp_timeout",description:`<strong>ddp_timeout</strong> (<code>int</code>, <em>optional</em>, defaults to 1800) &#x2014;
The timeout for <code>torch.distributed.init_process_group</code> calls, used to avoid GPU socket timeouts when
performing slow operations in distributed runnings. Please refer the [PyTorch documentation]
(<a href="https://pytorch.org/docs/stable/distributed.html#torch.distributed.init_process_group" rel="nofollow">https://pytorch.org/docs/stable/distributed.html#torch.distributed.init_process_group</a>) for more
information.`,name:"ddp_timeout"},{anchor:"transformers.Seq2SeqTrainingArguments.use_mps_device",description:`<strong>use_mps_device</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
This argument is deprecated.<code>mps</code> device will be used if it is available similar to <code>cuda</code> device.`,name:"use_mps_device"},{anchor:"transformers.Seq2SeqTrainingArguments.torch_compile",description:`<strong>torch_compile</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to compile the model using PyTorch 2.0
<a href="https://pytorch.org/get-started/pytorch-2.0/" rel="nofollow"><code>torch.compile</code></a>.</p>
<p>This will use the best defaults for the <a href="https://pytorch.org/docs/stable/generated/torch.compile.html?highlight=torch+compile#torch.compile" rel="nofollow"><code>torch.compile</code>
API</a>.
You can customize the defaults with the argument <code>torch_compile_backend</code> and <code>torch_compile_mode</code> but we
don&#x2019;t guarantee any of them will work as the support is progressively rolled in in PyTorch.</p>
<p>This flag and the whole compile API is experimental and subject to change in future releases.`,name:"torch_compile"},{anchor:"transformers.Seq2SeqTrainingArguments.torch_compile_backend",description:`<strong>torch_compile_backend</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The backend to use in <code>torch.compile</code>. If set to any value, <code>torch_compile</code> will be set to <code>True</code>.</p>
<p>Refer to the PyTorch doc for possible values and note that they may change across PyTorch versions.</p>
<p>This flag is experimental and subject to change in future releases.`,name:"torch_compile_backend"},{anchor:"transformers.Seq2SeqTrainingArguments.torch_compile_mode",description:`<strong>torch_compile_mode</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The mode to use in <code>torch.compile</code>. If set to any value, <code>torch_compile</code> will be set to <code>True</code>.</p>
<p>Refer to the PyTorch doc for possible values and note that they may change across PyTorch versions.</p>
<p>This flag is experimental and subject to change in future releases.`,name:"torch_compile_mode"},{anchor:"transformers.Seq2SeqTrainingArguments.sortish_sampler",description:`<strong>sortish_sampler</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a <em>sortish sampler</em> or not. Only possible if the underlying datasets are <em>Seq2SeqDataset</em>
for now but will become generally available in the near future.</p>
<p>It sorts the inputs according to lengths in order to minimize the padding size, with a bit of randomness
for the training set.`,name:"sortish_sampler"},{anchor:"transformers.Seq2SeqTrainingArguments.predict_with_generate",description:`<strong>predict_with_generate</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use generate to calculate generative metrics (ROUGE, BLEU).`,name:"predict_with_generate"},{anchor:"transformers.Seq2SeqTrainingArguments.generation_max_length",description:`<strong>generation_max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The <code>max_length</code> to use on each evaluation loop when <code>predict_with_generate=True</code>. Will default to the
<code>max_length</code> value of the model configuration.`,name:"generation_max_length"},{anchor:"transformers.Seq2SeqTrainingArguments.generation_num_beams",description:`<strong>generation_num_beams</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The <code>num_beams</code> to use on each evaluation loop when <code>predict_with_generate=True</code>. Will default to the
<code>num_beams</code> value of the model configuration.`,name:"generation_num_beams"},{anchor:"transformers.Seq2SeqTrainingArguments.generation_config",description:`<strong>generation_config</strong> (<code>str</code> or <code>Path</code> or <a href="/docs/transformers/v4.32.0/en/main_classes/text_generation#transformers.GenerationConfig">GenerationConfig</a>, <em>optional</em>) &#x2014;
Allows to load a <a href="/docs/transformers/v4.32.0/en/main_classes/text_generation#transformers.GenerationConfig">GenerationConfig</a> from the <code>from_pretrained</code> method. This can be either:</p>
<ul>
<li>a string, the <em>model id</em> of a pretrained model configuration hosted inside a model repo on
huggingface.co. Valid model ids can be located at the root-level, like <code>bert-base-uncased</code>, or namespaced
under a user or organization name, like <code>dbmdz/bert-base-german-cased</code>.</li>
<li>a path to a <em>directory</em> containing a configuration file saved using the
<a href="/docs/transformers/v4.32.0/en/main_classes/text_generation#transformers.GenerationConfig.save_pretrained">save_pretrained()</a> method, e.g., <code>./my_model_directory/</code>.</li>
<li>a <a href="/docs/transformers/v4.32.0/en/main_classes/text_generation#transformers.GenerationConfig">GenerationConfig</a> object.</li>
</ul>`,name:"generation_config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args_seq2seq.py#L30"}}),si=new S({props:{name:"to_dict",anchor:"transformers.Seq2SeqTrainingArguments.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/training_args_seq2seq.py#L87"}}),ii=new oe({}),li=new oe({}),di=new D({props:{code:"JTVCLi4uJTVEJTBBbG9nZ2VyJTIwJTNEJTIwbG9nZ2luZy5nZXRMb2dnZXIoX19uYW1lX18pJTBBJTBBJTIzJTIwU2V0dXAlMjBsb2dnaW5nJTBBbG9nZ2luZy5iYXNpY0NvbmZpZyglMEElMjAlMjAlMjAlMjBmb3JtYXQlM0QlMjIlMjUoYXNjdGltZSlzJTIwLSUyMCUyNShsZXZlbG5hbWUpcyUyMC0lMjAlMjUobmFtZSlzJTIwLSUyMCUyNShtZXNzYWdlKXMlMjIlMkMlMEElMjAlMjAlMjAlMjBkYXRlZm10JTNEJTIyJTI1bSUyRiUyNWQlMkYlMjVZJTIwJTI1SCUzQSUyNU0lM0ElMjVTJTIyJTJDJTBBJTIwJTIwJTIwJTIwaGFuZGxlcnMlM0QlNUJsb2dnaW5nLlN0cmVhbUhhbmRsZXIoc3lzLnN0ZG91dCklNUQlMkMlMEEpJTBBJTBBJTIzJTIwc2V0JTIwdGhlJTIwbWFpbiUyMGNvZGUlMjBhbmQlMjB0aGUlMjBtb2R1bGVzJTIwaXQlMjB1c2VzJTIwdG8lMjB0aGUlMjBzYW1lJTIwbG9nLWxldmVsJTIwYWNjb3JkaW5nJTIwdG8lMjB0aGUlMjBub2RlJTBBbG9nX2xldmVsJTIwJTNEJTIwdHJhaW5pbmdfYXJncy5nZXRfcHJvY2Vzc19sb2dfbGV2ZWwoKSUwQWxvZ2dlci5zZXRMZXZlbChsb2dfbGV2ZWwpJTBBZGF0YXNldHMudXRpbHMubG9nZ2luZy5zZXRfdmVyYm9zaXR5KGxvZ19sZXZlbCklMEF0cmFuc2Zvcm1lcnMudXRpbHMubG9nZ2luZy5zZXRfdmVyYm9zaXR5KGxvZ19sZXZlbCklMEElMEF0cmFpbmVyJTIwJTNEJTIwVHJhaW5lciguLi4p",highlighted:`[...]
logger = logging.getLogger(__name__)

<span class="hljs-comment"># Setup logging</span>
logging.basicConfig(
    <span class="hljs-built_in">format</span>=<span class="hljs-string">&quot;%(asctime)s - %(levelname)s - %(name)s - %(message)s&quot;</span>,
    datefmt=<span class="hljs-string">&quot;%m/%d/%Y %H:%M:%S&quot;</span>,
    handlers=[logging.StreamHandler(sys.stdout)],
)

<span class="hljs-comment"># set the main code and the modules it uses to the same log-level according to the node</span>
log_level = training_args.get_process_log_level()
logger.setLevel(log_level)
datasets.utils.logging.set_verbosity(log_level)
transformers.utils.logging.set_verbosity(log_level)

trainer = Trainer(...)`}}),ci=new D({props:{code:"bXlfYXBwLnB5JTIwLi4uJTIwLS1sb2dfbGV2ZWwlMjB3YXJuaW5nJTIwLS1sb2dfbGV2ZWxfcmVwbGljYSUyMGVycm9y",highlighted:"my_app.py ... --log_level warning --log_level_replica error"}}),pi=new D({props:{code:"bXlfYXBwLnB5JTIwLi4uJTIwLS1sb2dfbGV2ZWwlMjB3YXJuaW5nJTIwLS1sb2dfbGV2ZWxfcmVwbGljYSUyMGVycm9yJTIwLS1sb2dfb25fZWFjaF9ub2RlJTIwMA==",highlighted:"my_app.py ... --log_level warning --log_level_replica error --log_on_each_node 0"}}),mi=new D({props:{code:"bXlfYXBwLnB5JTIwLi4uJTIwLS1sb2dfbGV2ZWwlMjBlcnJvciUyMC0tbG9nX2xldmVsX3JlcGxpY2ElMjBlcnJvciUyMC0tbG9nX29uX2VhY2hfbm9kZSUyMDA=",highlighted:"my_app.py ... --log_level error --log_level_replica error --log_on_each_node 0"}}),hi=new oe({}),fi=new oe({}),_i=new D({props:{code:"cHl0aG9uJTIwLW0lMjB0b3JjaC5kaXN0cmlidXRlZC5sYXVuY2glMjAtLW5wcm9jX3Blcl9ub2RlJTNEMiUyMCUyMHRyYWluZXItcHJvZ3JhbS5weSUyMC4uLg==",highlighted:"python -m torch.distributed.launch --nproc_per_node=2  trainer-program.py ..."}}),yi=new D({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMC0tbnVtX3Byb2Nlc3NlcyUyMDIlMjB0cmFpbmVyLXByb2dyYW0ucHklMjAuLi4=",highlighted:"accelerate launch --num_processes 2 trainer-program.py ..."}}),wi=new D({props:{code:"ZGVlcHNwZWVkJTIwLS1udW1fZ3B1cyUyMDIlMjB0cmFpbmVyLXByb2dyYW0ucHklMjAuLi4=",highlighted:"deepspeed --num_gpus 2 trainer-program.py ..."}}),Ti=new D({props:{code:"Q1VEQV9WSVNJQkxFX0RFVklDRVMlM0QwJTJDMiUyMHB5dGhvbiUyMC1tJTIwdG9yY2guZGlzdHJpYnV0ZWQubGF1bmNoJTIwdHJhaW5lci1wcm9ncmFtLnB5JTIwLi4u",highlighted:"CUDA_VISIBLE_DEVICES=0,2 python -m torch.distributed.launch trainer-program.py ..."}}),Ei=new D({props:{code:"Q1VEQV9WSVNJQkxFX0RFVklDRVMlM0QyJTJDMCUyMHB5dGhvbiUyMC1tJTIwdG9yY2guZGlzdHJpYnV0ZWQubGF1bmNoJTIwdHJhaW5lci1wcm9ncmFtLnB5JTIwLi4u",highlighted:"CUDA_VISIBLE_DEVICES=2,0 python -m torch.distributed.launch trainer-program.py ..."}}),$i=new D({props:{code:"Q1VEQV9WSVNJQkxFX0RFVklDRVMlM0QyJTJDMCUyMHB5dGhvbiUyMHRyYWluZXItcHJvZ3JhbS5weSUyMC4uLg==",highlighted:"CUDA_VISIBLE_DEVICES=2,0 python trainer-program.py ..."}}),ki=new D({props:{code:"Q1VEQV9WSVNJQkxFX0RFVklDRVMlM0QlMjBweXRob24lMjB0cmFpbmVyLXByb2dyYW0ucHklMjAuLi4=",highlighted:"CUDA_VISIBLE_DEVICES= python trainer-program.py ..."}}),xi=new D({props:{code:"ZXhwb3J0JTIwQ1VEQV9WSVNJQkxFX0RFVklDRVMlM0QwJTJDMiUwQXB5dGhvbiUyMC1tJTIwdG9yY2guZGlzdHJpYnV0ZWQubGF1bmNoJTIwdHJhaW5lci1wcm9ncmFtLnB5JTIwLi4u",highlighted:`<span class="hljs-built_in">export</span> CUDA_VISIBLE_DEVICES=0,2
python -m torch.distributed.launch trainer-program.py ...`}}),Ii=new D({props:{code:"ZXhwb3J0JTIwQ1VEQV9ERVZJQ0VfT1JERVIlM0RQQ0lfQlVTX0lE",highlighted:'<span class="hljs-built_in">export</span> CUDA_DEVICE_ORDER=PCI_BUS_ID'}}),qi=new D({props:{code:"ZXhwb3J0JTIwQ1VEQV9ERVZJQ0VfT1JERVIlM0RGQVNURVNUX0ZJUlNU",highlighted:'<span class="hljs-built_in">export</span> CUDA_DEVICE_ORDER=FASTEST_FIRST'}}),Ui=new D({props:{code:"ZXhwb3J0JTIwQ1VEQV9WSVNJQkxFX0RFVklDRVMlM0QxJTJDMA==",highlighted:'<span class="hljs-built_in">export</span> CUDA_VISIBLE_DEVICES=1,0'}}),Di=new oe({}),Ci=new oe({}),Ni=new D({props:{code:"cGlwJTIwaW5zdGFsbCUyMGRlZXBzcGVlZA==",highlighted:"pip install deepspeed"}}),zi=new oe({}),Oi=new D({props:{code:"d2hpY2glMjBudmNj",highlighted:'<span class="hljs-built_in">which</span> nvcc'}}),Ri=new oe({}),Li=new D({props:{code:"JTJGdXNyJTJGbG9jYWwlMkZjdWRhLTEwLjIlMEElMkZ1c3IlMkZsb2NhbCUyRmN1ZGEtMTEuMA==",highlighted:`/usr/local/cuda-10.2
/usr/local/cuda-11.0`}}),Bi=new D({props:{code:"ZWNobyUyMCUyNFBBVEglMEFlY2hvJTIwJTI0TERfTElCUkFSWV9QQVRI",highlighted:`<span class="hljs-built_in">echo</span> <span class="hljs-variable">$PATH</span>
<span class="hljs-built_in">echo</span> <span class="hljs-variable">$LD_LIBRARY_PATH</span>`}}),Gi=new D({props:{code:"ZXhwb3J0JTIwUEFUSCUzRCUyRnVzciUyRmxvY2FsJTJGY3VkYS0xMC4yJTJGYmluJTNBJTI0UEFUSCUwQWV4cG9ydCUyMExEX0xJQlJBUllfUEFUSCUzRCUyRnVzciUyRmxvY2FsJTJGY3VkYS0xMC4yJTJGbGliNjQlM0ElMjRMRF9MSUJSQVJZX1BBVEg=",highlighted:`<span class="hljs-built_in">export</span> PATH=/usr/local/cuda-10.2/bin:<span class="hljs-variable">$PATH</span>
<span class="hljs-built_in">export</span> LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64:<span class="hljs-variable">$LD_LIBRARY_PATH</span>`}}),Zi=new oe({}),Vi=new D({props:{code:"c3VkbyUyMGxuJTIwLXMlMjAlMkZ1c3IlMkZiaW4lMkZnY2MtNyUyMCUyMCUyRnVzciUyRmxvY2FsJTJGY3VkYS0xMC4yJTJGYmluJTJGZ2NjJTBBc3VkbyUyMGxuJTIwLXMlMjAlMkZ1c3IlMkZiaW4lMkZnJTJCJTJCLTclMjAlMjAlMkZ1c3IlMkZsb2NhbCUyRmN1ZGEtMTAuMiUyRmJpbiUyRmclMkIlMkI=",highlighted:`sudo <span class="hljs-built_in">ln</span> -s /usr/bin/gcc-7  /usr/local/cuda-10.2/bin/gcc
sudo <span class="hljs-built_in">ln</span> -s /usr/bin/g++-7  /usr/local/cuda-10.2/bin/g++`}}),Xi=new oe({}),ll=new oe({}),gl=new oe({}),Oa=new ur({props:{warning:!1,$$slots:{default:[KL]},$$scope:{ctx:U}}}),yl=new D({props:{code:"ZXhwb3J0JTIwVEFTS19OQU1FJTNEbXJwYyUwQSUwQXB5dGhvbiUyMGV4YW1wbGVzJTJGcHl0b3JjaCUyRnRleHQtY2xhc3NpZmljYXRpb24lMkZydW5fZ2x1ZS5weSUyMCU1QyUwQSUyMCUyMC0tbW9kZWxfbmFtZV9vcl9wYXRoJTIwYmVydC1iYXNlLWNhc2VkJTIwJTVDJTBBJTIwJTIwLS10YXNrX25hbWUlMjAlMjRUQVNLX05BTUUlMjAlNUMlMEElMjAlMjAtLWRvX3RyYWluJTIwJTVDJTBBJTIwJTIwLS1kb19ldmFsJTIwJTVDJTBBJTIwJTIwLS1tYXhfc2VxX2xlbmd0aCUyMDEyOCUyMCU1QyUwQSUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTIwMzIlMjAlNUMlMEElMjAlMjAtLWxlYXJuaW5nX3JhdGUlMjAyZS01JTIwJTVDJTBBJTIwJTIwLS1udW1fdHJhaW5fZXBvY2hzJTIwMyUyMCU1QyUwQSUyMCUyMC0tb3V0cHV0X2RpciUyMCUyRnRtcCUyRiUyNFRBU0tfTkFNRSUyRiUyMCU1QyUwQSUyMCUyMC0tb3ZlcndyaXRlX291dHB1dF9kaXI=",highlighted:`<span class="hljs-built_in">export</span> TASK_NAME=mrpc

python examples/pytorch/text-classification/run_glue.py \\
  --model_name_or_path bert-base-cased \\
  --task_name <span class="hljs-variable">$TASK_NAME</span> \\
  --do_train \\
  --do_eval \\
  --max_seq_length 128 \\
  --per_device_train_batch_size 32 \\
  --learning_rate 2e-5 \\
  --num_train_epochs 3 \\
  --output_dir /tmp/<span class="hljs-variable">$TASK_NAME</span>/ \\
  --overwrite_output_dir`}}),El=new oe({}),$l=new D({props:{code:"Y29tcHV0ZV9lbnZpcm9ubWVudCUzQSUyMExPQ0FMX01BQ0hJTkUlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEFkaXN0cmlidXRlZF90eXBlJTNBJTIwTVVMVElfR1BVJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTBBZG93bmNhc3RfYmYxNiUzQSUyMCdubyclMEFncHVfaWRzJTNBJTIwYWxsJTBBbWFjaGluZV9yYW5rJTNBJTIwMCUyMCUyM2NoYW5nZSUyMHJhbmslMjBhcyUyMHBlciUyMHRoZSUyMG5vZGUlMEFtYWluX3Byb2Nlc3NfaXAlM0ElMjAxOTIuMTY4LjIwLjElMEFtYWluX3Byb2Nlc3NfcG9ydCUzQSUyMDk4OTglMEFtYWluX3RyYWluaW5nX2Z1bmN0aW9uJTNBJTIwbWFpbiUwQW1peGVkX3ByZWNpc2lvbiUzQSUyMGZwMTYlMEFudW1fbWFjaGluZXMlM0ElMjAyJTBBbnVtX3Byb2Nlc3NlcyUzQSUyMDglMEFyZHp2X2JhY2tlbmQlM0ElMjBzdGF0aWMlMEFzYW1lX25ldHdvcmslM0ElMjB0cnVlJTBBdHB1X2VudiUzQSUyMCU1QiU1RCUwQXRwdV91c2VfY2x1c3RlciUzQSUyMGZhbHNlJTBBdHB1X3VzZV9zdWRvJTNBJTIwZmFsc2UlMEF1c2VfY3B1JTNBJTIwZmFsc2U=",highlighted:`<span class="hljs-attr">compute_environment:</span> <span class="hljs-string">LOCAL_MACHINE</span>                                                                                             
<span class="hljs-attr">distributed_type:</span> <span class="hljs-string">MULTI_GPU</span>                                                                                                    
<span class="hljs-attr">downcast_bf16:</span> <span class="hljs-string">&#x27;no&#x27;</span>
<span class="hljs-attr">gpu_ids:</span> <span class="hljs-string">all</span>
<span class="hljs-attr">machine_rank:</span> <span class="hljs-number">0</span> <span class="hljs-comment">#change rank as per the node</span>
<span class="hljs-attr">main_process_ip:</span> <span class="hljs-number">192.168</span><span class="hljs-number">.20</span><span class="hljs-number">.1</span>
<span class="hljs-attr">main_process_port:</span> <span class="hljs-number">9898</span>
<span class="hljs-attr">main_training_function:</span> <span class="hljs-string">main</span>
<span class="hljs-attr">mixed_precision:</span> <span class="hljs-string">fp16</span>
<span class="hljs-attr">num_machines:</span> <span class="hljs-number">2</span>
<span class="hljs-attr">num_processes:</span> <span class="hljs-number">8</span>
<span class="hljs-attr">rdzv_backend:</span> <span class="hljs-string">static</span>
<span class="hljs-attr">same_network:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">tpu_env:</span> []
<span class="hljs-attr">tpu_use_cluster:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">tpu_use_sudo:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">use_cpu:</span> <span class="hljs-literal">false</span>`}}),kl=new D({props:{code:"Y29tcHV0ZV9lbnZpcm9ubWVudCUzQSUyMExPQ0FMX01BQ0hJTkUlMEFkaXN0cmlidXRlZF90eXBlJTNBJTIwRlNEUCUwQWRvd25jYXN0X2JmMTYlM0ElMjAnbm8nJTBBZnNkcF9jb25maWclM0ElMEElMjAlMjBmc2RwX2F1dG9fd3JhcF9wb2xpY3klM0ElMjBUUkFOU0ZPUk1FUl9CQVNFRF9XUkFQJTBBJTIwJTIwZnNkcF9iYWNrd2FyZF9wcmVmZXRjaF9wb2xpY3klM0ElMjBCQUNLV0FSRF9QUkUlMEElMjAlMjBmc2RwX2ZvcndhcmRfcHJlZmV0Y2glM0ElMjB0cnVlJTBBJTIwJTIwZnNkcF9vZmZsb2FkX3BhcmFtcyUzQSUyMGZhbHNlJTBBJTIwJTIwZnNkcF9zaGFyZGluZ19zdHJhdGVneSUzQSUyMDElMEElMjAlMjBmc2RwX3N0YXRlX2RpY3RfdHlwZSUzQSUyMEZVTExfU1RBVEVfRElDVCUwQSUyMCUyMGZzZHBfc3luY19tb2R1bGVfc3RhdGVzJTNBJTIwdHJ1ZSUwQSUyMCUyMGZzZHBfdHJhbnNmb3JtZXJfbGF5ZXJfY2xzX3RvX3dyYXAlM0ElMjBCZXJ0TGF5ZXIlMEElMjAlMjBmc2RwX3VzZV9vcmlnX3BhcmFtcyUzQSUyMHRydWUlMEFtYWNoaW5lX3JhbmslM0ElMjAwJTBBbWFpbl90cmFpbmluZ19mdW5jdGlvbiUzQSUyMG1haW4lMEFtaXhlZF9wcmVjaXNpb24lM0ElMjBiZjE2JTBBbnVtX21hY2hpbmVzJTNBJTIwMSUwQW51bV9wcm9jZXNzZXMlM0ElMjAyJTBBcmR6dl9iYWNrZW5kJTNBJTIwc3RhdGljJTBBc2FtZV9uZXR3b3JrJTNBJTIwdHJ1ZSUwQXRwdV9lbnYlM0ElMjAlNUIlNUQlMEF0cHVfdXNlX2NsdXN0ZXIlM0ElMjBmYWxzZSUwQXRwdV91c2Vfc3VkbyUzQSUyMGZhbHNlJTBBdXNlX2NwdSUzQSUyMGZhbHNl",highlighted:`<span class="hljs-attr">compute_environment:</span> <span class="hljs-string">LOCAL_MACHINE</span>
<span class="hljs-attr">distributed_type:</span> <span class="hljs-string">FSDP</span>
<span class="hljs-attr">downcast_bf16:</span> <span class="hljs-string">&#x27;no&#x27;</span>
<span class="hljs-attr">fsdp_config:</span>
  <span class="hljs-attr">fsdp_auto_wrap_policy:</span> <span class="hljs-string">TRANSFORMER_BASED_WRAP</span>
  <span class="hljs-attr">fsdp_backward_prefetch_policy:</span> <span class="hljs-string">BACKWARD_PRE</span>
  <span class="hljs-attr">fsdp_forward_prefetch:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">fsdp_offload_params:</span> <span class="hljs-literal">false</span>
  <span class="hljs-attr">fsdp_sharding_strategy:</span> <span class="hljs-number">1</span>
  <span class="hljs-attr">fsdp_state_dict_type:</span> <span class="hljs-string">FULL_STATE_DICT</span>
  <span class="hljs-attr">fsdp_sync_module_states:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">fsdp_transformer_layer_cls_to_wrap:</span> <span class="hljs-string">BertLayer</span>
  <span class="hljs-attr">fsdp_use_orig_params:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">machine_rank:</span> <span class="hljs-number">0</span>
<span class="hljs-attr">main_training_function:</span> <span class="hljs-string">main</span>
<span class="hljs-attr">mixed_precision:</span> <span class="hljs-string">bf16</span>
<span class="hljs-attr">num_machines:</span> <span class="hljs-number">1</span>
<span class="hljs-attr">num_processes:</span> <span class="hljs-number">2</span>
<span class="hljs-attr">rdzv_backend:</span> <span class="hljs-string">static</span>
<span class="hljs-attr">same_network:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">tpu_env:</span> []
<span class="hljs-attr">tpu_use_cluster:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">tpu_use_sudo:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">use_cpu:</span> <span class="hljs-literal">false</span>`}}),xl=new D({props:{code:"Y29tcHV0ZV9lbnZpcm9ubWVudCUzQSUyMExPQ0FMX01BQ0hJTkUlMEFkZWVwc3BlZWRfY29uZmlnJTNBJTBBJTIwJTIwZGVlcHNwZWVkX2NvbmZpZ19maWxlJTNBJTIwJTJGaG9tZSUyRnVzZXIlMkZjb25maWdzJTJGZHNfemVybzNfY29uZmlnLmpzb24lMEElMjAlMjB6ZXJvM19pbml0X2ZsYWclM0ElMjB0cnVlJTBBZGlzdHJpYnV0ZWRfdHlwZSUzQSUyMERFRVBTUEVFRCUwQWRvd25jYXN0X2JmMTYlM0ElMjAnbm8nJTBBbWFjaGluZV9yYW5rJTNBJTIwMCUwQW1haW5fdHJhaW5pbmdfZnVuY3Rpb24lM0ElMjBtYWluJTBBbnVtX21hY2hpbmVzJTNBJTIwMSUwQW51bV9wcm9jZXNzZXMlM0ElMjA0JTBBcmR6dl9iYWNrZW5kJTNBJTIwc3RhdGljJTBBc2FtZV9uZXR3b3JrJTNBJTIwdHJ1ZSUwQXRwdV9lbnYlM0ElMjAlNUIlNUQlMEF0cHVfdXNlX2NsdXN0ZXIlM0ElMjBmYWxzZSUwQXRwdV91c2Vfc3VkbyUzQSUyMGZhbHNlJTBBdXNlX2NwdSUzQSUyMGZhbHNl",highlighted:`<span class="hljs-attr">compute_environment:</span> <span class="hljs-string">LOCAL_MACHINE</span>
<span class="hljs-attr">deepspeed_config:</span>
  <span class="hljs-attr">deepspeed_config_file:</span> <span class="hljs-string">/home/user/configs/ds_zero3_config.json</span>
  <span class="hljs-attr">zero3_init_flag:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">distributed_type:</span> <span class="hljs-string">DEEPSPEED</span>
<span class="hljs-attr">downcast_bf16:</span> <span class="hljs-string">&#x27;no&#x27;</span>
<span class="hljs-attr">machine_rank:</span> <span class="hljs-number">0</span>
<span class="hljs-attr">main_training_function:</span> <span class="hljs-string">main</span>
<span class="hljs-attr">num_machines:</span> <span class="hljs-number">1</span>
<span class="hljs-attr">num_processes:</span> <span class="hljs-number">4</span>
<span class="hljs-attr">rdzv_backend:</span> <span class="hljs-string">static</span>
<span class="hljs-attr">same_network:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">tpu_env:</span> []
<span class="hljs-attr">tpu_use_cluster:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">tpu_use_sudo:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">use_cpu:</span> <span class="hljs-literal">false</span>`}}),Ml=new D({props:{code:"Y29tcHV0ZV9lbnZpcm9ubWVudCUzQSUyMExPQ0FMX01BQ0hJTkUlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEFkZWVwc3BlZWRfY29uZmlnJTNBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTBBJTIwJTIwZ3JhZGllbnRfYWNjdW11bGF0aW9uX3N0ZXBzJTNBJTIwMSUwQSUyMCUyMGdyYWRpZW50X2NsaXBwaW5nJTNBJTIwMC43JTBBJTIwJTIwb2ZmbG9hZF9vcHRpbWl6ZXJfZGV2aWNlJTNBJTIwY3B1JTBBJTIwJTIwb2ZmbG9hZF9wYXJhbV9kZXZpY2UlM0ElMjBjcHUlMEElMjAlMjB6ZXJvM19pbml0X2ZsYWclM0ElMjB0cnVlJTBBJTIwJTIwemVyb19zdGFnZSUzQSUyMDIlMEFkaXN0cmlidXRlZF90eXBlJTNBJTIwREVFUFNQRUVEJTBBZG93bmNhc3RfYmYxNiUzQSUyMCdubyclMEFtYWNoaW5lX3JhbmslM0ElMjAwJTBBbWFpbl90cmFpbmluZ19mdW5jdGlvbiUzQSUyMG1haW4lMEFtaXhlZF9wcmVjaXNpb24lM0ElMjBiZjE2JTBBbnVtX21hY2hpbmVzJTNBJTIwMSUwQW51bV9wcm9jZXNzZXMlM0ElMjA0JTBBcmR6dl9iYWNrZW5kJTNBJTIwc3RhdGljJTBBc2FtZV9uZXR3b3JrJTNBJTIwdHJ1ZSUwQXRwdV9lbnYlM0ElMjAlNUIlNUQlMEF0cHVfdXNlX2NsdXN0ZXIlM0ElMjBmYWxzZSUwQXRwdV91c2Vfc3VkbyUzQSUyMGZhbHNlJTBBdXNlX2NwdSUzQSUyMGZhbHNl",highlighted:`<span class="hljs-attr">compute_environment:</span> <span class="hljs-string">LOCAL_MACHINE</span>                                                                                             
<span class="hljs-attr">deepspeed_config:</span>                                                                                                              
  <span class="hljs-attr">gradient_accumulation_steps:</span> <span class="hljs-number">1</span>
  <span class="hljs-attr">gradient_clipping:</span> <span class="hljs-number">0.7</span>
  <span class="hljs-attr">offload_optimizer_device:</span> <span class="hljs-string">cpu</span>
  <span class="hljs-attr">offload_param_device:</span> <span class="hljs-string">cpu</span>
  <span class="hljs-attr">zero3_init_flag:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">zero_stage:</span> <span class="hljs-number">2</span>
<span class="hljs-attr">distributed_type:</span> <span class="hljs-string">DEEPSPEED</span>
<span class="hljs-attr">downcast_bf16:</span> <span class="hljs-string">&#x27;no&#x27;</span>
<span class="hljs-attr">machine_rank:</span> <span class="hljs-number">0</span>
<span class="hljs-attr">main_training_function:</span> <span class="hljs-string">main</span>
<span class="hljs-attr">mixed_precision:</span> <span class="hljs-string">bf16</span>
<span class="hljs-attr">num_machines:</span> <span class="hljs-number">1</span>
<span class="hljs-attr">num_processes:</span> <span class="hljs-number">4</span>
<span class="hljs-attr">rdzv_backend:</span> <span class="hljs-string">static</span>
<span class="hljs-attr">same_network:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">tpu_env:</span> []
<span class="hljs-attr">tpu_use_cluster:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">tpu_use_sudo:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">use_cpu:</span> <span class="hljs-literal">false</span>`}}),Il=new D({props:{code:"Y2QlMjB0cmFuc2Zvcm1lcnMlMEElMEFhY2NlbGVyYXRlJTIwbGF1bmNoJTIwJTVDJTBBLiUyRmV4YW1wbGVzJTJGcHl0b3JjaCUyRnRleHQtY2xhc3NpZmljYXRpb24lMkZydW5fZ2x1ZS5weSUyMCU1QyUwQS0tbW9kZWxfbmFtZV9vcl9wYXRoJTIwYmVydC1iYXNlLWNhc2VkJTIwJTVDJTBBLS10YXNrX25hbWUlMjAlMjRUQVNLX05BTUUlMjAlNUMlMEEtLWRvX3RyYWluJTIwJTVDJTBBLS1kb19ldmFsJTIwJTVDJTBBLS1tYXhfc2VxX2xlbmd0aCUyMDEyOCUyMCU1QyUwQS0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTIwMTYlMjAlNUMlMEEtLWxlYXJuaW5nX3JhdGUlMjA1ZS01JTIwJTVDJTBBLS1udW1fdHJhaW5fZXBvY2hzJTIwMyUyMCU1QyUwQS0tb3V0cHV0X2RpciUyMCUyRnRtcCUyRiUyNFRBU0tfTkFNRSUyRiUyMCU1QyUwQS0tb3ZlcndyaXRlX291dHB1dF9kaXI=",highlighted:`<span class="hljs-built_in">cd</span> transformers

accelerate launch \\
./examples/pytorch/text-classification/run_glue.py \\
--model_name_or_path bert-base-cased \\
--task_name <span class="hljs-variable">$TASK_NAME</span> \\
--do_train \\
--do_eval \\
--max_seq_length 128 \\
--per_device_train_batch_size 16 \\
--learning_rate 5e-5 \\
--num_train_epochs 3 \\
--output_dir /tmp/<span class="hljs-variable">$TASK_NAME</span>/ \\
--overwrite_output_dir`}}),Ul=new D({props:{code:"Y2QlMjB0cmFuc2Zvcm1lcnMlMEElMEFhY2NlbGVyYXRlJTIwbGF1bmNoJTIwLS1udW1fcHJvY2Vzc2VzJTNEMiUyMCU1QyUwQS0tdXNlX2ZzZHAlMjAlNUMlMEEtLW1peGVkX3ByZWNpc2lvbiUzRGJmMTYlMjAlNUMlMEEtLWZzZHBfYXV0b193cmFwX3BvbGljeSUzRFRSQU5TRk9STUVSX0JBU0VEX1dSQVAlMjAlMjAlNUMlMEEtLWZzZHBfdHJhbnNmb3JtZXJfbGF5ZXJfY2xzX3RvX3dyYXAlM0QlMjJCZXJ0TGF5ZXIlMjIlMjAlNUMlMEEtLWZzZHBfc2hhcmRpbmdfc3RyYXRlZ3klM0QxJTIwJTVDJTBBLS1mc2RwX3N0YXRlX2RpY3RfdHlwZSUzREZVTExfU1RBVEVfRElDVCUyMCU1QyUwQS4lMkZleGFtcGxlcyUyRnB5dG9yY2glMkZ0ZXh0LWNsYXNzaWZpY2F0aW9uJTJGcnVuX2dsdWUucHklMEEtLW1vZGVsX25hbWVfb3JfcGF0aCUyMGJlcnQtYmFzZS1jYXNlZCUyMCU1QyUwQS0tdGFza19uYW1lJTIwJTI0VEFTS19OQU1FJTIwJTVDJTBBLS1kb190cmFpbiUyMCU1QyUwQS0tZG9fZXZhbCUyMCU1QyUwQS0tbWF4X3NlcV9sZW5ndGglMjAxMjglMjAlNUMlMEEtLXBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUyMDE2JTIwJTVDJTBBLS1sZWFybmluZ19yYXRlJTIwNWUtNSUyMCU1QyUwQS0tbnVtX3RyYWluX2Vwb2NocyUyMDMlMjAlNUMlMEEtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkYlMjRUQVNLX05BTUUlMkYlMjAlNUMlMEEtLW92ZXJ3cml0ZV9vdXRwdXRfZGly",highlighted:`<span class="hljs-built_in">cd</span> transformers

accelerate launch --num_processes=2 \\
--use_fsdp \\
--mixed_precision=bf16 \\
--fsdp_auto_wrap_policy=TRANSFORMER_BASED_WRAP  \\
--fsdp_transformer_layer_cls_to_wrap=<span class="hljs-string">&quot;BertLayer&quot;</span> \\
--fsdp_sharding_strategy=1 \\
--fsdp_state_dict_type=FULL_STATE_DICT \\
./examples/pytorch/text-classification/run_glue.py
--model_name_or_path bert-base-cased \\
--task_name <span class="hljs-variable">$TASK_NAME</span> \\
--do_train \\
--do_eval \\
--max_seq_length 128 \\
--per_device_train_batch_size 16 \\
--learning_rate 5e-5 \\
--num_train_epochs 3 \\
--output_dir /tmp/<span class="hljs-variable">$TASK_NAME</span>/ \\
--overwrite_output_dir`}}),{c(){u=n("meta"),$=l(),T=n("h1"),w=n("a"),k=n("span"),f(h.$$.fragment),E=l(),C=n("span"),z=r("Trainer"),j=l(),R=n("p"),G=r("The "),ee=n("a"),Q=r("Trainer"),Y=r(" class provides an API for feature-complete training in PyTorch for most standard use cases. It\u2019s used in most of the "),X=n("a"),ue=r("example scripts"),H=r("."),L=l(),O=n("p"),ne=r("Before instantiating your "),F=n("a"),Ee=r("Trainer"),Ae=r(", create a "),se=n("a"),bt=r("TrainingArguments"),vt=r(" to access all the points of customization during training."),be=l(),je=n("p"),_n=r("The API supports distributed training on multiple GPUs/TPUs, mixed precision through "),$e=n("a"),bn=r("NVIDIA Apex"),vn=r(" and Native AMP for PyTorch."),ie=l(),re=n("p"),Wl=r("The "),ke=n("a"),fr=r("Trainer"),Rl=r(" contains the basic training loop which supports the above features. To inject custom behavior you can subclass them and override the following methods:"),vo=l(),W=n("ul"),ae=n("li"),gr=n("strong"),Ll=r("get_train_dataloader"),Bl=r(" \u2014 Creates the training DataLoader."),Gl=l(),Zl=n("li"),om=n("strong"),mT=r("get_eval_dataloader"),hT=r(" \u2014 Creates the evaluation DataLoader."),uT=l(),Vl=n("li"),rm=n("strong"),fT=r("get_test_dataloader"),gT=r(" \u2014 Creates the test DataLoader."),_T=l(),Xl=n("li"),am=n("strong"),bT=r("log"),vT=r(" \u2014 Logs information on the various objects watching training."),yT=l(),yt=n("li"),nm=n("strong"),wT=r("create_optimizer_and_scheduler"),TT=r(` \u2014 Sets up the optimizer and learning rate scheduler if they were not passed at
init. Note, that you can also subclass or override the `),sm=n("code"),ET=r("create_optimizer"),AT=r(" and "),im=n("code"),$T=r("create_scheduler"),kT=r(` methods
separately.`),xT=l(),Yl=n("li"),lm=n("strong"),MT=r("create_optimizer"),IT=r(" \u2014 Sets up the optimizer if it wasn\u2019t passed at init."),ST=l(),Hl=n("li"),dm=n("strong"),qT=r("create_scheduler"),UT=r(" \u2014 Sets up the learning rate scheduler if it wasn\u2019t passed at init."),DT=l(),Ql=n("li"),cm=n("strong"),jT=r("compute_loss"),PT=r(" - Computes the loss on a batch of training inputs."),JT=l(),Kl=n("li"),pm=n("strong"),CT=r("training_step"),FT=r(" \u2014 Performs a training step."),NT=l(),ed=n("li"),mm=n("strong"),zT=r("prediction_step"),OT=r(" \u2014 Performs an evaluation/test step."),WT=l(),td=n("li"),hm=n("strong"),RT=r("evaluate"),LT=r(" \u2014 Runs an evaluation loop and returns metrics."),BT=l(),od=n("li"),um=n("strong"),GT=r("predict"),ZT=r(" \u2014 Returns predictions (with metrics if labels are available) on a test set."),Uv=l(),f(_r.$$.fragment),Dv=l(),br=n("p"),VT=r("Here is an example of how to customize "),rd=n("a"),XT=r("Trainer"),YT=r(" to use a weighted loss (useful when you have an unbalanced training set):"),jv=l(),f(yn.$$.fragment),Pv=l(),wt=n("p"),HT=r("Another way to customize the training loop behavior for the PyTorch "),ad=n("a"),QT=r("Trainer"),KT=r(" is to use "),nd=n("a"),e0=r("callbacks"),t0=r(" that can inspect the training loop state (for progress reporting, logging on TensorBoard or other ML platforms\u2026) and take decisions (like early stopping)."),Jv=l(),yo=n("h2"),vr=n("a"),fm=n("span"),f(wn.$$.fragment),o0=l(),gm=n("span"),r0=r("Trainer"),Cv=l(),A=n("div"),f(Tn.$$.fragment),a0=l(),_m=n("p"),n0=r("Trainer is a simple but feature-complete training and eval loop for PyTorch, optimized for \u{1F917} Transformers."),s0=l(),bm=n("p"),i0=r("Important attributes:"),l0=l(),xe=n("ul"),yr=n("li"),vm=n("strong"),d0=r("model"),c0=r(" \u2014 Always points to the core model. If using a transformers model, it will be a "),sd=n("a"),p0=r("PreTrainedModel"),m0=r(`
subclass.`),h0=l(),le=n("li"),ym=n("strong"),u0=r("model_wrapped"),f0=r(` \u2014 Always points to the most external model in case one or more other modules wrap the
original model. This is the model that should be used for the forward pass. For example, under `),wm=n("code"),g0=r("DeepSpeed"),_0=r(`,
the inner model is wrapped in `),Tm=n("code"),b0=r("DeepSpeed"),v0=r(" and then again in "),Em=n("code"),y0=r("torch.nn.DistributedDataParallel"),w0=r(`. If the inner
model hasn\u2019t been wrapped, then `),Am=n("code"),T0=r("self.model_wrapped"),E0=r(" is the same as "),$m=n("code"),A0=r("self.model"),$0=r("."),k0=l(),id=n("li"),km=n("strong"),x0=r("is_model_parallel"),M0=r(` \u2014 Whether or not a model has been switched to a model parallel mode (different from
data parallelism, this means some of the model layers are split on different GPUs).`),I0=l(),Pe=n("li"),xm=n("strong"),S0=r("place_model_on_device"),q0=r(` \u2014 Whether or not to automatically place the model on the device - it will be set
to `),Mm=n("code"),U0=r("False"),D0=r(` if model parallel or deepspeed is used, or if the default
`),Im=n("code"),j0=r("TrainingArguments.place_model_on_device"),P0=r(" is overridden to return "),Sm=n("code"),J0=r("False"),C0=r(" ."),F0=l(),Je=n("li"),qm=n("strong"),N0=r("is_in_train"),z0=r(" \u2014 Whether or not a model is currently running "),Um=n("code"),O0=r("train"),W0=r(" (e.g. when "),Dm=n("code"),R0=r("evaluate"),L0=r(` is called while
in `),jm=n("code"),B0=r("train"),G0=r(")"),Z0=l(),wr=n("div"),f(En.$$.fragment),V0=l(),An=n("p"),X0=r("Add a callback to the current list of "),Pm=n("code"),Y0=r("~transformer.TrainerCallback"),H0=r("."),Q0=l(),Tr=n("div"),f($n.$$.fragment),K0=l(),kn=n("p"),eE=r("A helper wrapper that creates an appropriate context manager for "),Jm=n("code"),tE=r("autocast"),oE=r(` while feeding it the desired
arguments, depending on the situation.`),rE=l(),Tt=n("div"),f(xn.$$.fragment),aE=l(),Cm=n("p"),nE=r("How the loss is computed by Trainer. By default, all models return the loss in the first element."),sE=l(),Fm=n("p"),iE=r("Subclass and override for custom behavior."),lE=l(),Er=n("div"),f(Mn.$$.fragment),dE=l(),Nm=n("p"),cE=r("A helper wrapper to group together context managers."),pE=l(),Ar=n("div"),f(In.$$.fragment),mE=l(),Sn=n("p"),hE=r("Creates a draft of a model card using the information available to the "),zm=n("code"),uE=r("Trainer"),fE=r("."),gE=l(),Et=n("div"),f(qn.$$.fragment),_E=l(),Om=n("p"),bE=r("Setup the optimizer."),vE=l(),Un=n("p"),yE=r(`We provide a reasonable default that works well. If you want to use something else, you can pass a tuple in the
Trainer\u2019s init through `),Wm=n("code"),wE=r("optimizers"),TE=r(", or subclass and override this method in a subclass."),EE=l(),At=n("div"),f(Dn.$$.fragment),AE=l(),Rm=n("p"),$E=r("Setup the optimizer and the learning rate scheduler."),kE=l(),it=n("p"),xE=r(`We provide a reasonable default that works well. If you want to use something else, you can pass a tuple in the
Trainer\u2019s init through `),Lm=n("code"),ME=r("optimizers"),IE=r(", or subclass and override this method (or "),Bm=n("code"),SE=r("create_optimizer"),qE=r(` and/or
`),Gm=n("code"),UE=r("create_scheduler"),DE=r(") in a subclass."),jE=l(),$r=n("div"),f(jn.$$.fragment),PE=l(),Zm=n("p"),JE=r(`Setup the scheduler. The optimizer of the trainer must have been set up either before this method is called or
passed as an argument.`),CE=l(),Ce=n("div"),f(Pn.$$.fragment),FE=l(),Vm=n("p"),NE=r("Run evaluation and returns metrics."),zE=l(),Jn=n("p"),OE=r(`The calling script will be responsible for providing a method to compute metrics, as they are task-dependent
(pass it to the init `),Xm=n("code"),WE=r("compute_metrics"),RE=r(" argument)."),LE=l(),Ym=n("p"),BE=r("You can also subclass and override this method to inject custom behavior."),GE=l(),$t=n("div"),f(Cn.$$.fragment),ZE=l(),wo=n("p"),VE=r("Prediction/evaluation loop, shared by "),Hm=n("code"),XE=r("Trainer.evaluate()"),YE=r(" and "),Qm=n("code"),HE=r("Trainer.predict()"),QE=r("."),KE=l(),Km=n("p"),e4=r("Works both with or without labels."),t4=l(),kr=n("div"),f(Fn.$$.fragment),o4=l(),Nn=n("p"),r4=r("For models that inherit from "),ld=n("a"),a4=r("PreTrainedModel"),n4=r(`, uses that method to compute the number of floating point
operations for every backward + forward pass. If using another model, either implement such a method in the
model or subclass and override this method.`),s4=l(),kt=n("div"),f(zn.$$.fragment),i4=l(),On=n("p"),l4=r("Returns the evaluation "),eh=n("code"),d4=r("~torch.utils.data.DataLoader"),c4=r("."),p4=l(),th=n("p"),m4=r("Subclass and override this method if you want to inject some custom behavior."),h4=l(),xr=n("div"),f(Wn.$$.fragment),u4=l(),oh=n("p"),f4=r("Returns the optimizer class and optimizer parameters based on the training arguments."),g4=l(),xt=n("div"),f(Rn.$$.fragment),_4=l(),Ln=n("p"),b4=r("Returns the test "),rh=n("code"),v4=r("~torch.utils.data.DataLoader"),y4=r("."),w4=l(),ah=n("p"),T4=r("Subclass and override this method if you want to inject some custom behavior."),E4=l(),Fe=n("div"),f(Bn.$$.fragment),A4=l(),Gn=n("p"),$4=r("Returns the training "),nh=n("code"),k4=r("~torch.utils.data.DataLoader"),x4=r("."),M4=l(),To=n("p"),I4=r("Will use no sampler if "),sh=n("code"),S4=r("train_dataset"),q4=r(" does not implement "),ih=n("code"),U4=r("__len__"),D4=r(`, a random sampler (adapted to distributed
training if necessary) otherwise.`),j4=l(),lh=n("p"),P4=r("Subclass and override this method if you want to inject some custom behavior."),J4=l(),Mt=n("div"),f(Zn.$$.fragment),C4=l(),Me=n("p"),F4=r("Launch an hyperparameter search using "),dh=n("code"),N4=r("optuna"),z4=r(" or "),ch=n("code"),O4=r("Ray Tune"),W4=r(" or "),ph=n("code"),R4=r("SigOpt"),L4=r(`. The optimized quantity is determined
by `),mh=n("code"),B4=r("compute_objective"),G4=r(`, which defaults to a function returning the evaluation loss when no metric is provided,
the sum of all metrics otherwise.`),Z4=l(),f(Mr.$$.fragment),V4=l(),It=n("div"),f(Vn.$$.fragment),X4=l(),Xn=n("p"),Y4=r("Initializes a git repo in "),hh=n("code"),H4=r("self.args.hub_model_id"),Q4=r("."),K4=l(),f(Ir.$$.fragment),eA=l(),Sr=n("div"),f(Yn.$$.fragment),tA=l(),Hn=n("p"),oA=r("Initializes a git repo in "),uh=n("code"),rA=r("self.args.hub_model_id"),aA=r("."),nA=l(),qr=n("div"),f(Qn.$$.fragment),sA=l(),fh=n("p"),iA=r(`Whether or not this process is the local (e.g., on one machine if training in a distributed fashion on several
machines) main process.`),lA=l(),Ur=n("div"),f(Kn.$$.fragment),dA=l(),es=n("p"),cA=r(`Whether or not this process is the global main process (when training in a distributed fashion on several
machines, this is only going to be `),gh=n("code"),pA=r("True"),mA=r(" for one process)."),hA=l(),St=n("div"),f(ts.$$.fragment),uA=l(),os=n("p"),fA=r("Log "),_h=n("code"),gA=r("logs"),_A=r(" on the various objects watching training."),bA=l(),bh=n("p"),vA=r("Subclass and override this method to inject custom behavior."),yA=l(),P=n("div"),f(rs.$$.fragment),wA=l(),vh=n("p"),TA=r("Log metrics in a specially formatted way"),EA=l(),yh=n("p"),AA=r("Under distributed environment this is done only for a process with rank 0."),$A=l(),wh=n("p"),kA=r("Notes on memory reports:"),xA=l(),Eo=n("p"),MA=r("In order to get memory usage report you need to install "),Th=n("code"),IA=r("psutil"),SA=r(". You can do that with "),Eh=n("code"),qA=r("pip install psutil"),UA=r("."),DA=l(),f(Dr.$$.fragment),jA=l(),Ah=n("p"),$h=n("strong"),PA=r("Understanding the reports:"),JA=l(),lt=n("ul"),Ie=n("li"),CA=r("the first segment, e.g., "),kh=n("code"),FA=r("train__"),NA=r(", tells you which stage the metrics are for. Reports starting with "),xh=n("code"),zA=r("init_"),OA=r(`
will be added to the first stage that gets run. So that if only evaluation is run, the memory usage for the
`),Mh=n("code"),WA=r("__init__"),RA=r(" will be reported along with the "),Ih=n("code"),LA=r("eval_"),BA=r(" metrics."),GA=l(),Ao=n("li"),ZA=r("the third segment, is either "),Sh=n("code"),VA=r("cpu"),XA=r(" or "),qh=n("code"),YA=r("gpu"),HA=r(`, tells you whether it\u2019s the general RAM or the gpu0 memory
metric.`),QA=l(),dd=n("li"),Uh=n("code"),KA=r("*_alloc_delta"),e$=r(` - is the difference in the used/allocated memory counter between the end and the start of the
stage - it can be negative if a function released more memory than it allocated.`),t$=l(),qt=n("li"),Dh=n("code"),o$=r("*_peaked_delta"),r$=r(` - is any extra memory that was consumed and then freed - relative to the current allocated
memory counter - it is never negative. When you look at the metrics of any stage you add up `),jh=n("code"),a$=r("alloc_delta"),n$=r(` +
`),Ph=n("code"),s$=r("peaked_delta"),i$=r(" and you know how much memory was needed to complete that stage."),l$=l(),Jh=n("p"),d$=r(`The reporting happens only for process of rank 0 and gpu 0 (if there is a gpu). Typically this is enough since the
main process does the bulk of work, but it could be not quite so if model parallel is used and then other GPUs may
use a different amount of gpu memory. This is also not the same under DataParallel where gpu0 may require much more
memory than the rest since it stores the gradient and optimizer states for all participating GPUS. Perhaps in the
future these reports will evolve to measure those too.`),c$=l(),Ch=n("p"),p$=r(`The CPU RAM metric measures RSS (Resident Set Size) includes both the memory which is unique to the process and the
memory shared with other processes. It is important to note that it does not include swapped out memory, so the
reports could be imprecise.`),m$=l(),as=n("p"),h$=r(`The CPU peak memory is measured using a sampling thread. Due to python\u2019s GIL it may miss some of the peak memory if
that thread didn\u2019t get a chance to run when the highest memory was used. Therefore this report can be less than
reality. Using `),Fh=n("code"),u$=r("tracemalloc"),f$=r(` would have reported the exact peak memory, but it doesn\u2019t report memory allocations
outside of python. So if some C++ CUDA extension allocated its own memory it won\u2019t be reported. And therefore it
was dropped in favor of the memory sampling approach, which reads the current process memory usage.`),g$=l(),dt=n("p"),_$=r("The GPU allocated and peak memory reporting is done with "),Nh=n("code"),b$=r("torch.cuda.memory_allocated()"),v$=r(` and
`),zh=n("code"),y$=r("torch.cuda.max_memory_allocated()"),w$=r(`. This metric reports only \u201Cdeltas\u201D for pytorch-specific allocations, as
`),Oh=n("code"),T$=r("torch.cuda"),E$=r(` memory management system doesn\u2019t track any memory allocated outside of pytorch. For example, the very
first cuda call typically loads CUDA kernels, which may take from 0.5 to 2GB of GPU memory.`),A$=l(),fe=n("p"),$$=r("Note that this tracker doesn\u2019t account for memory allocations outside of "),cd=n("a"),k$=r("Trainer"),x$=r("\u2019s "),Wh=n("code"),M$=r("__init__"),I$=r(", "),Rh=n("code"),S$=r("train"),q$=r(`,
`),Lh=n("code"),U$=r("evaluate"),D$=r(" and "),Bh=n("code"),j$=r("predict"),P$=r(" calls."),J$=l(),Z=n("p"),C$=r("Because "),Gh=n("code"),F$=r("evaluation"),N$=r(" calls may happen during "),Zh=n("code"),z$=r("train"),O$=r(`, we can\u2019t handle nested invocations because
`),Vh=n("code"),W$=r("torch.cuda.max_memory_allocated"),R$=r(" is a single counter, so if it gets reset by a nested eval call, "),Xh=n("code"),L$=r("train"),B$=r(`\u2019s tracker
will report incorrect info. If this `),ns=n("a"),G$=r("pytorch issue"),Z$=r(` gets resolved
it will be possible to change this class to be re-entrant. Until then we will only track the outer level of
`),Yh=n("code"),V$=r("train"),X$=r(", "),Hh=n("code"),Y$=r("evaluate"),H$=r(" and "),Qh=n("code"),Q$=r("predict"),K$=r(" methods. Which means that if "),Kh=n("code"),e3=r("eval"),t3=r(" is called during "),eu=n("code"),o3=r("train"),r3=r(`, it\u2019s the latter
that will account for its memory usage and that of the former.`),a3=l(),Se=n("p"),n3=r("This also means that if any other tool that is used along the "),pd=n("a"),s3=r("Trainer"),i3=r(` calls
`),tu=n("code"),l3=r("torch.cuda.reset_peak_memory_stats"),d3=r(", the gpu peak memory stats could be invalid. And the "),md=n("a"),c3=r("Trainer"),p3=r(` will disrupt
the normal behavior of any such tools that rely on calling `),ou=n("code"),m3=r("torch.cuda.reset_peak_memory_stats"),h3=r(" themselves."),u3=l(),ru=n("p"),f3=r("For best performance you may want to consider turning the memory profiling off for production runs."),g3=l(),jr=n("div"),f(ss.$$.fragment),_3=l(),au=n("p"),b3=r("Reformat Trainer metrics values to a human-readable format"),v3=l(),Pr=n("div"),f(is.$$.fragment),y3=l(),ls=n("p"),w3=r("Helper to get number of samples in a "),nu=n("code"),T3=r("~torch.utils.data.DataLoader"),E3=r(` by accessing its dataset. When
dataloader.dataset does not exist or has no length, estimates as best it can`),A3=l(),Ut=n("div"),f(ds.$$.fragment),$3=l(),cs=n("p"),k3=r("Remove a callback from the current list of "),su=n("code"),x3=r("~transformer.TrainerCallback"),M3=r(" and returns it."),I3=l(),ps=n("p"),S3=r("If the callback is not found, returns "),iu=n("code"),q3=r("None"),U3=r(" (and no error is raised)."),D3=l(),de=n("div"),f(ms.$$.fragment),j3=l(),lu=n("p"),P3=r("Run prediction and returns predictions and potential metrics."),J3=l(),hs=n("p"),C3=r(`Depending on the dataset and your use case, your test dataset may contain labels. In that case, this method
will also return metrics, like in `),du=n("code"),F3=r("evaluate()"),N3=r("."),z3=l(),f(Jr.$$.fragment),O3=l(),us=n("p"),W3=r("Returns: "),cu=n("em"),R3=r("NamedTuple"),L3=r(" A namedtuple with the following keys:"),B3=l(),$o=n("ul"),ko=n("li"),G3=r("predictions ("),pu=n("code"),Z3=r("np.ndarray"),V3=r("): The predictions on "),mu=n("code"),X3=r("test_dataset"),Y3=r("."),H3=l(),xo=n("li"),Q3=r("label_ids ("),hu=n("code"),K3=r("np.ndarray"),ek=r(", "),uu=n("em"),tk=r("optional"),ok=r("): The labels (if the dataset contained some)."),rk=l(),Mo=n("li"),ak=r("metrics ("),fu=n("code"),nk=r("Dict[str, float]"),sk=r(", "),gu=n("em"),ik=r("optional"),lk=r(`): The potential dictionary of metrics (if the dataset contained
labels).`),dk=l(),Dt=n("div"),f(fs.$$.fragment),ck=l(),Io=n("p"),pk=r("Prediction/evaluation loop, shared by "),_u=n("code"),mk=r("Trainer.evaluate()"),hk=r(" and "),bu=n("code"),uk=r("Trainer.predict()"),fk=r("."),gk=l(),vu=n("p"),_k=r("Works both with or without labels."),bk=l(),jt=n("div"),f(gs.$$.fragment),vk=l(),So=n("p"),yk=r("Perform an evaluation step on "),yu=n("code"),wk=r("model"),Tk=r(" using "),wu=n("code"),Ek=r("inputs"),Ak=r("."),$k=l(),Tu=n("p"),kk=r("Subclass and override to inject custom behavior."),xk=l(),Cr=n("div"),f(_s.$$.fragment),Mk=l(),ct=n("p"),Ik=r("Upload "),Eu=n("code"),Sk=r("self.model"),qk=r(" and "),Au=n("code"),Uk=r("self.tokenizer"),Dk=r(" to the \u{1F917} model hub on the repo "),$u=n("code"),jk=r("self.args.hub_model_id"),Pk=r("."),Jk=l(),Fr=n("div"),f(bs.$$.fragment),Ck=l(),vs=n("p"),Fk=r("Remove a callback from the current list of "),ku=n("code"),Nk=r("~transformer.TrainerCallback"),zk=r("."),Ok=l(),Ne=n("div"),f(ys.$$.fragment),Wk=l(),ws=n("p"),Rk=r("Save metrics into a json file for that split, e.g. "),xu=n("code"),Lk=r("train_results.json"),Bk=r("."),Gk=l(),Mu=n("p"),Zk=r("Under distributed environment this is done only for a process with rank 0."),Vk=l(),Ts=n("p"),Xk=r("To understand the metrics please read the docstring of "),hd=n("a"),Yk=r("log_metrics()"),Hk=r(`. The only difference is that raw
unformatted numbers are saved in the current method.`),Qk=l(),Pt=n("div"),f(Es.$$.fragment),Kk=l(),As=n("p"),ex=r("Will save the model, so you can reload it using "),Iu=n("code"),tx=r("from_pretrained()"),ox=r("."),rx=l(),Su=n("p"),ax=r("Will only save from the main process."),nx=l(),Jt=n("div"),f($s.$$.fragment),sx=l(),qu=n("p"),ix=r("Saves the Trainer state, since Trainer.save_model saves only the tokenizer with the model"),lx=l(),Uu=n("p"),dx=r("Under distributed environment this is done only for a process with rank 0."),cx=l(),Nr=n("div"),f(ks.$$.fragment),px=l(),Du=n("p"),mx=r("Main training entry point."),hx=l(),Ct=n("div"),f(xs.$$.fragment),ux=l(),ju=n("p"),fx=r("Perform a training step on a batch of inputs."),gx=l(),Pu=n("p"),_x=r("Subclass and override to inject custom behavior."),Fv=l(),qo=n("h2"),zr=n("a"),Ju=n("span"),f(Ms.$$.fragment),bx=l(),Cu=n("span"),vx=r("Seq2SeqTrainer"),Nv=l(),pt=n("div"),f(Is.$$.fragment),yx=l(),ze=n("div"),f(Ss.$$.fragment),wx=l(),Fu=n("p"),Tx=r("Run evaluation and returns metrics."),Ex=l(),qs=n("p"),Ax=r(`The calling script will be responsible for providing a method to compute metrics, as they are task-dependent
(pass it to the init `),Nu=n("code"),$x=r("compute_metrics"),kx=r(" argument)."),xx=l(),zu=n("p"),Mx=r("You can also subclass and override this method to inject custom behavior."),Ix=l(),ce=n("div"),f(Us.$$.fragment),Sx=l(),Ou=n("p"),qx=r("Run prediction and returns predictions and potential metrics."),Ux=l(),Ds=n("p"),Dx=r(`Depending on the dataset and your use case, your test dataset may contain labels. In that case, this method
will also return metrics, like in `),Wu=n("code"),jx=r("evaluate()"),Px=r("."),Jx=l(),f(Or.$$.fragment),Cx=l(),js=n("p"),Fx=r("Returns: "),Ru=n("em"),Nx=r("NamedTuple"),zx=r(" A namedtuple with the following keys:"),Ox=l(),Uo=n("ul"),Do=n("li"),Wx=r("predictions ("),Lu=n("code"),Rx=r("np.ndarray"),Lx=r("): The predictions on "),Bu=n("code"),Bx=r("test_dataset"),Gx=r("."),Zx=l(),jo=n("li"),Vx=r("label_ids ("),Gu=n("code"),Xx=r("np.ndarray"),Yx=r(", "),Zu=n("em"),Hx=r("optional"),Qx=r("): The labels (if the dataset contained some)."),Kx=l(),Po=n("li"),eM=r("metrics ("),Vu=n("code"),tM=r("Dict[str, float]"),oM=r(", "),Xu=n("em"),rM=r("optional"),aM=r(`): The potential dictionary of metrics (if the dataset contained
labels).`),zv=l(),Jo=n("h2"),Wr=n("a"),Yu=n("span"),f(Ps.$$.fragment),nM=l(),Hu=n("span"),sM=r("TrainingArguments"),Ov=l(),q=n("div"),f(Js.$$.fragment),iM=l(),Cs=n("p"),lM=r("TrainingArguments is the subset of the arguments we use in our example scripts "),Qu=n("strong"),dM=r(`which relate to the training loop
itself`),cM=r("."),pM=l(),Co=n("p"),mM=r("Using "),ud=n("a"),hM=r("HfArgumentParser"),uM=r(` we can turn this class into
`),Fs=n("a"),fM=r("argparse"),gM=r(` arguments that can be specified on the
command line.`),_M=l(),ve=n("div"),f(Ns.$$.fragment),bM=l(),Ku=n("p"),vM=r(`Returns the log level to be used depending on whether this process is the main process of node 0, main process
of node non-0, or a non-main process.`),yM=l(),Fo=n("p"),wM=r("For the main process the log level defaults to the logging level set ("),ef=n("code"),TM=r("logging.WARNING"),EM=r(` if you didn\u2019t do
anything) unless overridden by `),tf=n("code"),AM=r("log_level"),$M=r(" argument."),kM=l(),No=n("p"),xM=r("For the replica processes the log level defaults to "),of=n("code"),MM=r("logging.WARNING"),IM=r(" unless overridden by "),rf=n("code"),SM=r("log_level_replica"),qM=r(`
argument.`),UM=l(),zs=n("p"),DM=r("The choice between the main and replica process settings is made according to the return value of "),af=n("code"),jM=r("should_log"),PM=r("."),JM=l(),Rr=n("div"),f(Os.$$.fragment),CM=l(),nf=n("p"),FM=r("Get number of steps used for a linear warmup."),NM=l(),Ft=n("div"),f(Ws.$$.fragment),zM=l(),sf=n("p"),OM=r(`A context manager for torch distributed environment where on needs to do something on the main process, while
blocking replicas, and when it\u2019s finished releasing the replicas.`),WM=l(),zo=n("p"),RM=r("One such use is for "),lf=n("code"),LM=r("datasets"),BM=r("\u2019s "),df=n("code"),GM=r("map"),ZM=r(` feature which to be efficient should be run once on the main process,
which upon completion saves a cached version of results and which then automatically gets loaded by the
replicas.`),VM=l(),Nt=n("div"),f(Rs.$$.fragment),XM=l(),cf=n("p"),YM=r("A method that regroups all arguments linked to the dataloaders creation."),HM=l(),f(Lr.$$.fragment),QM=l(),zt=n("div"),f(Ls.$$.fragment),KM=l(),pf=n("p"),e5=r("A method that regroups all arguments linked to the evaluation."),t5=l(),f(Br.$$.fragment),o5=l(),Ot=n("div"),f(Bs.$$.fragment),r5=l(),mf=n("p"),a5=r("A method that regroups all arguments linked to the evaluation."),n5=l(),f(Gr.$$.fragment),s5=l(),Wt=n("div"),f(Gs.$$.fragment),i5=l(),hf=n("p"),l5=r("A method that regroups all arguments linked to the learning rate scheduler and its hyperparameters."),d5=l(),f(Zr.$$.fragment),c5=l(),Rt=n("div"),f(Zs.$$.fragment),p5=l(),uf=n("p"),m5=r("A method that regroups all arguments linked to the optimizer and its hyperparameters."),h5=l(),f(Vr.$$.fragment),u5=l(),Oe=n("div"),f(Vs.$$.fragment),f5=l(),ff=n("p"),g5=r("A method that regroups all arguments linked to synchronizing checkpoints with the Hub."),_5=l(),f(Xr.$$.fragment),b5=l(),f(Yr.$$.fragment),v5=l(),Lt=n("div"),f(Xs.$$.fragment),y5=l(),gf=n("p"),w5=r("A method that regroups all arguments linked to the evaluation."),T5=l(),f(Hr.$$.fragment),E5=l(),We=n("div"),f(Ys.$$.fragment),A5=l(),_f=n("p"),$5=r("A method that regroups all basic arguments linked to testing on a held-out dataset."),k5=l(),f(Qr.$$.fragment),x5=l(),f(Kr.$$.fragment),M5=l(),Re=n("div"),f(Hs.$$.fragment),I5=l(),bf=n("p"),S5=r("A method that regroups all basic arguments linked to the training."),q5=l(),f(ea.$$.fragment),U5=l(),f(ta.$$.fragment),D5=l(),oa=n("div"),f(Qs.$$.fragment),j5=l(),Ks=n("p"),P5=r("Serializes this instance while replace "),vf=n("code"),J5=r("Enum"),C5=r(` by their values (for JSON serialization support). It obfuscates
the token values by removing their value.`),F5=l(),ra=n("div"),f(ei.$$.fragment),N5=l(),yf=n("p"),z5=r("Serializes this instance to a JSON string."),O5=l(),aa=n("div"),f(ti.$$.fragment),W5=l(),wf=n("p"),R5=r("Sanitized serialization to use with TensorBoard\u2019s hparams"),Wv=l(),Oo=n("h2"),na=n("a"),Tf=n("span"),f(oi.$$.fragment),L5=l(),Ef=n("span"),B5=r("Seq2SeqTrainingArguments"),Rv=l(),qe=n("div"),f(ri.$$.fragment),G5=l(),ai=n("p"),Z5=r("TrainingArguments is the subset of the arguments we use in our example scripts "),Af=n("strong"),V5=r(`which relate to the training loop
itself`),X5=r("."),Y5=l(),Wo=n("p"),H5=r("Using "),fd=n("a"),Q5=r("HfArgumentParser"),K5=r(` we can turn this class into
`),ni=n("a"),e9=r("argparse"),t9=r(` arguments that can be specified on the
command line.`),o9=l(),sa=n("div"),f(si.$$.fragment),r9=l(),Ro=n("p"),a9=r("Serializes this instance while replace "),$f=n("code"),n9=r("Enum"),s9=r(" by their values and "),kf=n("code"),i9=r("GenerationConfig"),l9=r(` by dictionaries (for JSON
serialization support). It obfuscates the token values by removing their value.`),Lv=l(),Lo=n("h2"),ia=n("a"),xf=n("span"),f(ii.$$.fragment),d9=l(),Mf=n("span"),c9=r("Checkpoints"),Bv=l(),ye=n("p"),p9=r("By default, "),gd=n("a"),m9=r("Trainer"),h9=r(" will save all checkpoints in the "),If=n("code"),u9=r("output_dir"),f9=r(` you set in the
`),_d=n("a"),g9=r("TrainingArguments"),_9=r(" you are using. Those will go in subfolder named "),Sf=n("code"),b9=r("checkpoint-xxx"),v9=r(` with xxx
being the step at which the training was at.`),Gv=l(),la=n("p"),y9=r("Resuming training from a checkpoint can be done when calling "),bd=n("a"),w9=r("Trainer.train()"),T9=r(" with either:"),Zv=l(),da=n("ul"),vd=n("li"),qf=n("code"),E9=r("resume_from_checkpoint=True"),A9=r(" which will resume training from the latest checkpoint"),$9=l(),yd=n("li"),Uf=n("code"),k9=r("resume_from_checkpoint=checkpoint_dir"),x9=r(` which will resume training from the specific checkpoint in the directory
passed.`),Vv=l(),Le=n("p"),M9=r("In addition, you can easily save your checkpoints on the Model Hub when using "),Df=n("code"),I9=r("push_to_hub=True"),S9=r(`. By default, all
the models saved in intermediate checkpoints are saved in different commits, but not the optimizer state. You can adapt
the `),jf=n("code"),q9=r("hub-strategy"),U9=r(" value of your "),wd=n("a"),D9=r("TrainingArguments"),j9=r(" to either:"),Xv=l(),ca=n("ul"),pa=n("li"),Pf=n("code"),P9=r('"checkpoint"'),J9=r(`: the latest checkpoint is also pushed in a subfolder named last-checkpoint, allowing you to
resume training easily with `),Jf=n("code"),C9=r('trainer.train(resume_from_checkpoint="output_dir/last-checkpoint")'),F9=r("."),N9=l(),Td=n("li"),Cf=n("code"),z9=r('"all_checkpoints"'),O9=r(`: all checkpoints are pushed like they appear in the output folder (so you will get one
checkpoint folder per folder in your final repository)`),Yv=l(),Bo=n("h2"),ma=n("a"),Ff=n("span"),f(li.$$.fragment),W9=l(),Nf=n("span"),R9=r("Logging"),Hv=l(),Be=n("p"),L9=r("By default "),Ed=n("a"),B9=r("Trainer"),G9=r(" will use "),zf=n("code"),Z9=r("logging.INFO"),V9=r(" for the main process and "),Of=n("code"),X9=r("logging.WARNING"),Y9=r(" for the replicas if any."),Qv=l(),Bt=n("p"),H9=r("These defaults can be overridden to use any of the 5 "),Wf=n("code"),Q9=r("logging"),K9=r(" levels with "),Ad=n("a"),eI=r("TrainingArguments"),tI=r(`\u2019s
arguments:`),Kv=l(),ha=n("ul"),$d=n("li"),Rf=n("code"),oI=r("log_level"),rI=r(" - for the main process"),aI=l(),kd=n("li"),Lf=n("code"),nI=r("log_level_replica"),sI=r(" - for the replicas"),ey=l(),Ge=n("p"),iI=r("Further, if "),xd=n("a"),lI=r("TrainingArguments"),dI=r("\u2019s "),Bf=n("code"),cI=r("log_on_each_node"),pI=r(" is set to "),Gf=n("code"),mI=r("False"),hI=r(` only the main node will
use the log level settings for its main process, all other nodes will use the log level settings for replicas.`),ty=l(),pe=n("p"),uI=r("Note that "),Md=n("a"),fI=r("Trainer"),gI=r(" is going to set "),Zf=n("code"),_I=r("transformers"),bI=r(`\u2019s log level separately for each node in its
`),Vf=n("code"),vI=r("Trainer.__init__()"),yI=r(`. So you may want to set this sooner (see the next example) if you tap into other
`),Xf=n("code"),wI=r("transformers"),TI=r(" functionality before creating the "),Id=n("a"),EI=r("Trainer"),AI=r(" object."),oy=l(),Sd=n("p"),$I=r("Here is an example of how this can be used in an application:"),ry=l(),f(di.$$.fragment),ay=l(),qd=n("p"),kI=r(`And then if you only want to see warnings on the main node and all other nodes to not print any most likely duplicated
warnings you could run it as:`),ny=l(),f(ci.$$.fragment),sy=l(),Ud=n("p"),xI=r(`In the multi-node environment if you also don\u2019t want the logs to repeat for each node\u2019s main process, you will want to
change the above to:`),iy=l(),f(pi.$$.fragment),ly=l(),Dd=n("p"),MI=r(`and then only the main process of the first node will log at the \u201Cwarning\u201D level, and all other processes on the main
node and all processes on other nodes will log at the \u201Cerror\u201D level.`),dy=l(),jd=n("p"),II=r("If you need your application to be as quiet as possible you could do:"),cy=l(),f(mi.$$.fragment),py=l(),ua=n("p"),SI=r("(add "),Yf=n("code"),qI=r("--log_on_each_node 0"),UI=r(" if on multi-node environment)"),my=l(),Go=n("h2"),fa=n("a"),Hf=n("span"),f(hi.$$.fragment),DI=l(),Qf=n("span"),jI=r("Randomness"),hy=l(),we=n("p"),PI=r("When resuming from a checkpoint generated by "),Pd=n("a"),JI=r("Trainer"),CI=r(` all efforts are made to restore the
`),Kf=n("em"),FI=r("python"),NI=r(", "),eg=n("em"),zI=r("numpy"),OI=r(" and "),tg=n("em"),WI=r("pytorch"),RI=r(` RNG states to the same states as they were at the moment of saving that checkpoint,
which should make the \u201Cstop and resume\u201D style of training as close as possible to non-stop training.`),uy=l(),Gt=n("p"),LI=r(`However, due to various default non-deterministic pytorch settings this might not fully work. If you want full
determinism please refer to `),ui=n("a"),BI=r("Controlling sources of randomness"),GI=r(`. As explained in the document, that some of those settings
that make things deterministic (.e.g., `),og=n("code"),ZI=r("torch.backends.cudnn.deterministic"),VI=r(`) may slow things down, therefore this
can\u2019t be done by default, but you can enable those yourself if needed.`),fy=l(),Zo=n("h2"),ga=n("a"),rg=n("span"),f(fi.$$.fragment),XI=l(),ag=n("span"),YI=r("Specific GPUs Selection"),gy=l(),Jd=n("p"),HI=r("Let\u2019s discuss how you can tell your program which GPUs are to be used and in what order."),_y=l(),_a=n("p"),QI=r("When using "),gi=n("a"),ng=n("code"),KI=r("DistributedDataParallel"),eS=r(" to use only a subset of your GPUs, you simply specify the number of GPUs to use. For example, if you have 4 GPUs, but you wish to use the first 2 you can do:"),by=l(),f(_i.$$.fragment),vy=l(),Zt=n("p"),tS=r("if you have either "),bi=n("a"),sg=n("code"),oS=r("accelerate"),rS=r(" or "),vi=n("a"),ig=n("code"),aS=r("deepspeed"),nS=r(" installed you can also accomplish the same by using one of:"),yy=l(),f(yi.$$.fragment),wy=l(),f(wi.$$.fragment),Ty=l(),ba=n("p"),sS=r("You don\u2019t need to use the Accelerate or "),Cd=n("a"),iS=r("the Deepspeed integration"),lS=r(" features to use these launchers."),Ey=l(),Fd=n("p"),dS=r("Until now you were able to tell the program how many GPUs to use. Now let\u2019s discuss how to select specific GPUs and control their order."),Ay=l(),Nd=n("p"),cS=r("The following environment variables help you control which GPUs to use and their order."),$y=l(),zd=n("p"),lg=n("strong"),dg=n("code"),pS=r("CUDA_VISIBLE_DEVICES"),ky=l(),va=n("p"),mS=r("If you have multiple GPUs and you\u2019d like to use only 1 or a few of those GPUs, set the environment variable "),cg=n("code"),hS=r("CUDA_VISIBLE_DEVICES"),uS=r(" to a list of the GPUs to be used."),xy=l(),Od=n("p"),fS=r("For example, let\u2019s say you have 4 GPUs: 0, 1, 2 and 3. To run only on the physical GPUs 0 and 2, you can do:"),My=l(),f(Ti.$$.fragment),Iy=l(),Vt=n("p"),gS=r("So now pytorch will see only 2 GPUs, where your physical GPUs 0 and 2 are mapped to "),pg=n("code"),_S=r("cuda:0"),bS=r(" and "),mg=n("code"),vS=r("cuda:1"),yS=r(" correspondingly."),Sy=l(),Wd=n("p"),wS=r("You can even change their order:"),qy=l(),f(Ei.$$.fragment),Uy=l(),Xt=n("p"),TS=r("Here your physical GPUs 0 and 2 are mapped to "),hg=n("code"),ES=r("cuda:1"),AS=r(" and "),ug=n("code"),$S=r("cuda:0"),kS=r(" correspondingly."),Dy=l(),Yt=n("p"),xS=r("The above examples were all for "),fg=n("code"),MS=r("DistributedDataParallel"),IS=r(" use pattern, but the same method works for "),Ai=n("a"),gg=n("code"),SS=r("DataParallel"),qS=r(" as well:"),jy=l(),f($i.$$.fragment),Py=l(),Rd=n("p"),US=r("To emulate an environment without GPUs simply set this environment variable to an empty value like so:"),Jy=l(),f(ki.$$.fragment),Cy=l(),Ld=n("p"),DS=r("As with any environment variable you can, of course, export those instead of adding these to the command line, as in:"),Fy=l(),f(xi.$$.fragment),Ny=l(),Bd=n("p"),jS=r("but this approach can be confusing since you may forget you set up the environment variable earlier and not understand why the wrong GPUs are used. Therefore, it\u2019s a common practice to set the environment variable just for a specific run on the same command line as it\u2019s shown in most examples of this section."),zy=l(),Gd=n("p"),_g=n("strong"),bg=n("code"),PS=r("CUDA_DEVICE_ORDER"),Oy=l(),ya=n("p"),JS=r("There is an additional environment variable "),vg=n("code"),CS=r("CUDA_DEVICE_ORDER"),FS=r(" that controls how the physical devices are ordered. The two choices are:"),Wy=l(),Zd=n("ol"),Mi=n("li"),NS=r("ordered by PCIe bus IDs (matches "),yg=n("code"),zS=r("nvidia-smi"),OS=r("\u2019s order) - this is the default."),Ry=l(),f(Ii.$$.fragment),Ly=l(),Si=n("ol"),wg=n("li"),WS=r("ordered by GPU compute capabilities"),By=l(),f(qi.$$.fragment),Gy=l(),Ht=n("p"),RS=r("Most of the time you don\u2019t need to care about this environment variable, but it\u2019s very helpful if you have a lopsided setup where you have an old and a new GPUs physically inserted in such a way so that the slow older card appears to be first. One way to fix that is to swap the cards. But if you can\u2019t swap the cards (e.g., if the cooling of the devices gets impacted) then setting "),Tg=n("code"),LS=r("CUDA_DEVICE_ORDER=FASTEST_FIRST"),BS=r(" will always put the newer faster card first. It\u2019ll be somewhat confusing though since "),Eg=n("code"),GS=r("nvidia-smi"),ZS=r(" will still report them in the PCIe order."),Zy=l(),Vd=n("p"),VS=r("The other solution to swapping the order is to use:"),Vy=l(),f(Ui.$$.fragment),Xy=l(),Xd=n("p"),XS=r("In this example we are working with just 2 GPUs, but of course the same would apply to as many GPUs as your computer has."),Yy=l(),wa=n("p"),YS=r("Also if you do set this environment variable it\u2019s the best to set it in your "),Ag=n("code"),HS=r("~/.bashrc"),QS=r(" file or some other startup config file and forget about it."),Hy=l(),Vo=n("h2"),Ta=n("a"),$g=n("span"),f(Di.$$.fragment),KS=l(),kg=n("span"),eq=r("Trainer Integrations"),Qy=l(),Ea=n("p"),tq=r("The "),Yd=n("a"),oq=r("Trainer"),rq=r(` has been extended to support libraries that may dramatically improve your training
time and fit much bigger models.`),Ky=l(),Ze=n("p"),aq=r("Currently it supports third party solutions, "),ji=n("a"),nq=r("DeepSpeed"),sq=r(" and "),Pi=n("a"),iq=r("PyTorch FSDP"),lq=r(", which implement parts of the paper "),Ji=n("a"),dq=r(`ZeRO: Memory Optimizations
Toward Training Trillion Parameter Models, by Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, Yuxiong He`),cq=r("."),e1=l(),Aa=n("p"),pq=r("This provided support is new and experimental as of this writing. While the support for DeepSpeed and PyTorch FSDP is active and we welcome issues around it, we don\u2019t support the FairScale integration anymore since it has been integrated in PyTorch main (see the "),Hd=n("a"),mq=r("PyTorch FSDP integration"),hq=r(")"),t1=l(),Qd=n("a"),o1=l(),Xo=n("h3"),$a=n("a"),xg=n("span"),f(Ci.$$.fragment),uq=l(),Mg=n("span"),fq=r("CUDA Extension Installation Notes"),r1=l(),Kd=n("p"),gq=r("As of this writing, Deepspeed require compilation of CUDA C++ code, before it can be used."),a1=l(),ka=n("p"),_q=r("While all installation issues should be dealt with through the corresponding GitHub Issues of "),Fi=n("a"),bq=r("Deepspeed"),vq=r(`, there are a few common issues that one may encounter while building
any PyTorch extension that needs to build CUDA extensions.`),n1=l(),ec=n("p"),yq=r("Therefore, if you encounter a CUDA-related build issue while doing the following:"),s1=l(),f(Ni.$$.fragment),i1=l(),tc=n("p"),wq=r("please, read the following notes first."),l1=l(),Qt=n("p"),Tq=r("In these notes we give examples for what to do when "),Ig=n("code"),Eq=r("pytorch"),Aq=r(" has been built with CUDA "),Sg=n("code"),$q=r("10.2"),kq=r(`. If your situation is
different remember to adjust the version number to the one you are after.`),d1=l(),Yo=n("h4"),xa=n("a"),qg=n("span"),f(zi.$$.fragment),xq=l(),Ug=n("span"),Mq=r("Possible problem #1"),c1=l(),oc=n("p"),Iq=r(`While, Pytorch comes with its own CUDA toolkit, to build these two projects you must have an identical version of CUDA
installed system-wide.`),p1=l(),Ve=n("p"),Sq=r("For example, if you installed "),Dg=n("code"),qq=r("pytorch"),Uq=r(" with "),jg=n("code"),Dq=r("cudatoolkit==10.2"),jq=r(` in the Python environment, you also need to have
CUDA `),Pg=n("code"),Pq=r("10.2"),Jq=r(" installed system-wide."),m1=l(),Kt=n("p"),Cq=r("The exact location may vary from system to system, but "),Jg=n("code"),Fq=r("/usr/local/cuda-10.2"),Nq=r(` is the most common location on many
Unix systems. When CUDA is correctly set up and added to the `),Cg=n("code"),zq=r("PATH"),Oq=r(` environment variable, one can find the
installation location by doing:`),h1=l(),f(Oi.$$.fragment),u1=l(),Ma=n("p"),Wq=r(`If you don\u2019t have CUDA installed system-wide, install it first. You will find the instructions by using your favorite
search engine. For example, if you\u2019re on Ubuntu you may want to search for: `),Wi=n("a"),Rq=r("ubuntu cuda 10.2 install"),Lq=r("."),f1=l(),Ho=n("h4"),Ia=n("a"),Fg=n("span"),f(Ri.$$.fragment),Bq=l(),Ng=n("span"),Gq=r("Possible problem #2"),g1=l(),rc=n("p"),Zq=r(`Another possible common problem is that you may have more than one CUDA toolkit installed system-wide. For example you
may have:`),_1=l(),f(Li.$$.fragment),b1=l(),eo=n("p"),Vq=r("Now, in this situation you need to make sure that your "),zg=n("code"),Xq=r("PATH"),Yq=r(" and "),Og=n("code"),Hq=r("LD_LIBRARY_PATH"),Qq=r(` environment variables contain
the correct paths to the desired CUDA version. Typically, package installers will set these to contain whatever the
last version was installed. If you encounter the problem, where the package build fails because it can\u2019t find the right
CUDA version despite you having it installed system-wide, it means that you need to adjust the 2 aforementioned
environment variables.`),v1=l(),ac=n("p"),Kq=r("First, you may look at their contents:"),y1=l(),f(Bi.$$.fragment),w1=l(),nc=n("p"),eU=r("so you get an idea of what is inside."),T1=l(),Sa=n("p"),tU=r("It\u2019s possible that "),Wg=n("code"),oU=r("LD_LIBRARY_PATH"),rU=r(" is empty."),E1=l(),mt=n("p"),Rg=n("code"),aU=r("PATH"),nU=r(" lists the locations of where executables can be found and "),Lg=n("code"),sU=r("LD_LIBRARY_PATH"),iU=r(` is for where shared libraries
are to looked for. In both cases, earlier entries have priority over the later ones. `),Bg=n("code"),lU=r(":"),dU=r(` is used to separate multiple
entries.`),A1=l(),sc=n("p"),cU=r(`Now, to tell the build program where to find the specific CUDA toolkit, insert the desired paths to be listed first by
doing:`),$1=l(),f(Gi.$$.fragment),k1=l(),ic=n("p"),pU=r("Note that we aren\u2019t overwriting the existing values, but prepending instead."),x1=l(),Xe=n("p"),mU=r(`Of course, adjust the version number, the full path if need be. Check that the directories you assign actually do
exist. `),Gg=n("code"),hU=r("lib64"),uU=r(" sub-directory is where the various CUDA "),Zg=n("code"),fU=r(".so"),gU=r(" objects, like "),Vg=n("code"),_U=r("libcudart.so"),bU=r(` reside, it\u2019s unlikely
that your system will have it named differently, but if it is adjust it to reflect your reality.`),M1=l(),Qo=n("h4"),qa=n("a"),Xg=n("span"),f(Zi.$$.fragment),vU=l(),Yg=n("span"),yU=r("Possible problem #3"),I1=l(),to=n("p"),wU=r("Some older CUDA versions may refuse to build with newer compilers. For example, you my have "),Hg=n("code"),TU=r("gcc-9"),EU=r(` but it wants
`),Qg=n("code"),AU=r("gcc-7"),$U=r("."),S1=l(),lc=n("p"),kU=r("There are various ways to go about it."),q1=l(),dc=n("p"),xU=r("If you can install the latest CUDA toolkit it typically should support the newer compiler."),U1=l(),Ua=n("p"),MU=r(`Alternatively, you could install the lower version of the compiler in addition to the one you already have, or you may
already have it but it\u2019s not the default one, so the build system can\u2019t see it. If you have `),Kg=n("code"),IU=r("gcc-7"),SU=r(` installed but the
build system complains it can\u2019t find it, the following might do the trick:`),D1=l(),f(Vi.$$.fragment),j1=l(),te=n("p"),qU=r("Here, we are making a symlink to "),e_=n("code"),UU=r("gcc-7"),DU=r(" from "),t_=n("code"),jU=r("/usr/local/cuda-10.2/bin/gcc"),PU=r(` and since
`),o_=n("code"),JU=r("/usr/local/cuda-10.2/bin/"),CU=r(" should be in the "),r_=n("code"),FU=r("PATH"),NU=r(` environment variable (see the previous problem\u2019s solution), it
should find `),a_=n("code"),zU=r("gcc-7"),OU=r(" (and "),n_=n("code"),WU=r("g++7"),RU=r(") and then the build will succeed."),P1=l(),cc=n("p"),LU=r("As always make sure to edit the paths in the example to match your situation."),J1=l(),Ko=n("h3"),Da=n("a"),s_=n("span"),f(Xi.$$.fragment),BU=l(),i_=n("span"),GU=r("PyTorch Fully Sharded Data parallel"),C1=l(),ja=n("p"),ZU=r(`To accelerate training huge models on larger batch sizes, we can use a fully sharded data parallel model.
This type of data parallel paradigm enables fitting more data and larger models by sharding the optimizer states, gradients and parameters.
To read more about it and the benefits, check out the `),Yi=n("a"),VU=r("Fully Sharded Data Parallel blog"),XU=r(`.
We have integrated the latest PyTorch\u2019s Fully Sharded Data Parallel (FSDP) training feature.
All you need to do is enable it through the config.`),F1=l(),Hi=n("p"),l_=n("strong"),YU=r("Required PyTorch version for FSDP support"),HU=r(`: PyTorch Nightly (or 1.12.0 if you read this after it has been released)
as the model saving with FSDP activated is only available with recent fixes.`),N1=l(),Qi=n("p"),d_=n("strong"),QU=r("Usage"),KU=r(":"),z1=l(),me=n("ul"),c_=n("li"),Ki=n("p"),eD=r(`Make sure you have added the distributed launcher
`),p_=n("code"),tD=r("-m torch.distributed.launch --nproc_per_node=NUMBER_OF_GPUS_YOU_HAVE"),oD=r(" if you haven\u2019t been using it already."),rD=l(),el=n("li"),pc=n("p"),m_=n("strong"),aD=r("Sharding Strategy"),nD=r(":"),sD=l(),er=n("ul"),tl=n("li"),iD=r(`FULL_SHARD : Shards optimizer states + gradients + model parameters across data parallel workers/GPUs.
For this, add `),h_=n("code"),lD=r("--fsdp full_shard"),dD=r(" to the command line arguments."),cD=l(),ol=n("li"),pD=r(`SHARD_GRAD_OP : Shards optimizer states + gradients across data parallel workers/GPUs.
For this, add `),u_=n("code"),mD=r("--fsdp shard_grad_op"),hD=r(" to the command line arguments."),uD=l(),rl=n("li"),fD=r("NO_SHARD : No sharding. For this, add "),f_=n("code"),gD=r("--fsdp no_shard"),_D=r(" to the command line arguments."),bD=l(),g_=n("li"),tr=n("p"),vD=r(`To offload the parameters and gradients to the CPU,
add `),__=n("code"),yD=r('--fsdp "full_shard offload"'),wD=r(" or "),b_=n("code"),TD=r('--fsdp "shard_grad_op offload"'),ED=r(" to the command line arguments."),AD=l(),v_=n("li"),ht=n("p"),$D=r("To automatically recursively wrap layers with FSDP using "),y_=n("code"),kD=r("default_auto_wrap_policy"),xD=r(`,
add `),w_=n("code"),MD=r('--fsdp "full_shard auto_wrap"'),ID=r(" or "),T_=n("code"),SD=r('--fsdp "shard_grad_op auto_wrap"'),qD=r(" to the command line arguments."),UD=l(),E_=n("li"),or=n("p"),DD=r(`To enable both CPU offloading and auto wrapping,
add `),A_=n("code"),jD=r('--fsdp "full_shard offload auto_wrap"'),PD=r(" or "),$_=n("code"),JD=r('--fsdp "shard_grad_op offload auto_wrap"'),CD=r(" to the command line arguments."),FD=l(),al=n("li"),ut=n("p"),ND=r("Remaining FSDP config is passed via "),k_=n("code"),zD=r("--fsdp_config <path_to_fsdp_config.json>"),OD=r(`. It is either a location of
FSDP json config file (e.g., `),x_=n("code"),WD=r("fsdp_config.json"),RD=r(") or an already loaded json file as "),M_=n("code"),LD=r("dict"),BD=r("."),GD=l(),ft=n("ul"),mc=n("li"),ZD=r("If auto wrapping is enabled, you can either use transformer based auto wrap policy or size based auto wrap policy."),nl=n("ul"),ge=n("li"),VD=r("For transformer based auto wrap policy, it is recommended to specify "),I_=n("code"),XD=r("fsdp_transformer_layer_cls_to_wrap"),YD=r(" in the config file. If not specified, the default value is "),S_=n("code"),HD=r("model._no_split_modules"),QD=r(` when available.
This specifies the list of transformer layer class name (case-sensitive) to wrap ,e.g, `),q_=n("code"),KD=r("BertLayer"),ej=r(", "),U_=n("code"),tj=r("GPTJBlock"),oj=r(", "),D_=n("code"),rj=r("T5Block"),aj=r(` \u2026
This is important because submodules that share weights (e.g., embedding layer) should not end up in different FSDP wrapped units.
Using this policy, wrapping happens for each block containing Multi-Head Attention followed by couple of MLP layers.
Remaining layers including the shared embeddings are conveniently wrapped in same outermost FSDP unit.
Therefore, use this for transformer based models.`),nj=l(),sl=n("li"),sj=r("For size based auto wrap policy, please add "),j_=n("code"),ij=r("fsdp_min_num_params"),lj=r(` in the config file.
It specifies FSDP\u2019s minimum number of parameters for auto wrapping.`),dj=l(),gt=n("li"),P_=n("code"),cj=r("fsdp_backward_prefetch"),pj=r(` can be specified in the config file. It controls when to prefetch next set of parameters.
`),J_=n("code"),mj=r("backward_pre"),hj=r(" and "),C_=n("code"),uj=r("backward_pos"),fj=r(` are available options.
For more information refer `),F_=n("code"),gj=r("torch.distributed.fsdp.fully_sharded_data_parallel.BackwardPrefetch"),_j=l(),Pa=n("li"),N_=n("code"),bj=r("fsdp_forward_prefetch"),vj=r(` can be specified in the config file. It controls when to prefetch next set of parameters.
If `),z_=n("code"),yj=r('"True"'),wj=r(", FSDP explicitly prefetches the next upcoming all-gather while executing in the forward pass."),Tj=l(),Ja=n("li"),O_=n("code"),Ej=r("limit_all_gathers"),Aj=r(` can be specified in the config file.
If `),W_=n("code"),$j=r('"True"'),kj=r(", FSDP explicitly synchronizes the CPU thread to prevent too many in-flight all-gathers."),O1=l(),hc=n("p"),R_=n("strong"),xj=r("Few caveats to be aware of"),W1=l(),uc=n("ul"),Ye=n("li"),Mj=r("it is incompatible with "),L_=n("code"),Ij=r("generate"),Sj=r(", thus is incompatible with "),B_=n("code"),qj=r("--predict_with_generate"),Uj=r(`
in all seq2seq/clm scripts (translation/summarization/clm etc.).`),Dj=n("br"),jj=r(`
Please refer issue `),il=n("a"),Pj=r("#21667"),R1=l(),rr=n("h3"),Ca=n("a"),G_=n("span"),f(ll.$$.fragment),Jj=l(),Z_=n("span"),Cj=r("PyTorch/XLA Fully Sharded Data parallel"),L1=l(),oo=n("p"),Fj=r(`For all the TPU users, great news! PyTorch/XLA now supports FSDP.
All the latest Fully Sharded Data Parallel (FSDP) training are supported.
For more information refer to the `),dl=n("a"),Nj=r("Scaling PyTorch models on Cloud TPUs with FSDP"),zj=r(" and "),cl=n("a"),Oj=r("PyTorch/XLA implementation of FSDP"),Wj=r(`
All you need to do is enable it through the config.`),B1=l(),pl=n("p"),V_=n("strong"),Rj=r("Required PyTorch/XLA version for FSDP support"),Lj=r(": >=2.0"),G1=l(),ml=n("p"),X_=n("strong"),Bj=r("Usage"),Gj=r(":"),Z1=l(),ro=n("p"),Zj=r("Pass "),Y_=n("code"),Vj=r('--fsdp "full shard"'),Xj=r(" along with following changes to be made in "),H_=n("code"),Yj=r("--fsdp_config <path_to_fsdp_config.json>"),Hj=r(":"),V1=l(),He=n("ul"),Fa=n("li"),Q_=n("code"),Qj=r("xla"),Kj=r(" should be set to "),K_=n("code"),eP=r("True"),tP=r(" to enable PyTorch/XLA FSDP."),oP=l(),Na=n("li"),eb=n("code"),rP=r("xla_fsdp_settings"),aP=r(` The value is a dictionary which stores the XLA FSDP wrapping parameters.
For a complete list of options, please see `),hl=n("a"),nP=r("here"),sP=r("."),iP=l(),Qe=n("li"),tb=n("code"),lP=r("xla_fsdp_grad_ckpt"),dP=r(". When "),ob=n("code"),cP=r("True"),pP=r(`, uses gradient checkpointing over each nested XLA FSDP wrapped layer.
This setting can only be used when the xla flag is set to true, and an auto wrapping policy is specified through
`),rb=n("code"),mP=r("fsdp_min_num_params"),hP=r(" or "),ab=n("code"),uP=r("fsdp_transformer_layer_cls_to_wrap"),fP=r("."),gP=l(),fc=n("li"),_P=r("You can either use transformer based auto wrap policy or size based auto wrap policy."),ul=n("ul"),_e=n("li"),bP=r("For transformer based auto wrap policy, it is recommended to specify "),nb=n("code"),vP=r("fsdp_transformer_layer_cls_to_wrap"),yP=r(" in the config file. If not specified, the default value is "),sb=n("code"),wP=r("model._no_split_modules"),TP=r(` when available.
This specifies the list of transformer layer class name (case-sensitive) to wrap ,e.g, `),ib=n("code"),EP=r("BertLayer"),AP=r(", "),lb=n("code"),$P=r("GPTJBlock"),kP=r(", "),db=n("code"),xP=r("T5Block"),MP=r(` \u2026
This is important because submodules that share weights (e.g., embedding layer) should not end up in different FSDP wrapped units.
Using this policy, wrapping happens for each block containing Multi-Head Attention followed by couple of MLP layers.
Remaining layers including the shared embeddings are conveniently wrapped in same outermost FSDP unit.
Therefore, use this for transformer based models.`),IP=l(),fl=n("li"),SP=r("For size based auto wrap policy, please add "),cb=n("code"),qP=r("fsdp_min_num_params"),UP=r(` in the config file.
It specifies FSDP\u2019s minimum number of parameters for auto wrapping.`),X1=l(),ar=n("h3"),za=n("a"),pb=n("span"),f(gl.$$.fragment),DP=l(),mb=n("span"),jP=r("Using Trainer for accelerated PyTorch Training on Mac"),Y1=l(),Ke=n("p"),PP=r(`With PyTorch v1.12 release, developers and researchers can take advantage of Apple silicon GPUs for significantly faster model training.
This unlocks the ability to perform machine learning workflows like prototyping and fine-tuning locally, right on Mac.
Apple\u2019s Metal Performance Shaders (MPS) as a backend for PyTorch enables this and can be used via the new `),hb=n("code"),JP=r('"mps"'),CP=r(` device.
This will map computational graphs and primitives on the MPS Graph framework and tuned kernels provided by MPS.
For more information please refer official documents `),_l=n("a"),FP=r("Introducing Accelerated PyTorch Training on Mac"),NP=r(`
and `),bl=n("a"),zP=r("MPS BACKEND"),OP=r("."),H1=l(),f(Oa.$$.fragment),Q1=l(),gc=n("p"),ub=n("strong"),WP=r("Benefits of Training and Inference using Apple Silicon Chips"),K1=l(),ao=n("ol"),fb=n("li"),RP=r("Enables users to train larger networks or batch sizes locally"),LP=l(),gb=n("li"),BP=r(`Reduces data retrieval latency and provides the GPU with direct access to the full memory store due to unified memory architecture.
Therefore, improving end-to-end performance.`),GP=l(),_b=n("li"),ZP=r("Reduces costs associated with cloud-based development or the need for additional local GPUs."),ew=l(),nr=n("p"),bb=n("strong"),VP=r("Pre-requisites"),XP=r(`: To install torch with mps support,
please follow this nice medium article `),vl=n("a"),YP=r("GPU-Acceleration Comes to PyTorch on M1 Macs"),HP=r("."),tw=l(),_t=n("p"),vb=n("strong"),QP=r("Usage"),KP=r(`:
`),yb=n("code"),e6=r("mps"),t6=r(" device will be used by default if available similar to the way "),wb=n("code"),o6=r("cuda"),r6=r(` device is used.
Therefore, no action from user is required.
For example, you can run the official Glue text classififcation task (from the root folder) using Apple Silicon GPU with below command:`),ow=l(),f(yl.$$.fragment),rw=l(),_c=n("p"),Tb=n("strong"),a6=r("A few caveats to be aware of"),aw=l(),Wa=n("ol"),wl=n("li"),n6=r(`Some PyTorch operations have not been implemented in mps and will throw an error.
One way to get around that is to set the environment variable `),Eb=n("code"),s6=r("PYTORCH_ENABLE_MPS_FALLBACK=1"),i6=r(`,
which will fallback to CPU for these operations. It still throws a UserWarning however.`),l6=l(),Ue=n("li"),d6=r("Distributed setups "),Ab=n("code"),c6=r("gloo"),p6=r(" and "),$b=n("code"),m6=r("nccl"),h6=r(" are not working with "),kb=n("code"),u6=r("mps"),f6=r(` device.
This means that currently only single GPU of `),xb=n("code"),g6=r("mps"),_6=r(" device type can be used."),nw=l(),no=n("p"),b6=r("Finally, please, remember that, \u{1F917} "),Mb=n("code"),v6=r("Trainer"),y6=r(` only integrates MPS backend, therefore if you
have any problems or questions with regards to MPS backend usage, please,
file an issue with `),Tl=n("a"),w6=r("PyTorch GitHub"),T6=r("."),sw=l(),sr=n("h2"),Ra=n("a"),Ib=n("span"),f(El.$$.fragment),E6=l(),Sb=n("span"),A6=r("Using Accelerate Launcher with Trainer"),iw=l(),bc=n("p"),$6=r("Accelerate now powers Trainer. In terms of what users should expect:"),lw=l(),La=n("ul"),qb=n("li"),k6=r("They can keep using the Trainer ingterations such as FSDP, DeepSpeed vis trainer arguments without any changes on their part."),x6=l(),Ub=n("li"),M6=r("They can now use Accelerate Launcher with Trainer (recommended)."),dw=l(),vc=n("p"),I6=r("Steps to use Accelerate Launcher with Trainer:"),cw=l(),so=n("ol"),Db=n("li"),io=n("p"),S6=r("Make sure \u{1F917} Accelerate is installed, you can\u2019t use the "),jb=n("code"),q6=r("Trainer"),U6=r(" without it anyway. If not "),Pb=n("code"),D6=r("pip install accelerate"),j6=r(". You may also need to update your version of Accelerate: "),Jb=n("code"),P6=r("pip install accelerate --upgrade"),J6=l(),K=n("li"),Al=n("p"),C6=r("Run "),Cb=n("code"),F6=r("accelerate config"),N6=r(` and fill the questionnaire. Below are example accelerate configs:
a. DDP Multi-node Multi-GPU config:`),z6=l(),f($l.$$.fragment),O6=l(),Fb=n("p"),W6=r("b. FSDP config:"),R6=l(),f(kl.$$.fragment),L6=l(),Nb=n("p"),B6=r("c. DeepSpeed config pointing to a file:"),G6=l(),f(xl.$$.fragment),Z6=l(),zb=n("p"),V6=r("d. DeepSpeed config using accelerate plugin:"),X6=l(),f(Ml.$$.fragment),Y6=l(),Ob=n("li"),ir=n("p"),H6=r(`Run the Trainer script with args other than the ones handled above by accelerate config or launcher args.
Below is an example to run `),Wb=n("code"),Q6=r("run_glue.py"),K6=r(" using "),Rb=n("code"),eJ=r("accelerate launcher"),tJ=r(" with FSDP config from above."),pw=l(),f(Il.$$.fragment),mw=l(),Sl=n("ol"),ql=n("li"),oJ=r("You can also directly use the cmd args for "),Lb=n("code"),rJ=r("accelerate launch"),aJ=r(". Above example would map to:"),hw=l(),f(Ul.$$.fragment),uw=l(),Ba=n("p"),nJ=r("For more information, please refer the \u{1F917} Accelerate CLI guide: "),Dl=n("a"),sJ=r("Launching your \u{1F917} Accelerate scripts"),iJ=r("."),fw=l(),yc=n("p"),lJ=r("Sections that were moved:"),gw=l(),M=n("p"),dJ=r("[ "),wc=n("a"),cJ=r("DeepSpeed"),Bb=n("a"),pJ=r(`
| `),Tc=n("a"),mJ=r("Installation"),Gb=n("a"),hJ=r(`
| `),Ec=n("a"),uJ=r("Deployment with multiple GPUs"),Zb=n("a"),fJ=r(`
| `),Ac=n("a"),gJ=r("Deployment with one GPU"),Vb=n("a"),_J=r(`
| `),$c=n("a"),bJ=r("Deployment in Notebooks"),Xb=n("a"),vJ=r(`
| `),kc=n("a"),yJ=r("Configuration"),Yb=n("a"),wJ=r(`
| `),xc=n("a"),TJ=r("Passing Configuration"),Hb=n("a"),EJ=r(`
| `),Mc=n("a"),AJ=r("Shared Configuration"),Qb=n("a"),$J=r(`
| `),Ic=n("a"),kJ=r("ZeRO"),Kb=n("a"),xJ=r(`
| `),Sc=n("a"),MJ=r("ZeRO-2 Config"),ev=n("a"),IJ=r(`
| `),qc=n("a"),SJ=r("ZeRO-3 Config"),tv=n("a"),qJ=r(`
| `),Uc=n("a"),UJ=r("NVMe Support"),ov=n("a"),DJ=r(`
| `),Dc=n("a"),jJ=r("ZeRO-2 vs ZeRO-3 Performance"),rv=n("a"),PJ=r(`
| `),jc=n("a"),JJ=r("ZeRO-2 Example"),av=n("a"),CJ=r(`
| `),Pc=n("a"),FJ=r("ZeRO-3 Example"),nv=n("a"),NJ=r(`
| `),Jc=n("a"),zJ=r("Optimizer"),sv=n("a"),OJ=r(`
| `),Cc=n("a"),WJ=r("Scheduler"),iv=n("a"),RJ=r(`
| `),Fc=n("a"),LJ=r("fp32 Precision"),lv=n("a"),BJ=r(`
| `),Nc=n("a"),GJ=r("Automatic Mixed Precision"),dv=n("a"),ZJ=r(`
| `),zc=n("a"),VJ=r("Batch Size"),cv=n("a"),XJ=r(`
| `),Oc=n("a"),YJ=r("Gradient Accumulation"),pv=n("a"),HJ=r(`
| `),Wc=n("a"),QJ=r("Gradient Clipping"),mv=n("a"),KJ=r(`
| `),Rc=n("a"),e8=r("Getting The Model Weights Out"),hv=n("a"),t8=r(`
]`),this.h()},l(t){const c=DL('[data-svelte="svelte-1phssyn"]',document.head);u=s(c,"META",{name:!0,content:!0}),c.forEach(o),$=d(t),T=s(t,"H1",{class:!0});var jl=i(T);w=s(jl,"A",{id:!0,class:!0,href:!0});var uv=i(w);k=s(uv,"SPAN",{});var fv=i(k);g(h.$$.fragment,fv),fv.forEach(o),uv.forEach(o),E=d(jl),C=s(jl,"SPAN",{});var gv=i(C);z=a(gv,"Trainer"),gv.forEach(o),jl.forEach(o),j=d(t),R=s(t,"P",{});var lr=i(R);G=a(lr,"The "),ee=s(lr,"A",{href:!0});var _v=i(ee);Q=a(_v,"Trainer"),_v.forEach(o),Y=a(lr," class provides an API for feature-complete training in PyTorch for most standard use cases. It\u2019s used in most of the "),X=s(lr,"A",{href:!0,rel:!0});var bv=i(X);ue=a(bv,"example scripts"),bv.forEach(o),H=a(lr,"."),lr.forEach(o),L=d(t),O=s(t,"P",{});var dr=i(O);ne=a(dr,"Before instantiating your "),F=s(dr,"A",{href:!0});var vv=i(F);Ee=a(vv,"Trainer"),vv.forEach(o),Ae=a(dr,", create a "),se=s(dr,"A",{href:!0});var yv=i(se);bt=a(yv,"TrainingArguments"),yv.forEach(o),vt=a(dr," to access all the points of customization during training."),dr.forEach(o),be=d(t),je=s(t,"P",{});var Pl=i(je);_n=a(Pl,"The API supports distributed training on multiple GPUs/TPUs, mixed precision through "),$e=s(Pl,"A",{href:!0,rel:!0});var wv=i($e);bn=a(wv,"NVIDIA Apex"),wv.forEach(o),vn=a(Pl," and Native AMP for PyTorch."),Pl.forEach(o),ie=d(t),re=s(t,"P",{});var Jl=i(re);Wl=a(Jl,"The "),ke=s(Jl,"A",{href:!0});var Tv=i(ke);fr=a(Tv,"Trainer"),Tv.forEach(o),Rl=a(Jl," contains the basic training loop which supports the above features. To inject custom behavior you can subclass them and override the following methods:"),Jl.forEach(o),vo=d(t),W=s(t,"UL",{});var B=i(W);ae=s(B,"LI",{});var Lc=i(ae);gr=s(Lc,"STRONG",{});var Ev=i(gr);Ll=a(Ev,"get_train_dataloader"),Ev.forEach(o),Bl=a(Lc," \u2014 Creates the training DataLoader."),Lc.forEach(o),Gl=d(B),Zl=s(B,"LI",{});var Bc=i(Zl);om=s(Bc,"STRONG",{});var Av=i(om);mT=a(Av,"get_eval_dataloader"),Av.forEach(o),hT=a(Bc," \u2014 Creates the evaluation DataLoader."),Bc.forEach(o),uT=d(B),Vl=s(B,"LI",{});var o8=i(Vl);rm=s(o8,"STRONG",{});var $8=i(rm);fT=a($8,"get_test_dataloader"),$8.forEach(o),gT=a(o8," \u2014 Creates the test DataLoader."),o8.forEach(o),_T=d(B),Xl=s(B,"LI",{});var r8=i(Xl);am=s(r8,"STRONG",{});var k8=i(am);bT=a(k8,"log"),k8.forEach(o),vT=a(r8," \u2014 Logs information on the various objects watching training."),r8.forEach(o),yT=d(B),yt=s(B,"LI",{});var Cl=i(yt);nm=s(Cl,"STRONG",{});var x8=i(nm);wT=a(x8,"create_optimizer_and_scheduler"),x8.forEach(o),TT=a(Cl,` \u2014 Sets up the optimizer and learning rate scheduler if they were not passed at
init. Note, that you can also subclass or override the `),sm=s(Cl,"CODE",{});var M8=i(sm);ET=a(M8,"create_optimizer"),M8.forEach(o),AT=a(Cl," and "),im=s(Cl,"CODE",{});var I8=i(im);$T=a(I8,"create_scheduler"),I8.forEach(o),kT=a(Cl,` methods
separately.`),Cl.forEach(o),xT=d(B),Yl=s(B,"LI",{});var a8=i(Yl);lm=s(a8,"STRONG",{});var S8=i(lm);MT=a(S8,"create_optimizer"),S8.forEach(o),IT=a(a8," \u2014 Sets up the optimizer if it wasn\u2019t passed at init."),a8.forEach(o),ST=d(B),Hl=s(B,"LI",{});var n8=i(Hl);dm=s(n8,"STRONG",{});var q8=i(dm);qT=a(q8,"create_scheduler"),q8.forEach(o),UT=a(n8," \u2014 Sets up the learning rate scheduler if it wasn\u2019t passed at init."),n8.forEach(o),DT=d(B),Ql=s(B,"LI",{});var s8=i(Ql);cm=s(s8,"STRONG",{});var U8=i(cm);jT=a(U8,"compute_loss"),U8.forEach(o),PT=a(s8," - Computes the loss on a batch of training inputs."),s8.forEach(o),JT=d(B),Kl=s(B,"LI",{});var i8=i(Kl);pm=s(i8,"STRONG",{});var D8=i(pm);CT=a(D8,"training_step"),D8.forEach(o),FT=a(i8," \u2014 Performs a training step."),i8.forEach(o),NT=d(B),ed=s(B,"LI",{});var l8=i(ed);mm=s(l8,"STRONG",{});var j8=i(mm);zT=a(j8,"prediction_step"),j8.forEach(o),OT=a(l8," \u2014 Performs an evaluation/test step."),l8.forEach(o),WT=d(B),td=s(B,"LI",{});var d8=i(td);hm=s(d8,"STRONG",{});var P8=i(hm);RT=a(P8,"evaluate"),P8.forEach(o),LT=a(d8," \u2014 Runs an evaluation loop and returns metrics."),d8.forEach(o),BT=d(B),od=s(B,"LI",{});var c8=i(od);um=s(c8,"STRONG",{});var J8=i(um);GT=a(J8,"predict"),J8.forEach(o),ZT=a(c8," \u2014 Returns predictions (with metrics if labels are available) on a test set."),c8.forEach(o),B.forEach(o),Uv=d(t),g(_r.$$.fragment,t),Dv=d(t),br=s(t,"P",{});var bw=i(br);VT=a(bw,"Here is an example of how to customize "),rd=s(bw,"A",{href:!0});var C8=i(rd);XT=a(C8,"Trainer"),C8.forEach(o),YT=a(bw," to use a weighted loss (useful when you have an unbalanced training set):"),bw.forEach(o),jv=d(t),g(yn.$$.fragment,t),Pv=d(t),wt=s(t,"P",{});var Gc=i(wt);HT=a(Gc,"Another way to customize the training loop behavior for the PyTorch "),ad=s(Gc,"A",{href:!0});var F8=i(ad);QT=a(F8,"Trainer"),F8.forEach(o),KT=a(Gc," is to use "),nd=s(Gc,"A",{href:!0});var N8=i(nd);e0=a(N8,"callbacks"),N8.forEach(o),t0=a(Gc," that can inspect the training loop state (for progress reporting, logging on TensorBoard or other ML platforms\u2026) and take decisions (like early stopping)."),Gc.forEach(o),Jv=d(t),yo=s(t,"H2",{class:!0});var vw=i(yo);vr=s(vw,"A",{id:!0,class:!0,href:!0});var z8=i(vr);fm=s(z8,"SPAN",{});var O8=i(fm);g(wn.$$.fragment,O8),O8.forEach(o),z8.forEach(o),o0=d(vw),gm=s(vw,"SPAN",{});var W8=i(gm);r0=a(W8,"Trainer"),W8.forEach(o),vw.forEach(o),Cv=d(t),A=s(t,"DIV",{class:!0});var x=i(A);g(Tn.$$.fragment,x),a0=d(x),_m=s(x,"P",{});var R8=i(_m);n0=a(R8,"Trainer is a simple but feature-complete training and eval loop for PyTorch, optimized for \u{1F917} Transformers."),R8.forEach(o),s0=d(x),bm=s(x,"P",{});var L8=i(bm);i0=a(L8,"Important attributes:"),L8.forEach(o),l0=d(x),xe=s(x,"UL",{});var lo=i(xe);yr=s(lo,"LI",{});var $v=i(yr);vm=s($v,"STRONG",{});var B8=i(vm);d0=a(B8,"model"),B8.forEach(o),c0=a($v," \u2014 Always points to the core model. If using a transformers model, it will be a "),sd=s($v,"A",{href:!0});var G8=i(sd);p0=a(G8,"PreTrainedModel"),G8.forEach(o),m0=a($v,`
subclass.`),$v.forEach(o),h0=d(lo),le=s(lo,"LI",{});var De=i(le);ym=s(De,"STRONG",{});var Z8=i(ym);u0=a(Z8,"model_wrapped"),Z8.forEach(o),f0=a(De,` \u2014 Always points to the most external model in case one or more other modules wrap the
original model. This is the model that should be used for the forward pass. For example, under `),wm=s(De,"CODE",{});var V8=i(wm);g0=a(V8,"DeepSpeed"),V8.forEach(o),_0=a(De,`,
the inner model is wrapped in `),Tm=s(De,"CODE",{});var X8=i(Tm);b0=a(X8,"DeepSpeed"),X8.forEach(o),v0=a(De," and then again in "),Em=s(De,"CODE",{});var Y8=i(Em);y0=a(Y8,"torch.nn.DistributedDataParallel"),Y8.forEach(o),w0=a(De,`. If the inner
model hasn\u2019t been wrapped, then `),Am=s(De,"CODE",{});var H8=i(Am);T0=a(H8,"self.model_wrapped"),H8.forEach(o),E0=a(De," is the same as "),$m=s(De,"CODE",{});var Q8=i($m);A0=a(Q8,"self.model"),Q8.forEach(o),$0=a(De,"."),De.forEach(o),k0=d(lo),id=s(lo,"LI",{});var p8=i(id);km=s(p8,"STRONG",{});var K8=i(km);x0=a(K8,"is_model_parallel"),K8.forEach(o),M0=a(p8,` \u2014 Whether or not a model has been switched to a model parallel mode (different from
data parallelism, this means some of the model layers are split on different GPUs).`),p8.forEach(o),I0=d(lo),Pe=s(lo,"LI",{});var cr=i(Pe);xm=s(cr,"STRONG",{});var eC=i(xm);S0=a(eC,"place_model_on_device"),eC.forEach(o),q0=a(cr,` \u2014 Whether or not to automatically place the model on the device - it will be set
to `),Mm=s(cr,"CODE",{});var tC=i(Mm);U0=a(tC,"False"),tC.forEach(o),D0=a(cr,` if model parallel or deepspeed is used, or if the default
`),Im=s(cr,"CODE",{});var oC=i(Im);j0=a(oC,"TrainingArguments.place_model_on_device"),oC.forEach(o),P0=a(cr," is overridden to return "),Sm=s(cr,"CODE",{});var rC=i(Sm);J0=a(rC,"False"),rC.forEach(o),C0=a(cr," ."),cr.forEach(o),F0=d(lo),Je=s(lo,"LI",{});var pr=i(Je);qm=s(pr,"STRONG",{});var aC=i(qm);N0=a(aC,"is_in_train"),aC.forEach(o),z0=a(pr," \u2014 Whether or not a model is currently running "),Um=s(pr,"CODE",{});var nC=i(Um);O0=a(nC,"train"),nC.forEach(o),W0=a(pr," (e.g. when "),Dm=s(pr,"CODE",{});var sC=i(Dm);R0=a(sC,"evaluate"),sC.forEach(o),L0=a(pr,` is called while
in `),jm=s(pr,"CODE",{});var iC=i(jm);B0=a(iC,"train"),iC.forEach(o),G0=a(pr,")"),pr.forEach(o),lo.forEach(o),Z0=d(x),wr=s(x,"DIV",{class:!0});var yw=i(wr);g(En.$$.fragment,yw),V0=d(yw),An=s(yw,"P",{});var ww=i(An);X0=a(ww,"Add a callback to the current list of "),Pm=s(ww,"CODE",{});var lC=i(Pm);Y0=a(lC,"~transformer.TrainerCallback"),lC.forEach(o),H0=a(ww,"."),ww.forEach(o),yw.forEach(o),Q0=d(x),Tr=s(x,"DIV",{class:!0});var Tw=i(Tr);g($n.$$.fragment,Tw),K0=d(Tw),kn=s(Tw,"P",{});var Ew=i(kn);eE=a(Ew,"A helper wrapper that creates an appropriate context manager for "),Jm=s(Ew,"CODE",{});var dC=i(Jm);tE=a(dC,"autocast"),dC.forEach(o),oE=a(Ew,` while feeding it the desired
arguments, depending on the situation.`),Ew.forEach(o),Tw.forEach(o),rE=d(x),Tt=s(x,"DIV",{class:!0});var Zc=i(Tt);g(xn.$$.fragment,Zc),aE=d(Zc),Cm=s(Zc,"P",{});var cC=i(Cm);nE=a(cC,"How the loss is computed by Trainer. By default, all models return the loss in the first element."),cC.forEach(o),sE=d(Zc),Fm=s(Zc,"P",{});var pC=i(Fm);iE=a(pC,"Subclass and override for custom behavior."),pC.forEach(o),Zc.forEach(o),lE=d(x),Er=s(x,"DIV",{class:!0});var Aw=i(Er);g(Mn.$$.fragment,Aw),dE=d(Aw),Nm=s(Aw,"P",{});var mC=i(Nm);cE=a(mC,"A helper wrapper to group together context managers."),mC.forEach(o),Aw.forEach(o),pE=d(x),Ar=s(x,"DIV",{class:!0});var $w=i(Ar);g(In.$$.fragment,$w),mE=d($w),Sn=s($w,"P",{});var kw=i(Sn);hE=a(kw,"Creates a draft of a model card using the information available to the "),zm=s(kw,"CODE",{});var hC=i(zm);uE=a(hC,"Trainer"),hC.forEach(o),fE=a(kw,"."),kw.forEach(o),$w.forEach(o),gE=d(x),Et=s(x,"DIV",{class:!0});var Vc=i(Et);g(qn.$$.fragment,Vc),_E=d(Vc),Om=s(Vc,"P",{});var uC=i(Om);bE=a(uC,"Setup the optimizer."),uC.forEach(o),vE=d(Vc),Un=s(Vc,"P",{});var xw=i(Un);yE=a(xw,`We provide a reasonable default that works well. If you want to use something else, you can pass a tuple in the
Trainer\u2019s init through `),Wm=s(xw,"CODE",{});var fC=i(Wm);wE=a(fC,"optimizers"),fC.forEach(o),TE=a(xw,", or subclass and override this method in a subclass."),xw.forEach(o),Vc.forEach(o),EE=d(x),At=s(x,"DIV",{class:!0});var Xc=i(At);g(Dn.$$.fragment,Xc),AE=d(Xc),Rm=s(Xc,"P",{});var gC=i(Rm);$E=a(gC,"Setup the optimizer and the learning rate scheduler."),gC.forEach(o),kE=d(Xc),it=s(Xc,"P",{});var Ga=i(it);xE=a(Ga,`We provide a reasonable default that works well. If you want to use something else, you can pass a tuple in the
Trainer\u2019s init through `),Lm=s(Ga,"CODE",{});var _C=i(Lm);ME=a(_C,"optimizers"),_C.forEach(o),IE=a(Ga,", or subclass and override this method (or "),Bm=s(Ga,"CODE",{});var bC=i(Bm);SE=a(bC,"create_optimizer"),bC.forEach(o),qE=a(Ga,` and/or
`),Gm=s(Ga,"CODE",{});var vC=i(Gm);UE=a(vC,"create_scheduler"),vC.forEach(o),DE=a(Ga,") in a subclass."),Ga.forEach(o),Xc.forEach(o),jE=d(x),$r=s(x,"DIV",{class:!0});var Mw=i($r);g(jn.$$.fragment,Mw),PE=d(Mw),Zm=s(Mw,"P",{});var yC=i(Zm);JE=a(yC,`Setup the scheduler. The optimizer of the trainer must have been set up either before this method is called or
passed as an argument.`),yC.forEach(o),Mw.forEach(o),CE=d(x),Ce=s(x,"DIV",{class:!0});var Za=i(Ce);g(Pn.$$.fragment,Za),FE=d(Za),Vm=s(Za,"P",{});var wC=i(Vm);NE=a(wC,"Run evaluation and returns metrics."),wC.forEach(o),zE=d(Za),Jn=s(Za,"P",{});var Iw=i(Jn);OE=a(Iw,`The calling script will be responsible for providing a method to compute metrics, as they are task-dependent
(pass it to the init `),Xm=s(Iw,"CODE",{});var TC=i(Xm);WE=a(TC,"compute_metrics"),TC.forEach(o),RE=a(Iw," argument)."),Iw.forEach(o),LE=d(Za),Ym=s(Za,"P",{});var EC=i(Ym);BE=a(EC,"You can also subclass and override this method to inject custom behavior."),EC.forEach(o),Za.forEach(o),GE=d(x),$t=s(x,"DIV",{class:!0});var Yc=i($t);g(Cn.$$.fragment,Yc),ZE=d(Yc),wo=s(Yc,"P",{});var Hc=i(wo);VE=a(Hc,"Prediction/evaluation loop, shared by "),Hm=s(Hc,"CODE",{});var AC=i(Hm);XE=a(AC,"Trainer.evaluate()"),AC.forEach(o),YE=a(Hc," and "),Qm=s(Hc,"CODE",{});var $C=i(Qm);HE=a($C,"Trainer.predict()"),$C.forEach(o),QE=a(Hc,"."),Hc.forEach(o),KE=d(Yc),Km=s(Yc,"P",{});var kC=i(Km);e4=a(kC,"Works both with or without labels."),kC.forEach(o),Yc.forEach(o),t4=d(x),kr=s(x,"DIV",{class:!0});var Sw=i(kr);g(Fn.$$.fragment,Sw),o4=d(Sw),Nn=s(Sw,"P",{});var qw=i(Nn);r4=a(qw,"For models that inherit from "),ld=s(qw,"A",{href:!0});var xC=i(ld);a4=a(xC,"PreTrainedModel"),xC.forEach(o),n4=a(qw,`, uses that method to compute the number of floating point
operations for every backward + forward pass. If using another model, either implement such a method in the
model or subclass and override this method.`),qw.forEach(o),Sw.forEach(o),s4=d(x),kt=s(x,"DIV",{class:!0});var Qc=i(kt);g(zn.$$.fragment,Qc),i4=d(Qc),On=s(Qc,"P",{});var Uw=i(On);l4=a(Uw,"Returns the evaluation "),eh=s(Uw,"CODE",{});var MC=i(eh);d4=a(MC,"~torch.utils.data.DataLoader"),MC.forEach(o),c4=a(Uw,"."),Uw.forEach(o),p4=d(Qc),th=s(Qc,"P",{});var IC=i(th);m4=a(IC,"Subclass and override this method if you want to inject some custom behavior."),IC.forEach(o),Qc.forEach(o),h4=d(x),xr=s(x,"DIV",{class:!0});var Dw=i(xr);g(Wn.$$.fragment,Dw),u4=d(Dw),oh=s(Dw,"P",{});var SC=i(oh);f4=a(SC,"Returns the optimizer class and optimizer parameters based on the training arguments."),SC.forEach(o),Dw.forEach(o),g4=d(x),xt=s(x,"DIV",{class:!0});var Kc=i(xt);g(Rn.$$.fragment,Kc),_4=d(Kc),Ln=s(Kc,"P",{});var jw=i(Ln);b4=a(jw,"Returns the test "),rh=s(jw,"CODE",{});var qC=i(rh);v4=a(qC,"~torch.utils.data.DataLoader"),qC.forEach(o),y4=a(jw,"."),jw.forEach(o),w4=d(Kc),ah=s(Kc,"P",{});var UC=i(ah);T4=a(UC,"Subclass and override this method if you want to inject some custom behavior."),UC.forEach(o),Kc.forEach(o),E4=d(x),Fe=s(x,"DIV",{class:!0});var Va=i(Fe);g(Bn.$$.fragment,Va),A4=d(Va),Gn=s(Va,"P",{});var Pw=i(Gn);$4=a(Pw,"Returns the training "),nh=s(Pw,"CODE",{});var DC=i(nh);k4=a(DC,"~torch.utils.data.DataLoader"),DC.forEach(o),x4=a(Pw,"."),Pw.forEach(o),M4=d(Va),To=s(Va,"P",{});var ep=i(To);I4=a(ep,"Will use no sampler if "),sh=s(ep,"CODE",{});var jC=i(sh);S4=a(jC,"train_dataset"),jC.forEach(o),q4=a(ep," does not implement "),ih=s(ep,"CODE",{});var PC=i(ih);U4=a(PC,"__len__"),PC.forEach(o),D4=a(ep,`, a random sampler (adapted to distributed
training if necessary) otherwise.`),ep.forEach(o),j4=d(Va),lh=s(Va,"P",{});var JC=i(lh);P4=a(JC,"Subclass and override this method if you want to inject some custom behavior."),JC.forEach(o),Va.forEach(o),J4=d(x),Mt=s(x,"DIV",{class:!0});var tp=i(Mt);g(Zn.$$.fragment,tp),C4=d(tp),Me=s(tp,"P",{});var co=i(Me);F4=a(co,"Launch an hyperparameter search using "),dh=s(co,"CODE",{});var CC=i(dh);N4=a(CC,"optuna"),CC.forEach(o),z4=a(co," or "),ch=s(co,"CODE",{});var FC=i(ch);O4=a(FC,"Ray Tune"),FC.forEach(o),W4=a(co," or "),ph=s(co,"CODE",{});var NC=i(ph);R4=a(NC,"SigOpt"),NC.forEach(o),L4=a(co,`. The optimized quantity is determined
by `),mh=s(co,"CODE",{});var zC=i(mh);B4=a(zC,"compute_objective"),zC.forEach(o),G4=a(co,`, which defaults to a function returning the evaluation loss when no metric is provided,
the sum of all metrics otherwise.`),co.forEach(o),Z4=d(tp),g(Mr.$$.fragment,tp),tp.forEach(o),V4=d(x),It=s(x,"DIV",{class:!0});var op=i(It);g(Vn.$$.fragment,op),X4=d(op),Xn=s(op,"P",{});var Jw=i(Xn);Y4=a(Jw,"Initializes a git repo in "),hh=s(Jw,"CODE",{});var OC=i(hh);H4=a(OC,"self.args.hub_model_id"),OC.forEach(o),Q4=a(Jw,"."),Jw.forEach(o),K4=d(op),g(Ir.$$.fragment,op),op.forEach(o),eA=d(x),Sr=s(x,"DIV",{class:!0});var Cw=i(Sr);g(Yn.$$.fragment,Cw),tA=d(Cw),Hn=s(Cw,"P",{});var Fw=i(Hn);oA=a(Fw,"Initializes a git repo in "),uh=s(Fw,"CODE",{});var WC=i(uh);rA=a(WC,"self.args.hub_model_id"),WC.forEach(o),aA=a(Fw,"."),Fw.forEach(o),Cw.forEach(o),nA=d(x),qr=s(x,"DIV",{class:!0});var Nw=i(qr);g(Qn.$$.fragment,Nw),sA=d(Nw),fh=s(Nw,"P",{});var RC=i(fh);iA=a(RC,`Whether or not this process is the local (e.g., on one machine if training in a distributed fashion on several
machines) main process.`),RC.forEach(o),Nw.forEach(o),lA=d(x),Ur=s(x,"DIV",{class:!0});var zw=i(Ur);g(Kn.$$.fragment,zw),dA=d(zw),es=s(zw,"P",{});var Ow=i(es);cA=a(Ow,`Whether or not this process is the global main process (when training in a distributed fashion on several
machines, this is only going to be `),gh=s(Ow,"CODE",{});var LC=i(gh);pA=a(LC,"True"),LC.forEach(o),mA=a(Ow," for one process)."),Ow.forEach(o),zw.forEach(o),hA=d(x),St=s(x,"DIV",{class:!0});var rp=i(St);g(ts.$$.fragment,rp),uA=d(rp),os=s(rp,"P",{});var Ww=i(os);fA=a(Ww,"Log "),_h=s(Ww,"CODE",{});var BC=i(_h);gA=a(BC,"logs"),BC.forEach(o),_A=a(Ww," on the various objects watching training."),Ww.forEach(o),bA=d(rp),bh=s(rp,"P",{});var GC=i(bh);vA=a(GC,"Subclass and override this method to inject custom behavior."),GC.forEach(o),rp.forEach(o),yA=d(x),P=s(x,"DIV",{class:!0});var N=i(P);g(rs.$$.fragment,N),wA=d(N),vh=s(N,"P",{});var ZC=i(vh);TA=a(ZC,"Log metrics in a specially formatted way"),ZC.forEach(o),EA=d(N),yh=s(N,"P",{});var VC=i(yh);AA=a(VC,"Under distributed environment this is done only for a process with rank 0."),VC.forEach(o),$A=d(N),wh=s(N,"P",{});var XC=i(wh);kA=a(XC,"Notes on memory reports:"),XC.forEach(o),xA=d(N),Eo=s(N,"P",{});var ap=i(Eo);MA=a(ap,"In order to get memory usage report you need to install "),Th=s(ap,"CODE",{});var YC=i(Th);IA=a(YC,"psutil"),YC.forEach(o),SA=a(ap,". You can do that with "),Eh=s(ap,"CODE",{});var HC=i(Eh);qA=a(HC,"pip install psutil"),HC.forEach(o),UA=a(ap,"."),ap.forEach(o),DA=d(N),g(Dr.$$.fragment,N),jA=d(N),Ah=s(N,"P",{});var QC=i(Ah);$h=s(QC,"STRONG",{});var KC=i($h);PA=a(KC,"Understanding the reports:"),KC.forEach(o),QC.forEach(o),JA=d(N),lt=s(N,"UL",{});var Xa=i(lt);Ie=s(Xa,"LI",{});var po=i(Ie);CA=a(po,"the first segment, e.g., "),kh=s(po,"CODE",{});var e7=i(kh);FA=a(e7,"train__"),e7.forEach(o),NA=a(po,", tells you which stage the metrics are for. Reports starting with "),xh=s(po,"CODE",{});var t7=i(xh);zA=a(t7,"init_"),t7.forEach(o),OA=a(po,`
will be added to the first stage that gets run. So that if only evaluation is run, the memory usage for the
`),Mh=s(po,"CODE",{});var o7=i(Mh);WA=a(o7,"__init__"),o7.forEach(o),RA=a(po," will be reported along with the "),Ih=s(po,"CODE",{});var r7=i(Ih);LA=a(r7,"eval_"),r7.forEach(o),BA=a(po," metrics."),po.forEach(o),GA=d(Xa),Ao=s(Xa,"LI",{});var np=i(Ao);ZA=a(np,"the third segment, is either "),Sh=s(np,"CODE",{});var a7=i(Sh);VA=a(a7,"cpu"),a7.forEach(o),XA=a(np," or "),qh=s(np,"CODE",{});var n7=i(qh);YA=a(n7,"gpu"),n7.forEach(o),HA=a(np,`, tells you whether it\u2019s the general RAM or the gpu0 memory
metric.`),np.forEach(o),QA=d(Xa),dd=s(Xa,"LI",{});var m8=i(dd);Uh=s(m8,"CODE",{});var s7=i(Uh);KA=a(s7,"*_alloc_delta"),s7.forEach(o),e$=a(m8,` - is the difference in the used/allocated memory counter between the end and the start of the
stage - it can be negative if a function released more memory than it allocated.`),m8.forEach(o),t$=d(Xa),qt=s(Xa,"LI",{});var Fl=i(qt);Dh=s(Fl,"CODE",{});var i7=i(Dh);o$=a(i7,"*_peaked_delta"),i7.forEach(o),r$=a(Fl,` - is any extra memory that was consumed and then freed - relative to the current allocated
memory counter - it is never negative. When you look at the metrics of any stage you add up `),jh=s(Fl,"CODE",{});var l7=i(jh);a$=a(l7,"alloc_delta"),l7.forEach(o),n$=a(Fl,` +
`),Ph=s(Fl,"CODE",{});var d7=i(Ph);s$=a(d7,"peaked_delta"),d7.forEach(o),i$=a(Fl," and you know how much memory was needed to complete that stage."),Fl.forEach(o),Xa.forEach(o),l$=d(N),Jh=s(N,"P",{});var c7=i(Jh);d$=a(c7,`The reporting happens only for process of rank 0 and gpu 0 (if there is a gpu). Typically this is enough since the
main process does the bulk of work, but it could be not quite so if model parallel is used and then other GPUs may
use a different amount of gpu memory. This is also not the same under DataParallel where gpu0 may require much more
memory than the rest since it stores the gradient and optimizer states for all participating GPUS. Perhaps in the
future these reports will evolve to measure those too.`),c7.forEach(o),c$=d(N),Ch=s(N,"P",{});var p7=i(Ch);p$=a(p7,`The CPU RAM metric measures RSS (Resident Set Size) includes both the memory which is unique to the process and the
memory shared with other processes. It is important to note that it does not include swapped out memory, so the
reports could be imprecise.`),p7.forEach(o),m$=d(N),as=s(N,"P",{});var Rw=i(as);h$=a(Rw,`The CPU peak memory is measured using a sampling thread. Due to python\u2019s GIL it may miss some of the peak memory if
that thread didn\u2019t get a chance to run when the highest memory was used. Therefore this report can be less than
reality. Using `),Fh=s(Rw,"CODE",{});var m7=i(Fh);u$=a(m7,"tracemalloc"),m7.forEach(o),f$=a(Rw,` would have reported the exact peak memory, but it doesn\u2019t report memory allocations
outside of python. So if some C++ CUDA extension allocated its own memory it won\u2019t be reported. And therefore it
was dropped in favor of the memory sampling approach, which reads the current process memory usage.`),Rw.forEach(o),g$=d(N),dt=s(N,"P",{});var Ya=i(dt);_$=a(Ya,"The GPU allocated and peak memory reporting is done with "),Nh=s(Ya,"CODE",{});var h7=i(Nh);b$=a(h7,"torch.cuda.memory_allocated()"),h7.forEach(o),v$=a(Ya,` and
`),zh=s(Ya,"CODE",{});var u7=i(zh);y$=a(u7,"torch.cuda.max_memory_allocated()"),u7.forEach(o),w$=a(Ya,`. This metric reports only \u201Cdeltas\u201D for pytorch-specific allocations, as
`),Oh=s(Ya,"CODE",{});var f7=i(Oh);T$=a(f7,"torch.cuda"),f7.forEach(o),E$=a(Ya,` memory management system doesn\u2019t track any memory allocated outside of pytorch. For example, the very
first cuda call typically loads CUDA kernels, which may take from 0.5 to 2GB of GPU memory.`),Ya.forEach(o),A$=d(N),fe=s(N,"P",{});var et=i(fe);$$=a(et,"Note that this tracker doesn\u2019t account for memory allocations outside of "),cd=s(et,"A",{href:!0});var g7=i(cd);k$=a(g7,"Trainer"),g7.forEach(o),x$=a(et,"\u2019s "),Wh=s(et,"CODE",{});var _7=i(Wh);M$=a(_7,"__init__"),_7.forEach(o),I$=a(et,", "),Rh=s(et,"CODE",{});var b7=i(Rh);S$=a(b7,"train"),b7.forEach(o),q$=a(et,`,
`),Lh=s(et,"CODE",{});var v7=i(Lh);U$=a(v7,"evaluate"),v7.forEach(o),D$=a(et," and "),Bh=s(et,"CODE",{});var y7=i(Bh);j$=a(y7,"predict"),y7.forEach(o),P$=a(et," calls."),et.forEach(o),J$=d(N),Z=s(N,"P",{});var V=i(Z);C$=a(V,"Because "),Gh=s(V,"CODE",{});var w7=i(Gh);F$=a(w7,"evaluation"),w7.forEach(o),N$=a(V," calls may happen during "),Zh=s(V,"CODE",{});var T7=i(Zh);z$=a(T7,"train"),T7.forEach(o),O$=a(V,`, we can\u2019t handle nested invocations because
`),Vh=s(V,"CODE",{});var E7=i(Vh);W$=a(E7,"torch.cuda.max_memory_allocated"),E7.forEach(o),R$=a(V," is a single counter, so if it gets reset by a nested eval call, "),Xh=s(V,"CODE",{});var A7=i(Xh);L$=a(A7,"train"),A7.forEach(o),B$=a(V,`\u2019s tracker
will report incorrect info. If this `),ns=s(V,"A",{href:!0,rel:!0});var $7=i(ns);G$=a($7,"pytorch issue"),$7.forEach(o),Z$=a(V,` gets resolved
it will be possible to change this class to be re-entrant. Until then we will only track the outer level of
`),Yh=s(V,"CODE",{});var k7=i(Yh);V$=a(k7,"train"),k7.forEach(o),X$=a(V,", "),Hh=s(V,"CODE",{});var x7=i(Hh);Y$=a(x7,"evaluate"),x7.forEach(o),H$=a(V," and "),Qh=s(V,"CODE",{});var M7=i(Qh);Q$=a(M7,"predict"),M7.forEach(o),K$=a(V," methods. Which means that if "),Kh=s(V,"CODE",{});var I7=i(Kh);e3=a(I7,"eval"),I7.forEach(o),t3=a(V," is called during "),eu=s(V,"CODE",{});var S7=i(eu);o3=a(S7,"train"),S7.forEach(o),r3=a(V,`, it\u2019s the latter
that will account for its memory usage and that of the former.`),V.forEach(o),a3=d(N),Se=s(N,"P",{});var mo=i(Se);n3=a(mo,"This also means that if any other tool that is used along the "),pd=s(mo,"A",{href:!0});var q7=i(pd);s3=a(q7,"Trainer"),q7.forEach(o),i3=a(mo,` calls
`),tu=s(mo,"CODE",{});var U7=i(tu);l3=a(U7,"torch.cuda.reset_peak_memory_stats"),U7.forEach(o),d3=a(mo,", the gpu peak memory stats could be invalid. And the "),md=s(mo,"A",{href:!0});var D7=i(md);c3=a(D7,"Trainer"),D7.forEach(o),p3=a(mo,` will disrupt
the normal behavior of any such tools that rely on calling `),ou=s(mo,"CODE",{});var j7=i(ou);m3=a(j7,"torch.cuda.reset_peak_memory_stats"),j7.forEach(o),h3=a(mo," themselves."),mo.forEach(o),u3=d(N),ru=s(N,"P",{});var P7=i(ru);f3=a(P7,"For best performance you may want to consider turning the memory profiling off for production runs."),P7.forEach(o),N.forEach(o),g3=d(x),jr=s(x,"DIV",{class:!0});var Lw=i(jr);g(ss.$$.fragment,Lw),_3=d(Lw),au=s(Lw,"P",{});var J7=i(au);b3=a(J7,"Reformat Trainer metrics values to a human-readable format"),J7.forEach(o),Lw.forEach(o),v3=d(x),Pr=s(x,"DIV",{class:!0});var Bw=i(Pr);g(is.$$.fragment,Bw),y3=d(Bw),ls=s(Bw,"P",{});var Gw=i(ls);w3=a(Gw,"Helper to get number of samples in a "),nu=s(Gw,"CODE",{});var C7=i(nu);T3=a(C7,"~torch.utils.data.DataLoader"),C7.forEach(o),E3=a(Gw,` by accessing its dataset. When
dataloader.dataset does not exist or has no length, estimates as best it can`),Gw.forEach(o),Bw.forEach(o),A3=d(x),Ut=s(x,"DIV",{class:!0});var sp=i(Ut);g(ds.$$.fragment,sp),$3=d(sp),cs=s(sp,"P",{});var Zw=i(cs);k3=a(Zw,"Remove a callback from the current list of "),su=s(Zw,"CODE",{});var F7=i(su);x3=a(F7,"~transformer.TrainerCallback"),F7.forEach(o),M3=a(Zw," and returns it."),Zw.forEach(o),I3=d(sp),ps=s(sp,"P",{});var Vw=i(ps);S3=a(Vw,"If the callback is not found, returns "),iu=s(Vw,"CODE",{});var N7=i(iu);q3=a(N7,"None"),N7.forEach(o),U3=a(Vw," (and no error is raised)."),Vw.forEach(o),sp.forEach(o),D3=d(x),de=s(x,"DIV",{class:!0});var tt=i(de);g(ms.$$.fragment,tt),j3=d(tt),lu=s(tt,"P",{});var z7=i(lu);P3=a(z7,"Run prediction and returns predictions and potential metrics."),z7.forEach(o),J3=d(tt),hs=s(tt,"P",{});var Xw=i(hs);C3=a(Xw,`Depending on the dataset and your use case, your test dataset may contain labels. In that case, this method
will also return metrics, like in `),du=s(Xw,"CODE",{});var O7=i(du);F3=a(O7,"evaluate()"),O7.forEach(o),N3=a(Xw,"."),Xw.forEach(o),z3=d(tt),g(Jr.$$.fragment,tt),O3=d(tt),us=s(tt,"P",{});var Yw=i(us);W3=a(Yw,"Returns: "),cu=s(Yw,"EM",{});var W7=i(cu);R3=a(W7,"NamedTuple"),W7.forEach(o),L3=a(Yw," A namedtuple with the following keys:"),Yw.forEach(o),B3=d(tt),$o=s(tt,"UL",{});var ip=i($o);ko=s(ip,"LI",{});var lp=i(ko);G3=a(lp,"predictions ("),pu=s(lp,"CODE",{});var R7=i(pu);Z3=a(R7,"np.ndarray"),R7.forEach(o),V3=a(lp,"): The predictions on "),mu=s(lp,"CODE",{});var L7=i(mu);X3=a(L7,"test_dataset"),L7.forEach(o),Y3=a(lp,"."),lp.forEach(o),H3=d(ip),xo=s(ip,"LI",{});var dp=i(xo);Q3=a(dp,"label_ids ("),hu=s(dp,"CODE",{});var B7=i(hu);K3=a(B7,"np.ndarray"),B7.forEach(o),ek=a(dp,", "),uu=s(dp,"EM",{});var G7=i(uu);tk=a(G7,"optional"),G7.forEach(o),ok=a(dp,"): The labels (if the dataset contained some)."),dp.forEach(o),rk=d(ip),Mo=s(ip,"LI",{});var cp=i(Mo);ak=a(cp,"metrics ("),fu=s(cp,"CODE",{});var Z7=i(fu);nk=a(Z7,"Dict[str, float]"),Z7.forEach(o),sk=a(cp,", "),gu=s(cp,"EM",{});var V7=i(gu);ik=a(V7,"optional"),V7.forEach(o),lk=a(cp,`): The potential dictionary of metrics (if the dataset contained
labels).`),cp.forEach(o),ip.forEach(o),tt.forEach(o),dk=d(x),Dt=s(x,"DIV",{class:!0});var pp=i(Dt);g(fs.$$.fragment,pp),ck=d(pp),Io=s(pp,"P",{});var mp=i(Io);pk=a(mp,"Prediction/evaluation loop, shared by "),_u=s(mp,"CODE",{});var X7=i(_u);mk=a(X7,"Trainer.evaluate()"),X7.forEach(o),hk=a(mp," and "),bu=s(mp,"CODE",{});var Y7=i(bu);uk=a(Y7,"Trainer.predict()"),Y7.forEach(o),fk=a(mp,"."),mp.forEach(o),gk=d(pp),vu=s(pp,"P",{});var H7=i(vu);_k=a(H7,"Works both with or without labels."),H7.forEach(o),pp.forEach(o),bk=d(x),jt=s(x,"DIV",{class:!0});var hp=i(jt);g(gs.$$.fragment,hp),vk=d(hp),So=s(hp,"P",{});var up=i(So);yk=a(up,"Perform an evaluation step on "),yu=s(up,"CODE",{});var Q7=i(yu);wk=a(Q7,"model"),Q7.forEach(o),Tk=a(up," using "),wu=s(up,"CODE",{});var K7=i(wu);Ek=a(K7,"inputs"),K7.forEach(o),Ak=a(up,"."),up.forEach(o),$k=d(hp),Tu=s(hp,"P",{});var eF=i(Tu);kk=a(eF,"Subclass and override to inject custom behavior."),eF.forEach(o),hp.forEach(o),xk=d(x),Cr=s(x,"DIV",{class:!0});var Hw=i(Cr);g(_s.$$.fragment,Hw),Mk=d(Hw),ct=s(Hw,"P",{});var Ha=i(ct);Ik=a(Ha,"Upload "),Eu=s(Ha,"CODE",{});var tF=i(Eu);Sk=a(tF,"self.model"),tF.forEach(o),qk=a(Ha," and "),Au=s(Ha,"CODE",{});var oF=i(Au);Uk=a(oF,"self.tokenizer"),oF.forEach(o),Dk=a(Ha," to the \u{1F917} model hub on the repo "),$u=s(Ha,"CODE",{});var rF=i($u);jk=a(rF,"self.args.hub_model_id"),rF.forEach(o),Pk=a(Ha,"."),Ha.forEach(o),Hw.forEach(o),Jk=d(x),Fr=s(x,"DIV",{class:!0});var Qw=i(Fr);g(bs.$$.fragment,Qw),Ck=d(Qw),vs=s(Qw,"P",{});var Kw=i(vs);Fk=a(Kw,"Remove a callback from the current list of "),ku=s(Kw,"CODE",{});var aF=i(ku);Nk=a(aF,"~transformer.TrainerCallback"),aF.forEach(o),zk=a(Kw,"."),Kw.forEach(o),Qw.forEach(o),Ok=d(x),Ne=s(x,"DIV",{class:!0});var Qa=i(Ne);g(ys.$$.fragment,Qa),Wk=d(Qa),ws=s(Qa,"P",{});var e2=i(ws);Rk=a(e2,"Save metrics into a json file for that split, e.g. "),xu=s(e2,"CODE",{});var nF=i(xu);Lk=a(nF,"train_results.json"),nF.forEach(o),Bk=a(e2,"."),e2.forEach(o),Gk=d(Qa),Mu=s(Qa,"P",{});var sF=i(Mu);Zk=a(sF,"Under distributed environment this is done only for a process with rank 0."),sF.forEach(o),Vk=d(Qa),Ts=s(Qa,"P",{});var t2=i(Ts);Xk=a(t2,"To understand the metrics please read the docstring of "),hd=s(t2,"A",{href:!0});var iF=i(hd);Yk=a(iF,"log_metrics()"),iF.forEach(o),Hk=a(t2,`. The only difference is that raw
unformatted numbers are saved in the current method.`),t2.forEach(o),Qa.forEach(o),Qk=d(x),Pt=s(x,"DIV",{class:!0});var fp=i(Pt);g(Es.$$.fragment,fp),Kk=d(fp),As=s(fp,"P",{});var o2=i(As);ex=a(o2,"Will save the model, so you can reload it using "),Iu=s(o2,"CODE",{});var lF=i(Iu);tx=a(lF,"from_pretrained()"),lF.forEach(o),ox=a(o2,"."),o2.forEach(o),rx=d(fp),Su=s(fp,"P",{});var dF=i(Su);ax=a(dF,"Will only save from the main process."),dF.forEach(o),fp.forEach(o),nx=d(x),Jt=s(x,"DIV",{class:!0});var gp=i(Jt);g($s.$$.fragment,gp),sx=d(gp),qu=s(gp,"P",{});var cF=i(qu);ix=a(cF,"Saves the Trainer state, since Trainer.save_model saves only the tokenizer with the model"),cF.forEach(o),lx=d(gp),Uu=s(gp,"P",{});var pF=i(Uu);dx=a(pF,"Under distributed environment this is done only for a process with rank 0."),pF.forEach(o),gp.forEach(o),cx=d(x),Nr=s(x,"DIV",{class:!0});var r2=i(Nr);g(ks.$$.fragment,r2),px=d(r2),Du=s(r2,"P",{});var mF=i(Du);mx=a(mF,"Main training entry point."),mF.forEach(o),r2.forEach(o),hx=d(x),Ct=s(x,"DIV",{class:!0});var _p=i(Ct);g(xs.$$.fragment,_p),ux=d(_p),ju=s(_p,"P",{});var hF=i(ju);fx=a(hF,"Perform a training step on a batch of inputs."),hF.forEach(o),gx=d(_p),Pu=s(_p,"P",{});var uF=i(Pu);_x=a(uF,"Subclass and override to inject custom behavior."),uF.forEach(o),_p.forEach(o),x.forEach(o),Fv=d(t),qo=s(t,"H2",{class:!0});var a2=i(qo);zr=s(a2,"A",{id:!0,class:!0,href:!0});var fF=i(zr);Ju=s(fF,"SPAN",{});var gF=i(Ju);g(Ms.$$.fragment,gF),gF.forEach(o),fF.forEach(o),bx=d(a2),Cu=s(a2,"SPAN",{});var _F=i(Cu);vx=a(_F,"Seq2SeqTrainer"),_F.forEach(o),a2.forEach(o),Nv=d(t),pt=s(t,"DIV",{class:!0});var bp=i(pt);g(Is.$$.fragment,bp),yx=d(bp),ze=s(bp,"DIV",{class:!0});var Ka=i(ze);g(Ss.$$.fragment,Ka),wx=d(Ka),Fu=s(Ka,"P",{});var bF=i(Fu);Tx=a(bF,"Run evaluation and returns metrics."),bF.forEach(o),Ex=d(Ka),qs=s(Ka,"P",{});var n2=i(qs);Ax=a(n2,`The calling script will be responsible for providing a method to compute metrics, as they are task-dependent
(pass it to the init `),Nu=s(n2,"CODE",{});var vF=i(Nu);$x=a(vF,"compute_metrics"),vF.forEach(o),kx=a(n2," argument)."),n2.forEach(o),xx=d(Ka),zu=s(Ka,"P",{});var yF=i(zu);Mx=a(yF,"You can also subclass and override this method to inject custom behavior."),yF.forEach(o),Ka.forEach(o),Ix=d(bp),ce=s(bp,"DIV",{class:!0});var ot=i(ce);g(Us.$$.fragment,ot),Sx=d(ot),Ou=s(ot,"P",{});var wF=i(Ou);qx=a(wF,"Run prediction and returns predictions and potential metrics."),wF.forEach(o),Ux=d(ot),Ds=s(ot,"P",{});var s2=i(Ds);Dx=a(s2,`Depending on the dataset and your use case, your test dataset may contain labels. In that case, this method
will also return metrics, like in `),Wu=s(s2,"CODE",{});var TF=i(Wu);jx=a(TF,"evaluate()"),TF.forEach(o),Px=a(s2,"."),s2.forEach(o),Jx=d(ot),g(Or.$$.fragment,ot),Cx=d(ot),js=s(ot,"P",{});var i2=i(js);Fx=a(i2,"Returns: "),Ru=s(i2,"EM",{});var EF=i(Ru);Nx=a(EF,"NamedTuple"),EF.forEach(o),zx=a(i2," A namedtuple with the following keys:"),i2.forEach(o),Ox=d(ot),Uo=s(ot,"UL",{});var vp=i(Uo);Do=s(vp,"LI",{});var yp=i(Do);Wx=a(yp,"predictions ("),Lu=s(yp,"CODE",{});var AF=i(Lu);Rx=a(AF,"np.ndarray"),AF.forEach(o),Lx=a(yp,"): The predictions on "),Bu=s(yp,"CODE",{});var $F=i(Bu);Bx=a($F,"test_dataset"),$F.forEach(o),Gx=a(yp,"."),yp.forEach(o),Zx=d(vp),jo=s(vp,"LI",{});var wp=i(jo);Vx=a(wp,"label_ids ("),Gu=s(wp,"CODE",{});var kF=i(Gu);Xx=a(kF,"np.ndarray"),kF.forEach(o),Yx=a(wp,", "),Zu=s(wp,"EM",{});var xF=i(Zu);Hx=a(xF,"optional"),xF.forEach(o),Qx=a(wp,"): The labels (if the dataset contained some)."),wp.forEach(o),Kx=d(vp),Po=s(vp,"LI",{});var Tp=i(Po);eM=a(Tp,"metrics ("),Vu=s(Tp,"CODE",{});var MF=i(Vu);tM=a(MF,"Dict[str, float]"),MF.forEach(o),oM=a(Tp,", "),Xu=s(Tp,"EM",{});var IF=i(Xu);rM=a(IF,"optional"),IF.forEach(o),aM=a(Tp,`): The potential dictionary of metrics (if the dataset contained
labels).`),Tp.forEach(o),vp.forEach(o),ot.forEach(o),bp.forEach(o),zv=d(t),Jo=s(t,"H2",{class:!0});var l2=i(Jo);Wr=s(l2,"A",{id:!0,class:!0,href:!0});var SF=i(Wr);Yu=s(SF,"SPAN",{});var qF=i(Yu);g(Ps.$$.fragment,qF),qF.forEach(o),SF.forEach(o),nM=d(l2),Hu=s(l2,"SPAN",{});var UF=i(Hu);sM=a(UF,"TrainingArguments"),UF.forEach(o),l2.forEach(o),Ov=d(t),q=s(t,"DIV",{class:!0});var J=i(q);g(Js.$$.fragment,J),iM=d(J),Cs=s(J,"P",{});var d2=i(Cs);lM=a(d2,"TrainingArguments is the subset of the arguments we use in our example scripts "),Qu=s(d2,"STRONG",{});var DF=i(Qu);dM=a(DF,`which relate to the training loop
itself`),DF.forEach(o),cM=a(d2,"."),d2.forEach(o),pM=d(J),Co=s(J,"P",{});var Ep=i(Co);mM=a(Ep,"Using "),ud=s(Ep,"A",{href:!0});var jF=i(ud);hM=a(jF,"HfArgumentParser"),jF.forEach(o),uM=a(Ep,` we can turn this class into
`),Fs=s(Ep,"A",{href:!0,rel:!0});var PF=i(Fs);fM=a(PF,"argparse"),PF.forEach(o),gM=a(Ep,` arguments that can be specified on the
command line.`),Ep.forEach(o),_M=d(J),ve=s(J,"DIV",{class:!0});var ho=i(ve);g(Ns.$$.fragment,ho),bM=d(ho),Ku=s(ho,"P",{});var JF=i(Ku);vM=a(JF,`Returns the log level to be used depending on whether this process is the main process of node 0, main process
of node non-0, or a non-main process.`),JF.forEach(o),yM=d(ho),Fo=s(ho,"P",{});var Ap=i(Fo);wM=a(Ap,"For the main process the log level defaults to the logging level set ("),ef=s(Ap,"CODE",{});var CF=i(ef);TM=a(CF,"logging.WARNING"),CF.forEach(o),EM=a(Ap,` if you didn\u2019t do
anything) unless overridden by `),tf=s(Ap,"CODE",{});var FF=i(tf);AM=a(FF,"log_level"),FF.forEach(o),$M=a(Ap," argument."),Ap.forEach(o),kM=d(ho),No=s(ho,"P",{});var $p=i(No);xM=a($p,"For the replica processes the log level defaults to "),of=s($p,"CODE",{});var NF=i(of);MM=a(NF,"logging.WARNING"),NF.forEach(o),IM=a($p," unless overridden by "),rf=s($p,"CODE",{});var zF=i(rf);SM=a(zF,"log_level_replica"),zF.forEach(o),qM=a($p,`
argument.`),$p.forEach(o),UM=d(ho),zs=s(ho,"P",{});var c2=i(zs);DM=a(c2,"The choice between the main and replica process settings is made according to the return value of "),af=s(c2,"CODE",{});var OF=i(af);jM=a(OF,"should_log"),OF.forEach(o),PM=a(c2,"."),c2.forEach(o),ho.forEach(o),JM=d(J),Rr=s(J,"DIV",{class:!0});var p2=i(Rr);g(Os.$$.fragment,p2),CM=d(p2),nf=s(p2,"P",{});var WF=i(nf);FM=a(WF,"Get number of steps used for a linear warmup."),WF.forEach(o),p2.forEach(o),NM=d(J),Ft=s(J,"DIV",{class:!0});var kp=i(Ft);g(Ws.$$.fragment,kp),zM=d(kp),sf=s(kp,"P",{});var RF=i(sf);OM=a(RF,`A context manager for torch distributed environment where on needs to do something on the main process, while
blocking replicas, and when it\u2019s finished releasing the replicas.`),RF.forEach(o),WM=d(kp),zo=s(kp,"P",{});var xp=i(zo);RM=a(xp,"One such use is for "),lf=s(xp,"CODE",{});var LF=i(lf);LM=a(LF,"datasets"),LF.forEach(o),BM=a(xp,"\u2019s "),df=s(xp,"CODE",{});var BF=i(df);GM=a(BF,"map"),BF.forEach(o),ZM=a(xp,` feature which to be efficient should be run once on the main process,
which upon completion saves a cached version of results and which then automatically gets loaded by the
replicas.`),xp.forEach(o),kp.forEach(o),VM=d(J),Nt=s(J,"DIV",{class:!0});var Mp=i(Nt);g(Rs.$$.fragment,Mp),XM=d(Mp),cf=s(Mp,"P",{});var GF=i(cf);YM=a(GF,"A method that regroups all arguments linked to the dataloaders creation."),GF.forEach(o),HM=d(Mp),g(Lr.$$.fragment,Mp),Mp.forEach(o),QM=d(J),zt=s(J,"DIV",{class:!0});var Ip=i(zt);g(Ls.$$.fragment,Ip),KM=d(Ip),pf=s(Ip,"P",{});var ZF=i(pf);e5=a(ZF,"A method that regroups all arguments linked to the evaluation."),ZF.forEach(o),t5=d(Ip),g(Br.$$.fragment,Ip),Ip.forEach(o),o5=d(J),Ot=s(J,"DIV",{class:!0});var Sp=i(Ot);g(Bs.$$.fragment,Sp),r5=d(Sp),mf=s(Sp,"P",{});var VF=i(mf);a5=a(VF,"A method that regroups all arguments linked to the evaluation."),VF.forEach(o),n5=d(Sp),g(Gr.$$.fragment,Sp),Sp.forEach(o),s5=d(J),Wt=s(J,"DIV",{class:!0});var qp=i(Wt);g(Gs.$$.fragment,qp),i5=d(qp),hf=s(qp,"P",{});var XF=i(hf);l5=a(XF,"A method that regroups all arguments linked to the learning rate scheduler and its hyperparameters."),XF.forEach(o),d5=d(qp),g(Zr.$$.fragment,qp),qp.forEach(o),c5=d(J),Rt=s(J,"DIV",{class:!0});var Up=i(Rt);g(Zs.$$.fragment,Up),p5=d(Up),uf=s(Up,"P",{});var YF=i(uf);m5=a(YF,"A method that regroups all arguments linked to the optimizer and its hyperparameters."),YF.forEach(o),h5=d(Up),g(Vr.$$.fragment,Up),Up.forEach(o),u5=d(J),Oe=s(J,"DIV",{class:!0});var en=i(Oe);g(Vs.$$.fragment,en),f5=d(en),ff=s(en,"P",{});var HF=i(ff);g5=a(HF,"A method that regroups all arguments linked to synchronizing checkpoints with the Hub."),HF.forEach(o),_5=d(en),g(Xr.$$.fragment,en),b5=d(en),g(Yr.$$.fragment,en),en.forEach(o),v5=d(J),Lt=s(J,"DIV",{class:!0});var Dp=i(Lt);g(Xs.$$.fragment,Dp),y5=d(Dp),gf=s(Dp,"P",{});var QF=i(gf);w5=a(QF,"A method that regroups all arguments linked to the evaluation."),QF.forEach(o),T5=d(Dp),g(Hr.$$.fragment,Dp),Dp.forEach(o),E5=d(J),We=s(J,"DIV",{class:!0});var tn=i(We);g(Ys.$$.fragment,tn),A5=d(tn),_f=s(tn,"P",{});var KF=i(_f);$5=a(KF,"A method that regroups all basic arguments linked to testing on a held-out dataset."),KF.forEach(o),k5=d(tn),g(Qr.$$.fragment,tn),x5=d(tn),g(Kr.$$.fragment,tn),tn.forEach(o),M5=d(J),Re=s(J,"DIV",{class:!0});var on=i(Re);g(Hs.$$.fragment,on),I5=d(on),bf=s(on,"P",{});var eN=i(bf);S5=a(eN,"A method that regroups all basic arguments linked to the training."),eN.forEach(o),q5=d(on),g(ea.$$.fragment,on),U5=d(on),g(ta.$$.fragment,on),on.forEach(o),D5=d(J),oa=s(J,"DIV",{class:!0});var m2=i(oa);g(Qs.$$.fragment,m2),j5=d(m2),Ks=s(m2,"P",{});var h2=i(Ks);P5=a(h2,"Serializes this instance while replace "),vf=s(h2,"CODE",{});var tN=i(vf);J5=a(tN,"Enum"),tN.forEach(o),C5=a(h2,` by their values (for JSON serialization support). It obfuscates
the token values by removing their value.`),h2.forEach(o),m2.forEach(o),F5=d(J),ra=s(J,"DIV",{class:!0});var u2=i(ra);g(ei.$$.fragment,u2),N5=d(u2),yf=s(u2,"P",{});var oN=i(yf);z5=a(oN,"Serializes this instance to a JSON string."),oN.forEach(o),u2.forEach(o),O5=d(J),aa=s(J,"DIV",{class:!0});var f2=i(aa);g(ti.$$.fragment,f2),W5=d(f2),wf=s(f2,"P",{});var rN=i(wf);R5=a(rN,"Sanitized serialization to use with TensorBoard\u2019s hparams"),rN.forEach(o),f2.forEach(o),J.forEach(o),Wv=d(t),Oo=s(t,"H2",{class:!0});var g2=i(Oo);na=s(g2,"A",{id:!0,class:!0,href:!0});var aN=i(na);Tf=s(aN,"SPAN",{});var nN=i(Tf);g(oi.$$.fragment,nN),nN.forEach(o),aN.forEach(o),L5=d(g2),Ef=s(g2,"SPAN",{});var sN=i(Ef);B5=a(sN,"Seq2SeqTrainingArguments"),sN.forEach(o),g2.forEach(o),Rv=d(t),qe=s(t,"DIV",{class:!0});var rn=i(qe);g(ri.$$.fragment,rn),G5=d(rn),ai=s(rn,"P",{});var _2=i(ai);Z5=a(_2,"TrainingArguments is the subset of the arguments we use in our example scripts "),Af=s(_2,"STRONG",{});var iN=i(Af);V5=a(iN,`which relate to the training loop
itself`),iN.forEach(o),X5=a(_2,"."),_2.forEach(o),Y5=d(rn),Wo=s(rn,"P",{});var jp=i(Wo);H5=a(jp,"Using "),fd=s(jp,"A",{href:!0});var lN=i(fd);Q5=a(lN,"HfArgumentParser"),lN.forEach(o),K5=a(jp,` we can turn this class into
`),ni=s(jp,"A",{href:!0,rel:!0});var dN=i(ni);e9=a(dN,"argparse"),dN.forEach(o),t9=a(jp,` arguments that can be specified on the
command line.`),jp.forEach(o),o9=d(rn),sa=s(rn,"DIV",{class:!0});var b2=i(sa);g(si.$$.fragment,b2),r9=d(b2),Ro=s(b2,"P",{});var Pp=i(Ro);a9=a(Pp,"Serializes this instance while replace "),$f=s(Pp,"CODE",{});var cN=i($f);n9=a(cN,"Enum"),cN.forEach(o),s9=a(Pp," by their values and "),kf=s(Pp,"CODE",{});var pN=i(kf);i9=a(pN,"GenerationConfig"),pN.forEach(o),l9=a(Pp,` by dictionaries (for JSON
serialization support). It obfuscates the token values by removing their value.`),Pp.forEach(o),b2.forEach(o),rn.forEach(o),Lv=d(t),Lo=s(t,"H2",{class:!0});var v2=i(Lo);ia=s(v2,"A",{id:!0,class:!0,href:!0});var mN=i(ia);xf=s(mN,"SPAN",{});var hN=i(xf);g(ii.$$.fragment,hN),hN.forEach(o),mN.forEach(o),d9=d(v2),Mf=s(v2,"SPAN",{});var uN=i(Mf);c9=a(uN,"Checkpoints"),uN.forEach(o),v2.forEach(o),Bv=d(t),ye=s(t,"P",{});var uo=i(ye);p9=a(uo,"By default, "),gd=s(uo,"A",{href:!0});var fN=i(gd);m9=a(fN,"Trainer"),fN.forEach(o),h9=a(uo," will save all checkpoints in the "),If=s(uo,"CODE",{});var gN=i(If);u9=a(gN,"output_dir"),gN.forEach(o),f9=a(uo,` you set in the
`),_d=s(uo,"A",{href:!0});var _N=i(_d);g9=a(_N,"TrainingArguments"),_N.forEach(o),_9=a(uo," you are using. Those will go in subfolder named "),Sf=s(uo,"CODE",{});var bN=i(Sf);b9=a(bN,"checkpoint-xxx"),bN.forEach(o),v9=a(uo,` with xxx
being the step at which the training was at.`),uo.forEach(o),Gv=d(t),la=s(t,"P",{});var y2=i(la);y9=a(y2,"Resuming training from a checkpoint can be done when calling "),bd=s(y2,"A",{href:!0});var vN=i(bd);w9=a(vN,"Trainer.train()"),vN.forEach(o),T9=a(y2," with either:"),y2.forEach(o),Zv=d(t),da=s(t,"UL",{});var w2=i(da);vd=s(w2,"LI",{});var h8=i(vd);qf=s(h8,"CODE",{});var yN=i(qf);E9=a(yN,"resume_from_checkpoint=True"),yN.forEach(o),A9=a(h8," which will resume training from the latest checkpoint"),h8.forEach(o),$9=d(w2),yd=s(w2,"LI",{});var u8=i(yd);Uf=s(u8,"CODE",{});var wN=i(Uf);k9=a(wN,"resume_from_checkpoint=checkpoint_dir"),wN.forEach(o),x9=a(u8,` which will resume training from the specific checkpoint in the directory
passed.`),u8.forEach(o),w2.forEach(o),Vv=d(t),Le=s(t,"P",{});var an=i(Le);M9=a(an,"In addition, you can easily save your checkpoints on the Model Hub when using "),Df=s(an,"CODE",{});var TN=i(Df);I9=a(TN,"push_to_hub=True"),TN.forEach(o),S9=a(an,`. By default, all
the models saved in intermediate checkpoints are saved in different commits, but not the optimizer state. You can adapt
the `),jf=s(an,"CODE",{});var EN=i(jf);q9=a(EN,"hub-strategy"),EN.forEach(o),U9=a(an," value of your "),wd=s(an,"A",{href:!0});var AN=i(wd);D9=a(AN,"TrainingArguments"),AN.forEach(o),j9=a(an," to either:"),an.forEach(o),Xv=d(t),ca=s(t,"UL",{});var T2=i(ca);pa=s(T2,"LI",{});var kv=i(pa);Pf=s(kv,"CODE",{});var $N=i(Pf);P9=a($N,'"checkpoint"'),$N.forEach(o),J9=a(kv,`: the latest checkpoint is also pushed in a subfolder named last-checkpoint, allowing you to
resume training easily with `),Jf=s(kv,"CODE",{});var kN=i(Jf);C9=a(kN,'trainer.train(resume_from_checkpoint="output_dir/last-checkpoint")'),kN.forEach(o),F9=a(kv,"."),kv.forEach(o),N9=d(T2),Td=s(T2,"LI",{});var f8=i(Td);Cf=s(f8,"CODE",{});var xN=i(Cf);z9=a(xN,'"all_checkpoints"'),xN.forEach(o),O9=a(f8,`: all checkpoints are pushed like they appear in the output folder (so you will get one
checkpoint folder per folder in your final repository)`),f8.forEach(o),T2.forEach(o),Yv=d(t),Bo=s(t,"H2",{class:!0});var E2=i(Bo);ma=s(E2,"A",{id:!0,class:!0,href:!0});var MN=i(ma);Ff=s(MN,"SPAN",{});var IN=i(Ff);g(li.$$.fragment,IN),IN.forEach(o),MN.forEach(o),W9=d(E2),Nf=s(E2,"SPAN",{});var SN=i(Nf);R9=a(SN,"Logging"),SN.forEach(o),E2.forEach(o),Hv=d(t),Be=s(t,"P",{});var nn=i(Be);L9=a(nn,"By default "),Ed=s(nn,"A",{href:!0});var qN=i(Ed);B9=a(qN,"Trainer"),qN.forEach(o),G9=a(nn," will use "),zf=s(nn,"CODE",{});var UN=i(zf);Z9=a(UN,"logging.INFO"),UN.forEach(o),V9=a(nn," for the main process and "),Of=s(nn,"CODE",{});var DN=i(Of);X9=a(DN,"logging.WARNING"),DN.forEach(o),Y9=a(nn," for the replicas if any."),nn.forEach(o),Qv=d(t),Bt=s(t,"P",{});var Jp=i(Bt);H9=a(Jp,"These defaults can be overridden to use any of the 5 "),Wf=s(Jp,"CODE",{});var jN=i(Wf);Q9=a(jN,"logging"),jN.forEach(o),K9=a(Jp," levels with "),Ad=s(Jp,"A",{href:!0});var PN=i(Ad);eI=a(PN,"TrainingArguments"),PN.forEach(o),tI=a(Jp,`\u2019s
arguments:`),Jp.forEach(o),Kv=d(t),ha=s(t,"UL",{});var A2=i(ha);$d=s(A2,"LI",{});var g8=i($d);Rf=s(g8,"CODE",{});var JN=i(Rf);oI=a(JN,"log_level"),JN.forEach(o),rI=a(g8," - for the main process"),g8.forEach(o),aI=d(A2),kd=s(A2,"LI",{});var _8=i(kd);Lf=s(_8,"CODE",{});var CN=i(Lf);nI=a(CN,"log_level_replica"),CN.forEach(o),sI=a(_8," - for the replicas"),_8.forEach(o),A2.forEach(o),ey=d(t),Ge=s(t,"P",{});var sn=i(Ge);iI=a(sn,"Further, if "),xd=s(sn,"A",{href:!0});var FN=i(xd);lI=a(FN,"TrainingArguments"),FN.forEach(o),dI=a(sn,"\u2019s "),Bf=s(sn,"CODE",{});var NN=i(Bf);cI=a(NN,"log_on_each_node"),NN.forEach(o),pI=a(sn," is set to "),Gf=s(sn,"CODE",{});var zN=i(Gf);mI=a(zN,"False"),zN.forEach(o),hI=a(sn,` only the main node will
use the log level settings for its main process, all other nodes will use the log level settings for replicas.`),sn.forEach(o),ty=d(t),pe=s(t,"P",{});var rt=i(pe);uI=a(rt,"Note that "),Md=s(rt,"A",{href:!0});var ON=i(Md);fI=a(ON,"Trainer"),ON.forEach(o),gI=a(rt," is going to set "),Zf=s(rt,"CODE",{});var WN=i(Zf);_I=a(WN,"transformers"),WN.forEach(o),bI=a(rt,`\u2019s log level separately for each node in its
`),Vf=s(rt,"CODE",{});var RN=i(Vf);vI=a(RN,"Trainer.__init__()"),RN.forEach(o),yI=a(rt,`. So you may want to set this sooner (see the next example) if you tap into other
`),Xf=s(rt,"CODE",{});var LN=i(Xf);wI=a(LN,"transformers"),LN.forEach(o),TI=a(rt," functionality before creating the "),Id=s(rt,"A",{href:!0});var BN=i(Id);EI=a(BN,"Trainer"),BN.forEach(o),AI=a(rt," object."),rt.forEach(o),oy=d(t),Sd=s(t,"P",{});var GN=i(Sd);$I=a(GN,"Here is an example of how this can be used in an application:"),GN.forEach(o),ry=d(t),g(di.$$.fragment,t),ay=d(t),qd=s(t,"P",{});var ZN=i(qd);kI=a(ZN,`And then if you only want to see warnings on the main node and all other nodes to not print any most likely duplicated
warnings you could run it as:`),ZN.forEach(o),ny=d(t),g(ci.$$.fragment,t),sy=d(t),Ud=s(t,"P",{});var VN=i(Ud);xI=a(VN,`In the multi-node environment if you also don\u2019t want the logs to repeat for each node\u2019s main process, you will want to
change the above to:`),VN.forEach(o),iy=d(t),g(pi.$$.fragment,t),ly=d(t),Dd=s(t,"P",{});var XN=i(Dd);MI=a(XN,`and then only the main process of the first node will log at the \u201Cwarning\u201D level, and all other processes on the main
node and all processes on other nodes will log at the \u201Cerror\u201D level.`),XN.forEach(o),dy=d(t),jd=s(t,"P",{});var YN=i(jd);II=a(YN,"If you need your application to be as quiet as possible you could do:"),YN.forEach(o),cy=d(t),g(mi.$$.fragment,t),py=d(t),ua=s(t,"P",{});var $2=i(ua);SI=a($2,"(add "),Yf=s($2,"CODE",{});var HN=i(Yf);qI=a(HN,"--log_on_each_node 0"),HN.forEach(o),UI=a($2," if on multi-node environment)"),$2.forEach(o),my=d(t),Go=s(t,"H2",{class:!0});var k2=i(Go);fa=s(k2,"A",{id:!0,class:!0,href:!0});var QN=i(fa);Hf=s(QN,"SPAN",{});var KN=i(Hf);g(hi.$$.fragment,KN),KN.forEach(o),QN.forEach(o),DI=d(k2),Qf=s(k2,"SPAN",{});var ez=i(Qf);jI=a(ez,"Randomness"),ez.forEach(o),k2.forEach(o),hy=d(t),we=s(t,"P",{});var fo=i(we);PI=a(fo,"When resuming from a checkpoint generated by "),Pd=s(fo,"A",{href:!0});var tz=i(Pd);JI=a(tz,"Trainer"),tz.forEach(o),CI=a(fo,` all efforts are made to restore the
`),Kf=s(fo,"EM",{});var oz=i(Kf);FI=a(oz,"python"),oz.forEach(o),NI=a(fo,", "),eg=s(fo,"EM",{});var rz=i(eg);zI=a(rz,"numpy"),rz.forEach(o),OI=a(fo," and "),tg=s(fo,"EM",{});var az=i(tg);WI=a(az,"pytorch"),az.forEach(o),RI=a(fo,` RNG states to the same states as they were at the moment of saving that checkpoint,
which should make the \u201Cstop and resume\u201D style of training as close as possible to non-stop training.`),fo.forEach(o),uy=d(t),Gt=s(t,"P",{});var Cp=i(Gt);LI=a(Cp,`However, due to various default non-deterministic pytorch settings this might not fully work. If you want full
determinism please refer to `),ui=s(Cp,"A",{href:!0,rel:!0});var nz=i(ui);BI=a(nz,"Controlling sources of randomness"),nz.forEach(o),GI=a(Cp,`. As explained in the document, that some of those settings
that make things deterministic (.e.g., `),og=s(Cp,"CODE",{});var sz=i(og);ZI=a(sz,"torch.backends.cudnn.deterministic"),sz.forEach(o),VI=a(Cp,`) may slow things down, therefore this
can\u2019t be done by default, but you can enable those yourself if needed.`),Cp.forEach(o),fy=d(t),Zo=s(t,"H2",{class:!0});var x2=i(Zo);ga=s(x2,"A",{id:!0,class:!0,href:!0});var iz=i(ga);rg=s(iz,"SPAN",{});var lz=i(rg);g(fi.$$.fragment,lz),lz.forEach(o),iz.forEach(o),XI=d(x2),ag=s(x2,"SPAN",{});var dz=i(ag);YI=a(dz,"Specific GPUs Selection"),dz.forEach(o),x2.forEach(o),gy=d(t),Jd=s(t,"P",{});var cz=i(Jd);HI=a(cz,"Let\u2019s discuss how you can tell your program which GPUs are to be used and in what order."),cz.forEach(o),_y=d(t),_a=s(t,"P",{});var M2=i(_a);QI=a(M2,"When using "),gi=s(M2,"A",{href:!0,rel:!0});var pz=i(gi);ng=s(pz,"CODE",{});var mz=i(ng);KI=a(mz,"DistributedDataParallel"),mz.forEach(o),pz.forEach(o),eS=a(M2," to use only a subset of your GPUs, you simply specify the number of GPUs to use. For example, if you have 4 GPUs, but you wish to use the first 2 you can do:"),M2.forEach(o),by=d(t),g(_i.$$.fragment,t),vy=d(t),Zt=s(t,"P",{});var Fp=i(Zt);tS=a(Fp,"if you have either "),bi=s(Fp,"A",{href:!0,rel:!0});var hz=i(bi);sg=s(hz,"CODE",{});var uz=i(sg);oS=a(uz,"accelerate"),uz.forEach(o),hz.forEach(o),rS=a(Fp," or "),vi=s(Fp,"A",{href:!0,rel:!0});var fz=i(vi);ig=s(fz,"CODE",{});var gz=i(ig);aS=a(gz,"deepspeed"),gz.forEach(o),fz.forEach(o),nS=a(Fp," installed you can also accomplish the same by using one of:"),Fp.forEach(o),yy=d(t),g(yi.$$.fragment,t),wy=d(t),g(wi.$$.fragment,t),Ty=d(t),ba=s(t,"P",{});var I2=i(ba);sS=a(I2,"You don\u2019t need to use the Accelerate or "),Cd=s(I2,"A",{href:!0});var _z=i(Cd);iS=a(_z,"the Deepspeed integration"),_z.forEach(o),lS=a(I2," features to use these launchers."),I2.forEach(o),Ey=d(t),Fd=s(t,"P",{});var bz=i(Fd);dS=a(bz,"Until now you were able to tell the program how many GPUs to use. Now let\u2019s discuss how to select specific GPUs and control their order."),bz.forEach(o),Ay=d(t),Nd=s(t,"P",{});var vz=i(Nd);cS=a(vz,"The following environment variables help you control which GPUs to use and their order."),vz.forEach(o),$y=d(t),zd=s(t,"P",{});var yz=i(zd);lg=s(yz,"STRONG",{});var wz=i(lg);dg=s(wz,"CODE",{});var Tz=i(dg);pS=a(Tz,"CUDA_VISIBLE_DEVICES"),Tz.forEach(o),wz.forEach(o),yz.forEach(o),ky=d(t),va=s(t,"P",{});var S2=i(va);mS=a(S2,"If you have multiple GPUs and you\u2019d like to use only 1 or a few of those GPUs, set the environment variable "),cg=s(S2,"CODE",{});var Ez=i(cg);hS=a(Ez,"CUDA_VISIBLE_DEVICES"),Ez.forEach(o),uS=a(S2," to a list of the GPUs to be used."),S2.forEach(o),xy=d(t),Od=s(t,"P",{});var Az=i(Od);fS=a(Az,"For example, let\u2019s say you have 4 GPUs: 0, 1, 2 and 3. To run only on the physical GPUs 0 and 2, you can do:"),Az.forEach(o),My=d(t),g(Ti.$$.fragment,t),Iy=d(t),Vt=s(t,"P",{});var Np=i(Vt);gS=a(Np,"So now pytorch will see only 2 GPUs, where your physical GPUs 0 and 2 are mapped to "),pg=s(Np,"CODE",{});var $z=i(pg);_S=a($z,"cuda:0"),$z.forEach(o),bS=a(Np," and "),mg=s(Np,"CODE",{});var kz=i(mg);vS=a(kz,"cuda:1"),kz.forEach(o),yS=a(Np," correspondingly."),Np.forEach(o),Sy=d(t),Wd=s(t,"P",{});var xz=i(Wd);wS=a(xz,"You can even change their order:"),xz.forEach(o),qy=d(t),g(Ei.$$.fragment,t),Uy=d(t),Xt=s(t,"P",{});var zp=i(Xt);TS=a(zp,"Here your physical GPUs 0 and 2 are mapped to "),hg=s(zp,"CODE",{});var Mz=i(hg);ES=a(Mz,"cuda:1"),Mz.forEach(o),AS=a(zp," and "),ug=s(zp,"CODE",{});var Iz=i(ug);$S=a(Iz,"cuda:0"),Iz.forEach(o),kS=a(zp," correspondingly."),zp.forEach(o),Dy=d(t),Yt=s(t,"P",{});var Op=i(Yt);xS=a(Op,"The above examples were all for "),fg=s(Op,"CODE",{});var Sz=i(fg);MS=a(Sz,"DistributedDataParallel"),Sz.forEach(o),IS=a(Op," use pattern, but the same method works for "),Ai=s(Op,"A",{href:!0,rel:!0});var qz=i(Ai);gg=s(qz,"CODE",{});var Uz=i(gg);SS=a(Uz,"DataParallel"),Uz.forEach(o),qz.forEach(o),qS=a(Op," as well:"),Op.forEach(o),jy=d(t),g($i.$$.fragment,t),Py=d(t),Rd=s(t,"P",{});var Dz=i(Rd);US=a(Dz,"To emulate an environment without GPUs simply set this environment variable to an empty value like so:"),Dz.forEach(o),Jy=d(t),g(ki.$$.fragment,t),Cy=d(t),Ld=s(t,"P",{});var jz=i(Ld);DS=a(jz,"As with any environment variable you can, of course, export those instead of adding these to the command line, as in:"),jz.forEach(o),Fy=d(t),g(xi.$$.fragment,t),Ny=d(t),Bd=s(t,"P",{});var Pz=i(Bd);jS=a(Pz,"but this approach can be confusing since you may forget you set up the environment variable earlier and not understand why the wrong GPUs are used. Therefore, it\u2019s a common practice to set the environment variable just for a specific run on the same command line as it\u2019s shown in most examples of this section."),Pz.forEach(o),zy=d(t),Gd=s(t,"P",{});var Jz=i(Gd);_g=s(Jz,"STRONG",{});var Cz=i(_g);bg=s(Cz,"CODE",{});var Fz=i(bg);PS=a(Fz,"CUDA_DEVICE_ORDER"),Fz.forEach(o),Cz.forEach(o),Jz.forEach(o),Oy=d(t),ya=s(t,"P",{});var q2=i(ya);JS=a(q2,"There is an additional environment variable "),vg=s(q2,"CODE",{});var Nz=i(vg);CS=a(Nz,"CUDA_DEVICE_ORDER"),Nz.forEach(o),FS=a(q2," that controls how the physical devices are ordered. The two choices are:"),q2.forEach(o),Wy=d(t),Zd=s(t,"OL",{});var zz=i(Zd);Mi=s(zz,"LI",{});var U2=i(Mi);NS=a(U2,"ordered by PCIe bus IDs (matches "),yg=s(U2,"CODE",{});var Oz=i(yg);zS=a(Oz,"nvidia-smi"),Oz.forEach(o),OS=a(U2,"\u2019s order) - this is the default."),U2.forEach(o),zz.forEach(o),Ry=d(t),g(Ii.$$.fragment,t),Ly=d(t),Si=s(t,"OL",{start:!0});var Wz=i(Si);wg=s(Wz,"LI",{});var Rz=i(wg);WS=a(Rz,"ordered by GPU compute capabilities"),Rz.forEach(o),Wz.forEach(o),By=d(t),g(qi.$$.fragment,t),Gy=d(t),Ht=s(t,"P",{});var Wp=i(Ht);RS=a(Wp,"Most of the time you don\u2019t need to care about this environment variable, but it\u2019s very helpful if you have a lopsided setup where you have an old and a new GPUs physically inserted in such a way so that the slow older card appears to be first. One way to fix that is to swap the cards. But if you can\u2019t swap the cards (e.g., if the cooling of the devices gets impacted) then setting "),Tg=s(Wp,"CODE",{});var Lz=i(Tg);LS=a(Lz,"CUDA_DEVICE_ORDER=FASTEST_FIRST"),Lz.forEach(o),BS=a(Wp," will always put the newer faster card first. It\u2019ll be somewhat confusing though since "),Eg=s(Wp,"CODE",{});var Bz=i(Eg);GS=a(Bz,"nvidia-smi"),Bz.forEach(o),ZS=a(Wp," will still report them in the PCIe order."),Wp.forEach(o),Zy=d(t),Vd=s(t,"P",{});var Gz=i(Vd);VS=a(Gz,"The other solution to swapping the order is to use:"),Gz.forEach(o),Vy=d(t),g(Ui.$$.fragment,t),Xy=d(t),Xd=s(t,"P",{});var Zz=i(Xd);XS=a(Zz,"In this example we are working with just 2 GPUs, but of course the same would apply to as many GPUs as your computer has."),Zz.forEach(o),Yy=d(t),wa=s(t,"P",{});var D2=i(wa);YS=a(D2,"Also if you do set this environment variable it\u2019s the best to set it in your "),Ag=s(D2,"CODE",{});var Vz=i(Ag);HS=a(Vz,"~/.bashrc"),Vz.forEach(o),QS=a(D2," file or some other startup config file and forget about it."),D2.forEach(o),Hy=d(t),Vo=s(t,"H2",{class:!0});var j2=i(Vo);Ta=s(j2,"A",{id:!0,class:!0,href:!0});var Xz=i(Ta);$g=s(Xz,"SPAN",{});var Yz=i($g);g(Di.$$.fragment,Yz),Yz.forEach(o),Xz.forEach(o),KS=d(j2),kg=s(j2,"SPAN",{});var Hz=i(kg);eq=a(Hz,"Trainer Integrations"),Hz.forEach(o),j2.forEach(o),Qy=d(t),Ea=s(t,"P",{});var P2=i(Ea);tq=a(P2,"The "),Yd=s(P2,"A",{href:!0});var Qz=i(Yd);oq=a(Qz,"Trainer"),Qz.forEach(o),rq=a(P2,` has been extended to support libraries that may dramatically improve your training
time and fit much bigger models.`),P2.forEach(o),Ky=d(t),Ze=s(t,"P",{});var ln=i(Ze);aq=a(ln,"Currently it supports third party solutions, "),ji=s(ln,"A",{href:!0,rel:!0});var Kz=i(ji);nq=a(Kz,"DeepSpeed"),Kz.forEach(o),sq=a(ln," and "),Pi=s(ln,"A",{href:!0,rel:!0});var eO=i(Pi);iq=a(eO,"PyTorch FSDP"),eO.forEach(o),lq=a(ln,", which implement parts of the paper "),Ji=s(ln,"A",{href:!0,rel:!0});var tO=i(Ji);dq=a(tO,`ZeRO: Memory Optimizations
Toward Training Trillion Parameter Models, by Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, Yuxiong He`),tO.forEach(o),cq=a(ln,"."),ln.forEach(o),e1=d(t),Aa=s(t,"P",{});var J2=i(Aa);pq=a(J2,"This provided support is new and experimental as of this writing. While the support for DeepSpeed and PyTorch FSDP is active and we welcome issues around it, we don\u2019t support the FairScale integration anymore since it has been integrated in PyTorch main (see the "),Hd=s(J2,"A",{href:!0});var oO=i(Hd);mq=a(oO,"PyTorch FSDP integration"),oO.forEach(o),hq=a(J2,")"),J2.forEach(o),t1=d(t),Qd=s(t,"A",{id:!0}),i(Qd).forEach(o),o1=d(t),Xo=s(t,"H3",{class:!0});var C2=i(Xo);$a=s(C2,"A",{id:!0,class:!0,href:!0});var rO=i($a);xg=s(rO,"SPAN",{});var aO=i(xg);g(Ci.$$.fragment,aO),aO.forEach(o),rO.forEach(o),uq=d(C2),Mg=s(C2,"SPAN",{});var nO=i(Mg);fq=a(nO,"CUDA Extension Installation Notes"),nO.forEach(o),C2.forEach(o),r1=d(t),Kd=s(t,"P",{});var sO=i(Kd);gq=a(sO,"As of this writing, Deepspeed require compilation of CUDA C++ code, before it can be used."),sO.forEach(o),a1=d(t),ka=s(t,"P",{});var F2=i(ka);_q=a(F2,"While all installation issues should be dealt with through the corresponding GitHub Issues of "),Fi=s(F2,"A",{href:!0,rel:!0});var iO=i(Fi);bq=a(iO,"Deepspeed"),iO.forEach(o),vq=a(F2,`, there are a few common issues that one may encounter while building
any PyTorch extension that needs to build CUDA extensions.`),F2.forEach(o),n1=d(t),ec=s(t,"P",{});var lO=i(ec);yq=a(lO,"Therefore, if you encounter a CUDA-related build issue while doing the following:"),lO.forEach(o),s1=d(t),g(Ni.$$.fragment,t),i1=d(t),tc=s(t,"P",{});var dO=i(tc);wq=a(dO,"please, read the following notes first."),dO.forEach(o),l1=d(t),Qt=s(t,"P",{});var Rp=i(Qt);Tq=a(Rp,"In these notes we give examples for what to do when "),Ig=s(Rp,"CODE",{});var cO=i(Ig);Eq=a(cO,"pytorch"),cO.forEach(o),Aq=a(Rp," has been built with CUDA "),Sg=s(Rp,"CODE",{});var pO=i(Sg);$q=a(pO,"10.2"),pO.forEach(o),kq=a(Rp,`. If your situation is
different remember to adjust the version number to the one you are after.`),Rp.forEach(o),d1=d(t),Yo=s(t,"H4",{class:!0});var N2=i(Yo);xa=s(N2,"A",{id:!0,class:!0,href:!0});var mO=i(xa);qg=s(mO,"SPAN",{});var hO=i(qg);g(zi.$$.fragment,hO),hO.forEach(o),mO.forEach(o),xq=d(N2),Ug=s(N2,"SPAN",{});var uO=i(Ug);Mq=a(uO,"Possible problem #1"),uO.forEach(o),N2.forEach(o),c1=d(t),oc=s(t,"P",{});var fO=i(oc);Iq=a(fO,`While, Pytorch comes with its own CUDA toolkit, to build these two projects you must have an identical version of CUDA
installed system-wide.`),fO.forEach(o),p1=d(t),Ve=s(t,"P",{});var dn=i(Ve);Sq=a(dn,"For example, if you installed "),Dg=s(dn,"CODE",{});var gO=i(Dg);qq=a(gO,"pytorch"),gO.forEach(o),Uq=a(dn," with "),jg=s(dn,"CODE",{});var _O=i(jg);Dq=a(_O,"cudatoolkit==10.2"),_O.forEach(o),jq=a(dn,` in the Python environment, you also need to have
CUDA `),Pg=s(dn,"CODE",{});var bO=i(Pg);Pq=a(bO,"10.2"),bO.forEach(o),Jq=a(dn," installed system-wide."),dn.forEach(o),m1=d(t),Kt=s(t,"P",{});var Lp=i(Kt);Cq=a(Lp,"The exact location may vary from system to system, but "),Jg=s(Lp,"CODE",{});var vO=i(Jg);Fq=a(vO,"/usr/local/cuda-10.2"),vO.forEach(o),Nq=a(Lp,` is the most common location on many
Unix systems. When CUDA is correctly set up and added to the `),Cg=s(Lp,"CODE",{});var yO=i(Cg);zq=a(yO,"PATH"),yO.forEach(o),Oq=a(Lp,` environment variable, one can find the
installation location by doing:`),Lp.forEach(o),h1=d(t),g(Oi.$$.fragment,t),u1=d(t),Ma=s(t,"P",{});var z2=i(Ma);Wq=a(z2,`If you don\u2019t have CUDA installed system-wide, install it first. You will find the instructions by using your favorite
search engine. For example, if you\u2019re on Ubuntu you may want to search for: `),Wi=s(z2,"A",{href:!0,rel:!0});var wO=i(Wi);Rq=a(wO,"ubuntu cuda 10.2 install"),wO.forEach(o),Lq=a(z2,"."),z2.forEach(o),f1=d(t),Ho=s(t,"H4",{class:!0});var O2=i(Ho);Ia=s(O2,"A",{id:!0,class:!0,href:!0});var TO=i(Ia);Fg=s(TO,"SPAN",{});var EO=i(Fg);g(Ri.$$.fragment,EO),EO.forEach(o),TO.forEach(o),Bq=d(O2),Ng=s(O2,"SPAN",{});var AO=i(Ng);Gq=a(AO,"Possible problem #2"),AO.forEach(o),O2.forEach(o),g1=d(t),rc=s(t,"P",{});var $O=i(rc);Zq=a($O,`Another possible common problem is that you may have more than one CUDA toolkit installed system-wide. For example you
may have:`),$O.forEach(o),_1=d(t),g(Li.$$.fragment,t),b1=d(t),eo=s(t,"P",{});var Bp=i(eo);Vq=a(Bp,"Now, in this situation you need to make sure that your "),zg=s(Bp,"CODE",{});var kO=i(zg);Xq=a(kO,"PATH"),kO.forEach(o),Yq=a(Bp," and "),Og=s(Bp,"CODE",{});var xO=i(Og);Hq=a(xO,"LD_LIBRARY_PATH"),xO.forEach(o),Qq=a(Bp,` environment variables contain
the correct paths to the desired CUDA version. Typically, package installers will set these to contain whatever the
last version was installed. If you encounter the problem, where the package build fails because it can\u2019t find the right
CUDA version despite you having it installed system-wide, it means that you need to adjust the 2 aforementioned
environment variables.`),Bp.forEach(o),v1=d(t),ac=s(t,"P",{});var MO=i(ac);Kq=a(MO,"First, you may look at their contents:"),MO.forEach(o),y1=d(t),g(Bi.$$.fragment,t),w1=d(t),nc=s(t,"P",{});var IO=i(nc);eU=a(IO,"so you get an idea of what is inside."),IO.forEach(o),T1=d(t),Sa=s(t,"P",{});var W2=i(Sa);tU=a(W2,"It\u2019s possible that "),Wg=s(W2,"CODE",{});var SO=i(Wg);oU=a(SO,"LD_LIBRARY_PATH"),SO.forEach(o),rU=a(W2," is empty."),W2.forEach(o),E1=d(t),mt=s(t,"P",{});var Nl=i(mt);Rg=s(Nl,"CODE",{});var qO=i(Rg);aU=a(qO,"PATH"),qO.forEach(o),nU=a(Nl," lists the locations of where executables can be found and "),Lg=s(Nl,"CODE",{});var UO=i(Lg);sU=a(UO,"LD_LIBRARY_PATH"),UO.forEach(o),iU=a(Nl,` is for where shared libraries
are to looked for. In both cases, earlier entries have priority over the later ones. `),Bg=s(Nl,"CODE",{});var DO=i(Bg);lU=a(DO,":"),DO.forEach(o),dU=a(Nl,` is used to separate multiple
entries.`),Nl.forEach(o),A1=d(t),sc=s(t,"P",{});var jO=i(sc);cU=a(jO,`Now, to tell the build program where to find the specific CUDA toolkit, insert the desired paths to be listed first by
doing:`),jO.forEach(o),$1=d(t),g(Gi.$$.fragment,t),k1=d(t),ic=s(t,"P",{});var PO=i(ic);pU=a(PO,"Note that we aren\u2019t overwriting the existing values, but prepending instead."),PO.forEach(o),x1=d(t),Xe=s(t,"P",{});var cn=i(Xe);mU=a(cn,`Of course, adjust the version number, the full path if need be. Check that the directories you assign actually do
exist. `),Gg=s(cn,"CODE",{});var JO=i(Gg);hU=a(JO,"lib64"),JO.forEach(o),uU=a(cn," sub-directory is where the various CUDA "),Zg=s(cn,"CODE",{});var CO=i(Zg);fU=a(CO,".so"),CO.forEach(o),gU=a(cn," objects, like "),Vg=s(cn,"CODE",{});var FO=i(Vg);_U=a(FO,"libcudart.so"),FO.forEach(o),bU=a(cn,` reside, it\u2019s unlikely
that your system will have it named differently, but if it is adjust it to reflect your reality.`),cn.forEach(o),M1=d(t),Qo=s(t,"H4",{class:!0});var R2=i(Qo);qa=s(R2,"A",{id:!0,class:!0,href:!0});var NO=i(qa);Xg=s(NO,"SPAN",{});var zO=i(Xg);g(Zi.$$.fragment,zO),zO.forEach(o),NO.forEach(o),vU=d(R2),Yg=s(R2,"SPAN",{});var OO=i(Yg);yU=a(OO,"Possible problem #3"),OO.forEach(o),R2.forEach(o),I1=d(t),to=s(t,"P",{});var Gp=i(to);wU=a(Gp,"Some older CUDA versions may refuse to build with newer compilers. For example, you my have "),Hg=s(Gp,"CODE",{});var WO=i(Hg);TU=a(WO,"gcc-9"),WO.forEach(o),EU=a(Gp,` but it wants
`),Qg=s(Gp,"CODE",{});var RO=i(Qg);AU=a(RO,"gcc-7"),RO.forEach(o),$U=a(Gp,"."),Gp.forEach(o),S1=d(t),lc=s(t,"P",{});var LO=i(lc);kU=a(LO,"There are various ways to go about it."),LO.forEach(o),q1=d(t),dc=s(t,"P",{});var BO=i(dc);xU=a(BO,"If you can install the latest CUDA toolkit it typically should support the newer compiler."),BO.forEach(o),U1=d(t),Ua=s(t,"P",{});var L2=i(Ua);MU=a(L2,`Alternatively, you could install the lower version of the compiler in addition to the one you already have, or you may
already have it but it\u2019s not the default one, so the build system can\u2019t see it. If you have `),Kg=s(L2,"CODE",{});var GO=i(Kg);IU=a(GO,"gcc-7"),GO.forEach(o),SU=a(L2,` installed but the
build system complains it can\u2019t find it, the following might do the trick:`),L2.forEach(o),D1=d(t),g(Vi.$$.fragment,t),j1=d(t),te=s(t,"P",{});var Te=i(te);qU=a(Te,"Here, we are making a symlink to "),e_=s(Te,"CODE",{});var ZO=i(e_);UU=a(ZO,"gcc-7"),ZO.forEach(o),DU=a(Te," from "),t_=s(Te,"CODE",{});var VO=i(t_);jU=a(VO,"/usr/local/cuda-10.2/bin/gcc"),VO.forEach(o),PU=a(Te,` and since
`),o_=s(Te,"CODE",{});var XO=i(o_);JU=a(XO,"/usr/local/cuda-10.2/bin/"),XO.forEach(o),CU=a(Te," should be in the "),r_=s(Te,"CODE",{});var YO=i(r_);FU=a(YO,"PATH"),YO.forEach(o),NU=a(Te,` environment variable (see the previous problem\u2019s solution), it
should find `),a_=s(Te,"CODE",{});var HO=i(a_);zU=a(HO,"gcc-7"),HO.forEach(o),OU=a(Te," (and "),n_=s(Te,"CODE",{});var QO=i(n_);WU=a(QO,"g++7"),QO.forEach(o),RU=a(Te,") and then the build will succeed."),Te.forEach(o),P1=d(t),cc=s(t,"P",{});var KO=i(cc);LU=a(KO,"As always make sure to edit the paths in the example to match your situation."),KO.forEach(o),J1=d(t),Ko=s(t,"H3",{class:!0});var B2=i(Ko);Da=s(B2,"A",{id:!0,class:!0,href:!0});var eW=i(Da);s_=s(eW,"SPAN",{});var tW=i(s_);g(Xi.$$.fragment,tW),tW.forEach(o),eW.forEach(o),BU=d(B2),i_=s(B2,"SPAN",{});var oW=i(i_);GU=a(oW,"PyTorch Fully Sharded Data parallel"),oW.forEach(o),B2.forEach(o),C1=d(t),ja=s(t,"P",{});var G2=i(ja);ZU=a(G2,`To accelerate training huge models on larger batch sizes, we can use a fully sharded data parallel model.
This type of data parallel paradigm enables fitting more data and larger models by sharding the optimizer states, gradients and parameters.
To read more about it and the benefits, check out the `),Yi=s(G2,"A",{href:!0,rel:!0});var rW=i(Yi);VU=a(rW,"Fully Sharded Data Parallel blog"),rW.forEach(o),XU=a(G2,`.
We have integrated the latest PyTorch\u2019s Fully Sharded Data Parallel (FSDP) training feature.
All you need to do is enable it through the config.`),G2.forEach(o),F1=d(t),Hi=s(t,"P",{});var b8=i(Hi);l_=s(b8,"STRONG",{});var aW=i(l_);YU=a(aW,"Required PyTorch version for FSDP support"),aW.forEach(o),HU=a(b8,`: PyTorch Nightly (or 1.12.0 if you read this after it has been released)
as the model saving with FSDP activated is only available with recent fixes.`),b8.forEach(o),N1=d(t),Qi=s(t,"P",{});var v8=i(Qi);d_=s(v8,"STRONG",{});var nW=i(d_);QU=a(nW,"Usage"),nW.forEach(o),KU=a(v8,":"),v8.forEach(o),z1=d(t),me=s(t,"UL",{});var at=i(me);c_=s(at,"LI",{});var sW=i(c_);Ki=s(sW,"P",{});var Z2=i(Ki);eD=a(Z2,`Make sure you have added the distributed launcher
`),p_=s(Z2,"CODE",{});var iW=i(p_);tD=a(iW,"-m torch.distributed.launch --nproc_per_node=NUMBER_OF_GPUS_YOU_HAVE"),iW.forEach(o),oD=a(Z2," if you haven\u2019t been using it already."),Z2.forEach(o),sW.forEach(o),rD=d(at),el=s(at,"LI",{});var V2=i(el);pc=s(V2,"P",{});var y8=i(pc);m_=s(y8,"STRONG",{});var lW=i(m_);aD=a(lW,"Sharding Strategy"),lW.forEach(o),nD=a(y8,":"),y8.forEach(o),sD=d(V2),er=s(V2,"UL",{});var Zp=i(er);tl=s(Zp,"LI",{});var X2=i(tl);iD=a(X2,`FULL_SHARD : Shards optimizer states + gradients + model parameters across data parallel workers/GPUs.
For this, add `),h_=s(X2,"CODE",{});var dW=i(h_);lD=a(dW,"--fsdp full_shard"),dW.forEach(o),dD=a(X2," to the command line arguments."),X2.forEach(o),cD=d(Zp),ol=s(Zp,"LI",{});var Y2=i(ol);pD=a(Y2,`SHARD_GRAD_OP : Shards optimizer states + gradients across data parallel workers/GPUs.
For this, add `),u_=s(Y2,"CODE",{});var cW=i(u_);mD=a(cW,"--fsdp shard_grad_op"),cW.forEach(o),hD=a(Y2," to the command line arguments."),Y2.forEach(o),uD=d(Zp),rl=s(Zp,"LI",{});var H2=i(rl);fD=a(H2,"NO_SHARD : No sharding. For this, add "),f_=s(H2,"CODE",{});var pW=i(f_);gD=a(pW,"--fsdp no_shard"),pW.forEach(o),_D=a(H2," to the command line arguments."),H2.forEach(o),Zp.forEach(o),V2.forEach(o),bD=d(at),g_=s(at,"LI",{});var mW=i(g_);tr=s(mW,"P",{});var Vp=i(tr);vD=a(Vp,`To offload the parameters and gradients to the CPU,
add `),__=s(Vp,"CODE",{});var hW=i(__);yD=a(hW,'--fsdp "full_shard offload"'),hW.forEach(o),wD=a(Vp," or "),b_=s(Vp,"CODE",{});var uW=i(b_);TD=a(uW,'--fsdp "shard_grad_op offload"'),uW.forEach(o),ED=a(Vp," to the command line arguments."),Vp.forEach(o),mW.forEach(o),AD=d(at),v_=s(at,"LI",{});var fW=i(v_);ht=s(fW,"P",{});var pn=i(ht);$D=a(pn,"To automatically recursively wrap layers with FSDP using "),y_=s(pn,"CODE",{});var gW=i(y_);kD=a(gW,"default_auto_wrap_policy"),gW.forEach(o),xD=a(pn,`,
add `),w_=s(pn,"CODE",{});var _W=i(w_);MD=a(_W,'--fsdp "full_shard auto_wrap"'),_W.forEach(o),ID=a(pn," or "),T_=s(pn,"CODE",{});var bW=i(T_);SD=a(bW,'--fsdp "shard_grad_op auto_wrap"'),bW.forEach(o),qD=a(pn," to the command line arguments."),pn.forEach(o),fW.forEach(o),UD=d(at),E_=s(at,"LI",{});var vW=i(E_);or=s(vW,"P",{});var Xp=i(or);DD=a(Xp,`To enable both CPU offloading and auto wrapping,
add `),A_=s(Xp,"CODE",{});var yW=i(A_);jD=a(yW,'--fsdp "full_shard offload auto_wrap"'),yW.forEach(o),PD=a(Xp," or "),$_=s(Xp,"CODE",{});var wW=i($_);JD=a(wW,'--fsdp "shard_grad_op offload auto_wrap"'),wW.forEach(o),CD=a(Xp," to the command line arguments."),Xp.forEach(o),vW.forEach(o),FD=d(at),al=s(at,"LI",{});var Q2=i(al);ut=s(Q2,"P",{});var mn=i(ut);ND=a(mn,"Remaining FSDP config is passed via "),k_=s(mn,"CODE",{});var TW=i(k_);zD=a(TW,"--fsdp_config <path_to_fsdp_config.json>"),TW.forEach(o),OD=a(mn,`. It is either a location of
FSDP json config file (e.g., `),x_=s(mn,"CODE",{});var EW=i(x_);WD=a(EW,"fsdp_config.json"),EW.forEach(o),RD=a(mn,") or an already loaded json file as "),M_=s(mn,"CODE",{});var AW=i(M_);LD=a(AW,"dict"),AW.forEach(o),BD=a(mn,"."),mn.forEach(o),GD=d(Q2),ft=s(Q2,"UL",{});var hn=i(ft);mc=s(hn,"LI",{});var w8=i(mc);ZD=a(w8,"If auto wrapping is enabled, you can either use transformer based auto wrap policy or size based auto wrap policy."),nl=s(w8,"UL",{});var K2=i(nl);ge=s(K2,"LI",{});var nt=i(ge);VD=a(nt,"For transformer based auto wrap policy, it is recommended to specify "),I_=s(nt,"CODE",{});var $W=i(I_);XD=a($W,"fsdp_transformer_layer_cls_to_wrap"),$W.forEach(o),YD=a(nt," in the config file. If not specified, the default value is "),S_=s(nt,"CODE",{});var kW=i(S_);HD=a(kW,"model._no_split_modules"),kW.forEach(o),QD=a(nt,` when available.
This specifies the list of transformer layer class name (case-sensitive) to wrap ,e.g, `),q_=s(nt,"CODE",{});var xW=i(q_);KD=a(xW,"BertLayer"),xW.forEach(o),ej=a(nt,", "),U_=s(nt,"CODE",{});var MW=i(U_);tj=a(MW,"GPTJBlock"),MW.forEach(o),oj=a(nt,", "),D_=s(nt,"CODE",{});var IW=i(D_);rj=a(IW,"T5Block"),IW.forEach(o),aj=a(nt,` \u2026
This is important because submodules that share weights (e.g., embedding layer) should not end up in different FSDP wrapped units.
Using this policy, wrapping happens for each block containing Multi-Head Attention followed by couple of MLP layers.
Remaining layers including the shared embeddings are conveniently wrapped in same outermost FSDP unit.
Therefore, use this for transformer based models.`),nt.forEach(o),nj=d(K2),sl=s(K2,"LI",{});var eT=i(sl);sj=a(eT,"For size based auto wrap policy, please add "),j_=s(eT,"CODE",{});var SW=i(j_);ij=a(SW,"fsdp_min_num_params"),SW.forEach(o),lj=a(eT,` in the config file.
It specifies FSDP\u2019s minimum number of parameters for auto wrapping.`),eT.forEach(o),K2.forEach(o),w8.forEach(o),dj=d(hn),gt=s(hn,"LI",{});var un=i(gt);P_=s(un,"CODE",{});var qW=i(P_);cj=a(qW,"fsdp_backward_prefetch"),qW.forEach(o),pj=a(un,` can be specified in the config file. It controls when to prefetch next set of parameters.
`),J_=s(un,"CODE",{});var UW=i(J_);mj=a(UW,"backward_pre"),UW.forEach(o),hj=a(un," and "),C_=s(un,"CODE",{});var DW=i(C_);uj=a(DW,"backward_pos"),DW.forEach(o),fj=a(un,` are available options.
For more information refer `),F_=s(un,"CODE",{});var jW=i(F_);gj=a(jW,"torch.distributed.fsdp.fully_sharded_data_parallel.BackwardPrefetch"),jW.forEach(o),un.forEach(o),_j=d(hn),Pa=s(hn,"LI",{});var xv=i(Pa);N_=s(xv,"CODE",{});var PW=i(N_);bj=a(PW,"fsdp_forward_prefetch"),PW.forEach(o),vj=a(xv,` can be specified in the config file. It controls when to prefetch next set of parameters.
If `),z_=s(xv,"CODE",{});var JW=i(z_);yj=a(JW,'"True"'),JW.forEach(o),wj=a(xv,", FSDP explicitly prefetches the next upcoming all-gather while executing in the forward pass."),xv.forEach(o),Tj=d(hn),Ja=s(hn,"LI",{});var Mv=i(Ja);O_=s(Mv,"CODE",{});var CW=i(O_);Ej=a(CW,"limit_all_gathers"),CW.forEach(o),Aj=a(Mv,` can be specified in the config file.
If `),W_=s(Mv,"CODE",{});var FW=i(W_);$j=a(FW,'"True"'),FW.forEach(o),kj=a(Mv,", FSDP explicitly synchronizes the CPU thread to prevent too many in-flight all-gathers."),Mv.forEach(o),hn.forEach(o),Q2.forEach(o),at.forEach(o),O1=d(t),hc=s(t,"P",{});var NW=i(hc);R_=s(NW,"STRONG",{});var zW=i(R_);xj=a(zW,"Few caveats to be aware of"),zW.forEach(o),NW.forEach(o),W1=d(t),uc=s(t,"UL",{});var OW=i(uc);Ye=s(OW,"LI",{});var mr=i(Ye);Mj=a(mr,"it is incompatible with "),L_=s(mr,"CODE",{});var WW=i(L_);Ij=a(WW,"generate"),WW.forEach(o),Sj=a(mr,", thus is incompatible with "),B_=s(mr,"CODE",{});var RW=i(B_);qj=a(RW,"--predict_with_generate"),RW.forEach(o),Uj=a(mr,`
in all seq2seq/clm scripts (translation/summarization/clm etc.).`),Dj=s(mr,"BR",{}),jj=a(mr,`
Please refer issue `),il=s(mr,"A",{href:!0,rel:!0});var LW=i(il);Pj=a(LW,"#21667"),LW.forEach(o),mr.forEach(o),OW.forEach(o),R1=d(t),rr=s(t,"H3",{class:!0});var tT=i(rr);Ca=s(tT,"A",{id:!0,class:!0,href:!0});var BW=i(Ca);G_=s(BW,"SPAN",{});var GW=i(G_);g(ll.$$.fragment,GW),GW.forEach(o),BW.forEach(o),Jj=d(tT),Z_=s(tT,"SPAN",{});var ZW=i(Z_);Cj=a(ZW,"PyTorch/XLA Fully Sharded Data parallel"),ZW.forEach(o),tT.forEach(o),L1=d(t),oo=s(t,"P",{});var Yp=i(oo);Fj=a(Yp,`For all the TPU users, great news! PyTorch/XLA now supports FSDP.
All the latest Fully Sharded Data Parallel (FSDP) training are supported.
For more information refer to the `),dl=s(Yp,"A",{href:!0,rel:!0});var VW=i(dl);Nj=a(VW,"Scaling PyTorch models on Cloud TPUs with FSDP"),VW.forEach(o),zj=a(Yp," and "),cl=s(Yp,"A",{href:!0,rel:!0});var XW=i(cl);Oj=a(XW,"PyTorch/XLA implementation of FSDP"),XW.forEach(o),Wj=a(Yp,`
All you need to do is enable it through the config.`),Yp.forEach(o),B1=d(t),pl=s(t,"P",{});var T8=i(pl);V_=s(T8,"STRONG",{});var YW=i(V_);Rj=a(YW,"Required PyTorch/XLA version for FSDP support"),YW.forEach(o),Lj=a(T8,": >=2.0"),T8.forEach(o),G1=d(t),ml=s(t,"P",{});var E8=i(ml);X_=s(E8,"STRONG",{});var HW=i(X_);Bj=a(HW,"Usage"),HW.forEach(o),Gj=a(E8,":"),E8.forEach(o),Z1=d(t),ro=s(t,"P",{});var Hp=i(ro);Zj=a(Hp,"Pass "),Y_=s(Hp,"CODE",{});var QW=i(Y_);Vj=a(QW,'--fsdp "full shard"'),QW.forEach(o),Xj=a(Hp," along with following changes to be made in "),H_=s(Hp,"CODE",{});var KW=i(H_);Yj=a(KW,"--fsdp_config <path_to_fsdp_config.json>"),KW.forEach(o),Hj=a(Hp,":"),Hp.forEach(o),V1=d(t),He=s(t,"UL",{});var fn=i(He);Fa=s(fn,"LI",{});var Iv=i(Fa);Q_=s(Iv,"CODE",{});var eR=i(Q_);Qj=a(eR,"xla"),eR.forEach(o),Kj=a(Iv," should be set to "),K_=s(Iv,"CODE",{});var tR=i(K_);eP=a(tR,"True"),tR.forEach(o),tP=a(Iv," to enable PyTorch/XLA FSDP."),Iv.forEach(o),oP=d(fn),Na=s(fn,"LI",{});var Sv=i(Na);eb=s(Sv,"CODE",{});var oR=i(eb);rP=a(oR,"xla_fsdp_settings"),oR.forEach(o),aP=a(Sv,` The value is a dictionary which stores the XLA FSDP wrapping parameters.
For a complete list of options, please see `),hl=s(Sv,"A",{href:!0,rel:!0});var rR=i(hl);nP=a(rR,"here"),rR.forEach(o),sP=a(Sv,"."),Sv.forEach(o),iP=d(fn),Qe=s(fn,"LI",{});var hr=i(Qe);tb=s(hr,"CODE",{});var aR=i(tb);lP=a(aR,"xla_fsdp_grad_ckpt"),aR.forEach(o),dP=a(hr,". When "),ob=s(hr,"CODE",{});var nR=i(ob);cP=a(nR,"True"),nR.forEach(o),pP=a(hr,`, uses gradient checkpointing over each nested XLA FSDP wrapped layer.
This setting can only be used when the xla flag is set to true, and an auto wrapping policy is specified through
`),rb=s(hr,"CODE",{});var sR=i(rb);mP=a(sR,"fsdp_min_num_params"),sR.forEach(o),hP=a(hr," or "),ab=s(hr,"CODE",{});var iR=i(ab);uP=a(iR,"fsdp_transformer_layer_cls_to_wrap"),iR.forEach(o),fP=a(hr,"."),hr.forEach(o),gP=d(fn),fc=s(fn,"LI",{});var A8=i(fc);_P=a(A8,"You can either use transformer based auto wrap policy or size based auto wrap policy."),ul=s(A8,"UL",{});var oT=i(ul);_e=s(oT,"LI",{});var st=i(_e);bP=a(st,"For transformer based auto wrap policy, it is recommended to specify "),nb=s(st,"CODE",{});var lR=i(nb);vP=a(lR,"fsdp_transformer_layer_cls_to_wrap"),lR.forEach(o),yP=a(st," in the config file. If not specified, the default value is "),sb=s(st,"CODE",{});var dR=i(sb);wP=a(dR,"model._no_split_modules"),dR.forEach(o),TP=a(st,` when available.
This specifies the list of transformer layer class name (case-sensitive) to wrap ,e.g, `),ib=s(st,"CODE",{});var cR=i(ib);EP=a(cR,"BertLayer"),cR.forEach(o),AP=a(st,", "),lb=s(st,"CODE",{});var pR=i(lb);$P=a(pR,"GPTJBlock"),pR.forEach(o),kP=a(st,", "),db=s(st,"CODE",{});var mR=i(db);xP=a(mR,"T5Block"),mR.forEach(o),MP=a(st,` \u2026
This is important because submodules that share weights (e.g., embedding layer) should not end up in different FSDP wrapped units.
Using this policy, wrapping happens for each block containing Multi-Head Attention followed by couple of MLP layers.
Remaining layers including the shared embeddings are conveniently wrapped in same outermost FSDP unit.
Therefore, use this for transformer based models.`),st.forEach(o),IP=d(oT),fl=s(oT,"LI",{});var rT=i(fl);SP=a(rT,"For size based auto wrap policy, please add "),cb=s(rT,"CODE",{});var hR=i(cb);qP=a(hR,"fsdp_min_num_params"),hR.forEach(o),UP=a(rT,` in the config file.
It specifies FSDP\u2019s minimum number of parameters for auto wrapping.`),rT.forEach(o),oT.forEach(o),A8.forEach(o),fn.forEach(o),X1=d(t),ar=s(t,"H3",{class:!0});var aT=i(ar);za=s(aT,"A",{id:!0,class:!0,href:!0});var uR=i(za);pb=s(uR,"SPAN",{});var fR=i(pb);g(gl.$$.fragment,fR),fR.forEach(o),uR.forEach(o),DP=d(aT),mb=s(aT,"SPAN",{});var gR=i(mb);jP=a(gR,"Using Trainer for accelerated PyTorch Training on Mac"),gR.forEach(o),aT.forEach(o),Y1=d(t),Ke=s(t,"P",{});var gn=i(Ke);PP=a(gn,`With PyTorch v1.12 release, developers and researchers can take advantage of Apple silicon GPUs for significantly faster model training.
This unlocks the ability to perform machine learning workflows like prototyping and fine-tuning locally, right on Mac.
Apple\u2019s Metal Performance Shaders (MPS) as a backend for PyTorch enables this and can be used via the new `),hb=s(gn,"CODE",{});var _R=i(hb);JP=a(_R,'"mps"'),_R.forEach(o),CP=a(gn,` device.
This will map computational graphs and primitives on the MPS Graph framework and tuned kernels provided by MPS.
For more information please refer official documents `),_l=s(gn,"A",{href:!0,rel:!0});var bR=i(_l);FP=a(bR,"Introducing Accelerated PyTorch Training on Mac"),bR.forEach(o),NP=a(gn,`
and `),bl=s(gn,"A",{href:!0,rel:!0});var vR=i(bl);zP=a(vR,"MPS BACKEND"),vR.forEach(o),OP=a(gn,"."),gn.forEach(o),H1=d(t),g(Oa.$$.fragment,t),Q1=d(t),gc=s(t,"P",{});var yR=i(gc);ub=s(yR,"STRONG",{});var wR=i(ub);WP=a(wR,"Benefits of Training and Inference using Apple Silicon Chips"),wR.forEach(o),yR.forEach(o),K1=d(t),ao=s(t,"OL",{});var Qp=i(ao);fb=s(Qp,"LI",{});var TR=i(fb);RP=a(TR,"Enables users to train larger networks or batch sizes locally"),TR.forEach(o),LP=d(Qp),gb=s(Qp,"LI",{});var ER=i(gb);BP=a(ER,`Reduces data retrieval latency and provides the GPU with direct access to the full memory store due to unified memory architecture.
Therefore, improving end-to-end performance.`),ER.forEach(o),GP=d(Qp),_b=s(Qp,"LI",{});var AR=i(_b);ZP=a(AR,"Reduces costs associated with cloud-based development or the need for additional local GPUs."),AR.forEach(o),Qp.forEach(o),ew=d(t),nr=s(t,"P",{});var qv=i(nr);bb=s(qv,"STRONG",{});var $R=i(bb);VP=a($R,"Pre-requisites"),$R.forEach(o),XP=a(qv,`: To install torch with mps support,
please follow this nice medium article `),vl=s(qv,"A",{href:!0,rel:!0});var kR=i(vl);YP=a(kR,"GPU-Acceleration Comes to PyTorch on M1 Macs"),kR.forEach(o),HP=a(qv,"."),qv.forEach(o),tw=d(t),_t=s(t,"P",{});var zl=i(_t);vb=s(zl,"STRONG",{});var xR=i(vb);QP=a(xR,"Usage"),xR.forEach(o),KP=a(zl,`:
`),yb=s(zl,"CODE",{});var MR=i(yb);e6=a(MR,"mps"),MR.forEach(o),t6=a(zl," device will be used by default if available similar to the way "),wb=s(zl,"CODE",{});var IR=i(wb);o6=a(IR,"cuda"),IR.forEach(o),r6=a(zl,` device is used.
Therefore, no action from user is required.
For example, you can run the official Glue text classififcation task (from the root folder) using Apple Silicon GPU with below command:`),zl.forEach(o),ow=d(t),g(yl.$$.fragment,t),rw=d(t),_c=s(t,"P",{});var SR=i(_c);Tb=s(SR,"STRONG",{});var qR=i(Tb);a6=a(qR,"A few caveats to be aware of"),qR.forEach(o),SR.forEach(o),aw=d(t),Wa=s(t,"OL",{});var nT=i(Wa);wl=s(nT,"LI",{});var sT=i(wl);n6=a(sT,`Some PyTorch operations have not been implemented in mps and will throw an error.
One way to get around that is to set the environment variable `),Eb=s(sT,"CODE",{});var UR=i(Eb);s6=a(UR,"PYTORCH_ENABLE_MPS_FALLBACK=1"),UR.forEach(o),i6=a(sT,`,
which will fallback to CPU for these operations. It still throws a UserWarning however.`),sT.forEach(o),l6=d(nT),Ue=s(nT,"LI",{});var go=i(Ue);d6=a(go,"Distributed setups "),Ab=s(go,"CODE",{});var DR=i(Ab);c6=a(DR,"gloo"),DR.forEach(o),p6=a(go," and "),$b=s(go,"CODE",{});var jR=i($b);m6=a(jR,"nccl"),jR.forEach(o),h6=a(go," are not working with "),kb=s(go,"CODE",{});var PR=i(kb);u6=a(PR,"mps"),PR.forEach(o),f6=a(go,` device.
This means that currently only single GPU of `),xb=s(go,"CODE",{});var JR=i(xb);g6=a(JR,"mps"),JR.forEach(o),_6=a(go," device type can be used."),go.forEach(o),nT.forEach(o),nw=d(t),no=s(t,"P",{});var Kp=i(no);b6=a(Kp,"Finally, please, remember that, \u{1F917} "),Mb=s(Kp,"CODE",{});var CR=i(Mb);v6=a(CR,"Trainer"),CR.forEach(o),y6=a(Kp,` only integrates MPS backend, therefore if you
have any problems or questions with regards to MPS backend usage, please,
file an issue with `),Tl=s(Kp,"A",{href:!0,rel:!0});var FR=i(Tl);w6=a(FR,"PyTorch GitHub"),FR.forEach(o),T6=a(Kp,"."),Kp.forEach(o),sw=d(t),sr=s(t,"H2",{class:!0});var iT=i(sr);Ra=s(iT,"A",{id:!0,class:!0,href:!0});var NR=i(Ra);Ib=s(NR,"SPAN",{});var zR=i(Ib);g(El.$$.fragment,zR),zR.forEach(o),NR.forEach(o),E6=d(iT),Sb=s(iT,"SPAN",{});var OR=i(Sb);A6=a(OR,"Using Accelerate Launcher with Trainer"),OR.forEach(o),iT.forEach(o),iw=d(t),bc=s(t,"P",{});var WR=i(bc);$6=a(WR,"Accelerate now powers Trainer. In terms of what users should expect:"),WR.forEach(o),lw=d(t),La=s(t,"UL",{});var lT=i(La);qb=s(lT,"LI",{});var RR=i(qb);k6=a(RR,"They can keep using the Trainer ingterations such as FSDP, DeepSpeed vis trainer arguments without any changes on their part."),RR.forEach(o),x6=d(lT),Ub=s(lT,"LI",{});var LR=i(Ub);M6=a(LR,"They can now use Accelerate Launcher with Trainer (recommended)."),LR.forEach(o),lT.forEach(o),dw=d(t),vc=s(t,"P",{});var BR=i(vc);I6=a(BR,"Steps to use Accelerate Launcher with Trainer:"),BR.forEach(o),cw=d(t),so=s(t,"OL",{});var em=i(so);Db=s(em,"LI",{});var GR=i(Db);io=s(GR,"P",{});var Ol=i(io);S6=a(Ol,"Make sure \u{1F917} Accelerate is installed, you can\u2019t use the "),jb=s(Ol,"CODE",{});var ZR=i(jb);q6=a(ZR,"Trainer"),ZR.forEach(o),U6=a(Ol," without it anyway. If not "),Pb=s(Ol,"CODE",{});var VR=i(Pb);D6=a(VR,"pip install accelerate"),VR.forEach(o),j6=a(Ol,". You may also need to update your version of Accelerate: "),Jb=s(Ol,"CODE",{});var XR=i(Jb);P6=a(XR,"pip install accelerate --upgrade"),XR.forEach(o),Ol.forEach(o),GR.forEach(o),J6=d(em),K=s(em,"LI",{});var he=i(K);Al=s(he,"P",{});var dT=i(Al);C6=a(dT,"Run "),Cb=s(dT,"CODE",{});var YR=i(Cb);F6=a(YR,"accelerate config"),YR.forEach(o),N6=a(dT,` and fill the questionnaire. Below are example accelerate configs:
a. DDP Multi-node Multi-GPU config:`),dT.forEach(o),z6=d(he),g($l.$$.fragment,he),O6=d(he),Fb=s(he,"P",{});var HR=i(Fb);W6=a(HR,"b. FSDP config:"),HR.forEach(o),R6=d(he),g(kl.$$.fragment,he),L6=d(he),Nb=s(he,"P",{});var QR=i(Nb);B6=a(QR,"c. DeepSpeed config pointing to a file:"),QR.forEach(o),G6=d(he),g(xl.$$.fragment,he),Z6=d(he),zb=s(he,"P",{});var KR=i(zb);V6=a(KR,"d. DeepSpeed config using accelerate plugin:"),KR.forEach(o),X6=d(he),g(Ml.$$.fragment,he),he.forEach(o),Y6=d(em),Ob=s(em,"LI",{});var eL=i(Ob);ir=s(eL,"P",{});var tm=i(ir);H6=a(tm,`Run the Trainer script with args other than the ones handled above by accelerate config or launcher args.
Below is an example to run `),Wb=s(tm,"CODE",{});var tL=i(Wb);Q6=a(tL,"run_glue.py"),tL.forEach(o),K6=a(tm," using "),Rb=s(tm,"CODE",{});var oL=i(Rb);eJ=a(oL,"accelerate launcher"),oL.forEach(o),tJ=a(tm," with FSDP config from above."),tm.forEach(o),eL.forEach(o),em.forEach(o),pw=d(t),g(Il.$$.fragment,t),mw=d(t),Sl=s(t,"OL",{start:!0});var rL=i(Sl);ql=s(rL,"LI",{});var cT=i(ql);oJ=a(cT,"You can also directly use the cmd args for "),Lb=s(cT,"CODE",{});var aL=i(Lb);rJ=a(aL,"accelerate launch"),aL.forEach(o),aJ=a(cT,". Above example would map to:"),cT.forEach(o),rL.forEach(o),hw=d(t),g(Ul.$$.fragment,t),uw=d(t),Ba=s(t,"P",{});var pT=i(Ba);nJ=a(pT,"For more information, please refer the \u{1F917} Accelerate CLI guide: "),Dl=s(pT,"A",{href:!0,rel:!0});var nL=i(Dl);sJ=a(nL,"Launching your \u{1F917} Accelerate scripts"),nL.forEach(o),iJ=a(pT,"."),pT.forEach(o),fw=d(t),yc=s(t,"P",{});var sL=i(yc);lJ=a(sL,"Sections that were moved:"),sL.forEach(o),gw=d(t),M=s(t,"P",{});var I=i(M);dJ=a(I,"[ "),wc=s(I,"A",{href:!0});var iL=i(wc);cJ=a(iL,"DeepSpeed"),iL.forEach(o),Bb=s(I,"A",{id:!0}),i(Bb).forEach(o),pJ=a(I,`
| `),Tc=s(I,"A",{href:!0});var lL=i(Tc);mJ=a(lL,"Installation"),lL.forEach(o),Gb=s(I,"A",{id:!0}),i(Gb).forEach(o),hJ=a(I,`
| `),Ec=s(I,"A",{href:!0});var dL=i(Ec);uJ=a(dL,"Deployment with multiple GPUs"),dL.forEach(o),Zb=s(I,"A",{id:!0}),i(Zb).forEach(o),fJ=a(I,`
| `),Ac=s(I,"A",{href:!0});var cL=i(Ac);gJ=a(cL,"Deployment with one GPU"),cL.forEach(o),Vb=s(I,"A",{id:!0}),i(Vb).forEach(o),_J=a(I,`
| `),$c=s(I,"A",{href:!0});var pL=i($c);bJ=a(pL,"Deployment in Notebooks"),pL.forEach(o),Xb=s(I,"A",{id:!0}),i(Xb).forEach(o),vJ=a(I,`
| `),kc=s(I,"A",{href:!0});var mL=i(kc);yJ=a(mL,"Configuration"),mL.forEach(o),Yb=s(I,"A",{id:!0}),i(Yb).forEach(o),wJ=a(I,`
| `),xc=s(I,"A",{href:!0});var hL=i(xc);TJ=a(hL,"Passing Configuration"),hL.forEach(o),Hb=s(I,"A",{id:!0}),i(Hb).forEach(o),EJ=a(I,`
| `),Mc=s(I,"A",{href:!0});var uL=i(Mc);AJ=a(uL,"Shared Configuration"),uL.forEach(o),Qb=s(I,"A",{id:!0}),i(Qb).forEach(o),$J=a(I,`
| `),Ic=s(I,"A",{href:!0});var fL=i(Ic);kJ=a(fL,"ZeRO"),fL.forEach(o),Kb=s(I,"A",{id:!0}),i(Kb).forEach(o),xJ=a(I,`
| `),Sc=s(I,"A",{href:!0});var gL=i(Sc);MJ=a(gL,"ZeRO-2 Config"),gL.forEach(o),ev=s(I,"A",{id:!0}),i(ev).forEach(o),IJ=a(I,`
| `),qc=s(I,"A",{href:!0});var _L=i(qc);SJ=a(_L,"ZeRO-3 Config"),_L.forEach(o),tv=s(I,"A",{id:!0}),i(tv).forEach(o),qJ=a(I,`
| `),Uc=s(I,"A",{href:!0});var bL=i(Uc);UJ=a(bL,"NVMe Support"),bL.forEach(o),ov=s(I,"A",{id:!0}),i(ov).forEach(o),DJ=a(I,`
| `),Dc=s(I,"A",{href:!0});var vL=i(Dc);jJ=a(vL,"ZeRO-2 vs ZeRO-3 Performance"),vL.forEach(o),rv=s(I,"A",{id:!0}),i(rv).forEach(o),PJ=a(I,`
| `),jc=s(I,"A",{href:!0});var yL=i(jc);JJ=a(yL,"ZeRO-2 Example"),yL.forEach(o),av=s(I,"A",{id:!0}),i(av).forEach(o),CJ=a(I,`
| `),Pc=s(I,"A",{href:!0});var wL=i(Pc);FJ=a(wL,"ZeRO-3 Example"),wL.forEach(o),nv=s(I,"A",{id:!0}),i(nv).forEach(o),NJ=a(I,`
| `),Jc=s(I,"A",{href:!0});var TL=i(Jc);zJ=a(TL,"Optimizer"),TL.forEach(o),sv=s(I,"A",{id:!0}),i(sv).forEach(o),OJ=a(I,`
| `),Cc=s(I,"A",{href:!0});var EL=i(Cc);WJ=a(EL,"Scheduler"),EL.forEach(o),iv=s(I,"A",{id:!0}),i(iv).forEach(o),RJ=a(I,`
| `),Fc=s(I,"A",{href:!0});var AL=i(Fc);LJ=a(AL,"fp32 Precision"),AL.forEach(o),lv=s(I,"A",{id:!0}),i(lv).forEach(o),BJ=a(I,`
| `),Nc=s(I,"A",{href:!0});var $L=i(Nc);GJ=a($L,"Automatic Mixed Precision"),$L.forEach(o),dv=s(I,"A",{id:!0}),i(dv).forEach(o),ZJ=a(I,`
| `),zc=s(I,"A",{href:!0});var kL=i(zc);VJ=a(kL,"Batch Size"),kL.forEach(o),cv=s(I,"A",{id:!0}),i(cv).forEach(o),XJ=a(I,`
| `),Oc=s(I,"A",{href:!0});var xL=i(Oc);YJ=a(xL,"Gradient Accumulation"),xL.forEach(o),pv=s(I,"A",{id:!0}),i(pv).forEach(o),HJ=a(I,`
| `),Wc=s(I,"A",{href:!0});var ML=i(Wc);QJ=a(ML,"Gradient Clipping"),ML.forEach(o),mv=s(I,"A",{id:!0}),i(mv).forEach(o),KJ=a(I,`
| `),Rc=s(I,"A",{href:!0});var IL=i(Rc);e8=a(IL,"Getting The Model Weights Out"),IL.forEach(o),hv=s(I,"A",{id:!0}),i(hv).forEach(o),t8=a(I,`
]`),I.forEach(o),this.h()},h(){m(u,"name","hf:doc:metadata"),m(u,"content",JSON.stringify(tB)),m(w,"id","trainer"),m(w,"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"),m(w,"href","#trainer"),m(T,"class","relative group"),m(ee,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(X,"href","https://github.com/huggingface/transformers/tree/main/examples"),m(X,"rel","nofollow"),m(F,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(se,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.TrainingArguments"),m($e,"href","https://github.com/NVIDIA/apex"),m($e,"rel","nofollow"),m(ke,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(rd,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(ad,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(nd,"href","callback"),m(vr,"id","transformers.Trainer"),m(vr,"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"),m(vr,"href","#transformers.Trainer"),m(yo,"class","relative group"),m(sd,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),m(wr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Tr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Er,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ar,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m($r,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ld,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),m(kr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(xr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Sr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(qr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ur,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(cd,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(ns,"href","https://github.com/pytorch/pytorch/issues/16266"),m(ns,"rel","nofollow"),m(pd,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(md,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(jr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Pr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Cr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Fr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(hd,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer.log_metrics"),m(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Nr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(zr,"id","transformers.Seq2SeqTrainer"),m(zr,"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"),m(zr,"href","#transformers.Seq2SeqTrainer"),m(qo,"class","relative group"),m(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Wr,"id","transformers.TrainingArguments"),m(Wr,"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"),m(Wr,"href","#transformers.TrainingArguments"),m(Jo,"class","relative group"),m(ud,"href","/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.HfArgumentParser"),m(Fs,"href","https://docs.python.org/3/library/argparse#module-argparse"),m(Fs,"rel","nofollow"),m(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Rr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(oa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ra,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(aa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(na,"id","transformers.Seq2SeqTrainingArguments"),m(na,"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"),m(na,"href","#transformers.Seq2SeqTrainingArguments"),m(Oo,"class","relative group"),m(fd,"href","/docs/transformers/v4.32.0/en/internal/trainer_utils#transformers.HfArgumentParser"),m(ni,"href","https://docs.python.org/3/library/argparse#module-argparse"),m(ni,"rel","nofollow"),m(sa,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ia,"id","checkpoints"),m(ia,"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"),m(ia,"href","#checkpoints"),m(Lo,"class","relative group"),m(gd,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(_d,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.TrainingArguments"),m(bd,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer.train"),m(wd,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.TrainingArguments"),m(ma,"id","logging"),m(ma,"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"),m(ma,"href","#logging"),m(Bo,"class","relative group"),m(Ed,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(Ad,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.TrainingArguments"),m(xd,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.TrainingArguments"),m(Md,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(Id,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(fa,"id","randomness"),m(fa,"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"),m(fa,"href","#randomness"),m(Go,"class","relative group"),m(Pd,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(ui,"href","https://pytorch.org/docs/stable/notes/randomness"),m(ui,"rel","nofollow"),m(ga,"id","specific-gpus-selection"),m(ga,"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"),m(ga,"href","#specific-gpus-selection"),m(Zo,"class","relative group"),m(gi,"href","https://pytorch.org/docs/stable/generated/torch.nn.parallel.DistributedDataParallel.html"),m(gi,"rel","nofollow"),m(bi,"href","https://github.com/huggingface/accelerate"),m(bi,"rel","nofollow"),m(vi,"href","https://github.com/microsoft/DeepSpeed"),m(vi,"rel","nofollow"),m(Cd,"href","Deepspeed"),m(Ai,"href","https://pytorch.org/docs/stable/generated/torch.nn.DataParallel.html"),m(Ai,"rel","nofollow"),m(Si,"start","2"),m(Ta,"id","trainer-integrations"),m(Ta,"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"),m(Ta,"href","#trainer-integrations"),m(Vo,"class","relative group"),m(Yd,"href","/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer"),m(ji,"href","https://github.com/microsoft/DeepSpeed"),m(ji,"rel","nofollow"),m(Pi,"href","https://pytorch.org/docs/stable/fsdp.html"),m(Pi,"rel","nofollow"),m(Ji,"href","https://arxiv.org/abs/1910.02054"),m(Ji,"rel","nofollow"),m(Hd,"href","#pytorch-fully-sharded-data-parallel"),m(Qd,"id","zero-install-notes"),m($a,"id","cuda-extension-installation-notes"),m($a,"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"),m($a,"href","#cuda-extension-installation-notes"),m(Xo,"class","relative group"),m(Fi,"href","https://github.com/microsoft/DeepSpeed/issues"),m(Fi,"rel","nofollow"),m(xa,"id","possible-problem-1"),m(xa,"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"),m(xa,"href","#possible-problem-1"),m(Yo,"class","relative group"),m(Wi,"href","https://www.google.com/search?q=ubuntu+cuda+10.2+install"),m(Wi,"rel","nofollow"),m(Ia,"id","possible-problem-2"),m(Ia,"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"),m(Ia,"href","#possible-problem-2"),m(Ho,"class","relative group"),m(qa,"id","possible-problem-3"),m(qa,"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"),m(qa,"href","#possible-problem-3"),m(Qo,"class","relative group"),m(Da,"id","pytorch-fully-sharded-data-parallel"),m(Da,"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"),m(Da,"href","#pytorch-fully-sharded-data-parallel"),m(Ko,"class","relative group"),m(Yi,"href","https://pytorch.org/blog/introducing-pytorch-fully-sharded-data-parallel-api/"),m(Yi,"rel","nofollow"),m(il,"href","https://github.com/huggingface/transformers/issues/21667"),m(il,"rel","nofollow"),m(Ca,"id","pytorchxla-fully-sharded-data-parallel"),m(Ca,"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"),m(Ca,"href","#pytorchxla-fully-sharded-data-parallel"),m(rr,"class","relative group"),m(dl,"href","https://pytorch.org/blog/scaling-pytorch-models-on-cloud-tpus-with-fsdp/"),m(dl,"rel","nofollow"),m(cl,"href","https://github.com/pytorch/xla/tree/master/torch_xla/distributed/fsdp"),m(cl,"rel","nofollow"),m(hl,"href","https://github.com/pytorch/xla/blob/master/torch_xla/distributed/fsdp/xla_fully_sharded_data_parallel.py"),m(hl,"rel","nofollow"),m(za,"id","using-trainer-for-accelerated-pytorch-training-on-mac"),m(za,"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"),m(za,"href","#using-trainer-for-accelerated-pytorch-training-on-mac"),m(ar,"class","relative group"),m(_l,"href","https://pytorch.org/blog/introducing-accelerated-pytorch-training-on-mac/"),m(_l,"rel","nofollow"),m(bl,"href","https://pytorch.org/docs/stable/notes/mps.html"),m(bl,"rel","nofollow"),m(vl,"href","https://medium.com/towards-data-science/gpu-acceleration-comes-to-pytorch-on-m1-macs-195c399efcc1"),m(vl,"rel","nofollow"),m(Tl,"href","https://github.com/pytorch/pytorch/issues"),m(Tl,"rel","nofollow"),m(Ra,"id","using-accelerate-launcher-with-trainer"),m(Ra,"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"),m(Ra,"href","#using-accelerate-launcher-with-trainer"),m(sr,"class","relative group"),m(Sl,"start","4"),m(Dl,"href","https://huggingface.co/docs/accelerate/basic_tutorials/launch"),m(Dl,"rel","nofollow"),m(wc,"href","./deepspeed#deepspeed-trainer-integration"),m(Bb,"id","deepspeed"),m(Tc,"href","./deepspeed#deepspeed-installation"),m(Gb,"id","installation"),m(Ec,"href","./deepspeed#deepspeed-multi-gpu"),m(Zb,"id","deployment-with-multiple-gpus"),m(Ac,"href","./deepspeed#deepspeed-one-gpu"),m(Vb,"id","deployment-with-one-gpu"),m($c,"href","./deepspeed#deepspeed-notebook"),m(Xb,"id","deployment-in-notebooks"),m(kc,"href","./deepspeed#deepspeed-config"),m(Yb,"id","configuration"),m(xc,"href","./deepspeed#deepspeed-config-passing"),m(Hb,"id","passing-configuration"),m(Mc,"href","./deepspeed#deepspeed-config-shared"),m(Qb,"id","shared-configuration"),m(Ic,"href","./deepspeed#deepspeed-zero"),m(Kb,"id","zero"),m(Sc,"href","./deepspeed#deepspeed-zero2-config"),m(ev,"id","zero-2-config"),m(qc,"href","./deepspeed#deepspeed-zero3-config"),m(tv,"id","zero-3-config"),m(Uc,"href","./deepspeed#deepspeed-nvme"),m(ov,"id","nvme-support"),m(Dc,"href","./deepspeed#deepspeed-zero2-zero3-performance"),m(rv,"id","zero-2-vs-zero-3-performance"),m(jc,"href","./deepspeed#deepspeed-zero2-example"),m(av,"id","zero-2-example"),m(Pc,"href","./deepspeed#deepspeed-zero3-example"),m(nv,"id","zero-3-example"),m(Jc,"href","./deepspeed#deepspeed-optimizer"),m(sv,"id","optimizer"),m(Cc,"href","./deepspeed#deepspeed-scheduler"),m(iv,"id","scheduler"),m(Fc,"href","./deepspeed#deepspeed-fp32"),m(lv,"id","fp32-precision"),m(Nc,"href","./deepspeed#deepspeed-amp"),m(dv,"id","automatic-mixed-precision"),m(zc,"href","./deepspeed#deepspeed-bs"),m(cv,"id","batch-size"),m(Oc,"href","./deepspeed#deepspeed-grad-acc"),m(pv,"id","gradient-accumulation"),m(Wc,"href","./deepspeed#deepspeed-grad-clip"),m(mv,"id","gradient-clipping"),m(Rc,"href","./deepspeed#deepspeed-weight-extraction"),m(hv,"id","getting-the-model-weights-out")},m(t,c){e(document.head,u),p(t,$,c),p(t,T,c),e(T,w),e(w,k),_(h,k,null),e(T,E),e(T,C),e(C,z),p(t,j,c),p(t,R,c),e(R,G),e(R,ee),e(ee,Q),e(R,Y),e(R,X),e(X,ue),e(R,H),p(t,L,c),p(t,O,c),e(O,ne),e(O,F),e(F,Ee),e(O,Ae),e(O,se),e(se,bt),e(O,vt),p(t,be,c),p(t,je,c),e(je,_n),e(je,$e),e($e,bn),e(je,vn),p(t,ie,c),p(t,re,c),e(re,Wl),e(re,ke),e(ke,fr),e(re,Rl),p(t,vo,c),p(t,W,c),e(W,ae),e(ae,gr),e(gr,Ll),e(ae,Bl),e(W,Gl),e(W,Zl),e(Zl,om),e(om,mT),e(Zl,hT),e(W,uT),e(W,Vl),e(Vl,rm),e(rm,fT),e(Vl,gT),e(W,_T),e(W,Xl),e(Xl,am),e(am,bT),e(Xl,vT),e(W,yT),e(W,yt),e(yt,nm),e(nm,wT),e(yt,TT),e(yt,sm),e(sm,ET),e(yt,AT),e(yt,im),e(im,$T),e(yt,kT),e(W,xT),e(W,Yl),e(Yl,lm),e(lm,MT),e(Yl,IT),e(W,ST),e(W,Hl),e(Hl,dm),e(dm,qT),e(Hl,UT),e(W,DT),e(W,Ql),e(Ql,cm),e(cm,jT),e(Ql,PT),e(W,JT),e(W,Kl),e(Kl,pm),e(pm,CT),e(Kl,FT),e(W,NT),e(W,ed),e(ed,mm),e(mm,zT),e(ed,OT),e(W,WT),e(W,td),e(td,hm),e(hm,RT),e(td,LT),e(W,BT),e(W,od),e(od,um),e(um,GT),e(od,ZT),p(t,Uv,c),_(_r,t,c),p(t,Dv,c),p(t,br,c),e(br,VT),e(br,rd),e(rd,XT),e(br,YT),p(t,jv,c),_(yn,t,c),p(t,Pv,c),p(t,wt,c),e(wt,HT),e(wt,ad),e(ad,QT),e(wt,KT),e(wt,nd),e(nd,e0),e(wt,t0),p(t,Jv,c),p(t,yo,c),e(yo,vr),e(vr,fm),_(wn,fm,null),e(yo,o0),e(yo,gm),e(gm,r0),p(t,Cv,c),p(t,A,c),_(Tn,A,null),e(A,a0),e(A,_m),e(_m,n0),e(A,s0),e(A,bm),e(bm,i0),e(A,l0),e(A,xe),e(xe,yr),e(yr,vm),e(vm,d0),e(yr,c0),e(yr,sd),e(sd,p0),e(yr,m0),e(xe,h0),e(xe,le),e(le,ym),e(ym,u0),e(le,f0),e(le,wm),e(wm,g0),e(le,_0),e(le,Tm),e(Tm,b0),e(le,v0),e(le,Em),e(Em,y0),e(le,w0),e(le,Am),e(Am,T0),e(le,E0),e(le,$m),e($m,A0),e(le,$0),e(xe,k0),e(xe,id),e(id,km),e(km,x0),e(id,M0),e(xe,I0),e(xe,Pe),e(Pe,xm),e(xm,S0),e(Pe,q0),e(Pe,Mm),e(Mm,U0),e(Pe,D0),e(Pe,Im),e(Im,j0),e(Pe,P0),e(Pe,Sm),e(Sm,J0),e(Pe,C0),e(xe,F0),e(xe,Je),e(Je,qm),e(qm,N0),e(Je,z0),e(Je,Um),e(Um,O0),e(Je,W0),e(Je,Dm),e(Dm,R0),e(Je,L0),e(Je,jm),e(jm,B0),e(Je,G0),e(A,Z0),e(A,wr),_(En,wr,null),e(wr,V0),e(wr,An),e(An,X0),e(An,Pm),e(Pm,Y0),e(An,H0),e(A,Q0),e(A,Tr),_($n,Tr,null),e(Tr,K0),e(Tr,kn),e(kn,eE),e(kn,Jm),e(Jm,tE),e(kn,oE),e(A,rE),e(A,Tt),_(xn,Tt,null),e(Tt,aE),e(Tt,Cm),e(Cm,nE),e(Tt,sE),e(Tt,Fm),e(Fm,iE),e(A,lE),e(A,Er),_(Mn,Er,null),e(Er,dE),e(Er,Nm),e(Nm,cE),e(A,pE),e(A,Ar),_(In,Ar,null),e(Ar,mE),e(Ar,Sn),e(Sn,hE),e(Sn,zm),e(zm,uE),e(Sn,fE),e(A,gE),e(A,Et),_(qn,Et,null),e(Et,_E),e(Et,Om),e(Om,bE),e(Et,vE),e(Et,Un),e(Un,yE),e(Un,Wm),e(Wm,wE),e(Un,TE),e(A,EE),e(A,At),_(Dn,At,null),e(At,AE),e(At,Rm),e(Rm,$E),e(At,kE),e(At,it),e(it,xE),e(it,Lm),e(Lm,ME),e(it,IE),e(it,Bm),e(Bm,SE),e(it,qE),e(it,Gm),e(Gm,UE),e(it,DE),e(A,jE),e(A,$r),_(jn,$r,null),e($r,PE),e($r,Zm),e(Zm,JE),e(A,CE),e(A,Ce),_(Pn,Ce,null),e(Ce,FE),e(Ce,Vm),e(Vm,NE),e(Ce,zE),e(Ce,Jn),e(Jn,OE),e(Jn,Xm),e(Xm,WE),e(Jn,RE),e(Ce,LE),e(Ce,Ym),e(Ym,BE),e(A,GE),e(A,$t),_(Cn,$t,null),e($t,ZE),e($t,wo),e(wo,VE),e(wo,Hm),e(Hm,XE),e(wo,YE),e(wo,Qm),e(Qm,HE),e(wo,QE),e($t,KE),e($t,Km),e(Km,e4),e(A,t4),e(A,kr),_(Fn,kr,null),e(kr,o4),e(kr,Nn),e(Nn,r4),e(Nn,ld),e(ld,a4),e(Nn,n4),e(A,s4),e(A,kt),_(zn,kt,null),e(kt,i4),e(kt,On),e(On,l4),e(On,eh),e(eh,d4),e(On,c4),e(kt,p4),e(kt,th),e(th,m4),e(A,h4),e(A,xr),_(Wn,xr,null),e(xr,u4),e(xr,oh),e(oh,f4),e(A,g4),e(A,xt),_(Rn,xt,null),e(xt,_4),e(xt,Ln),e(Ln,b4),e(Ln,rh),e(rh,v4),e(Ln,y4),e(xt,w4),e(xt,ah),e(ah,T4),e(A,E4),e(A,Fe),_(Bn,Fe,null),e(Fe,A4),e(Fe,Gn),e(Gn,$4),e(Gn,nh),e(nh,k4),e(Gn,x4),e(Fe,M4),e(Fe,To),e(To,I4),e(To,sh),e(sh,S4),e(To,q4),e(To,ih),e(ih,U4),e(To,D4),e(Fe,j4),e(Fe,lh),e(lh,P4),e(A,J4),e(A,Mt),_(Zn,Mt,null),e(Mt,C4),e(Mt,Me),e(Me,F4),e(Me,dh),e(dh,N4),e(Me,z4),e(Me,ch),e(ch,O4),e(Me,W4),e(Me,ph),e(ph,R4),e(Me,L4),e(Me,mh),e(mh,B4),e(Me,G4),e(Mt,Z4),_(Mr,Mt,null),e(A,V4),e(A,It),_(Vn,It,null),e(It,X4),e(It,Xn),e(Xn,Y4),e(Xn,hh),e(hh,H4),e(Xn,Q4),e(It,K4),_(Ir,It,null),e(A,eA),e(A,Sr),_(Yn,Sr,null),e(Sr,tA),e(Sr,Hn),e(Hn,oA),e(Hn,uh),e(uh,rA),e(Hn,aA),e(A,nA),e(A,qr),_(Qn,qr,null),e(qr,sA),e(qr,fh),e(fh,iA),e(A,lA),e(A,Ur),_(Kn,Ur,null),e(Ur,dA),e(Ur,es),e(es,cA),e(es,gh),e(gh,pA),e(es,mA),e(A,hA),e(A,St),_(ts,St,null),e(St,uA),e(St,os),e(os,fA),e(os,_h),e(_h,gA),e(os,_A),e(St,bA),e(St,bh),e(bh,vA),e(A,yA),e(A,P),_(rs,P,null),e(P,wA),e(P,vh),e(vh,TA),e(P,EA),e(P,yh),e(yh,AA),e(P,$A),e(P,wh),e(wh,kA),e(P,xA),e(P,Eo),e(Eo,MA),e(Eo,Th),e(Th,IA),e(Eo,SA),e(Eo,Eh),e(Eh,qA),e(Eo,UA),e(P,DA),_(Dr,P,null),e(P,jA),e(P,Ah),e(Ah,$h),e($h,PA),e(P,JA),e(P,lt),e(lt,Ie),e(Ie,CA),e(Ie,kh),e(kh,FA),e(Ie,NA),e(Ie,xh),e(xh,zA),e(Ie,OA),e(Ie,Mh),e(Mh,WA),e(Ie,RA),e(Ie,Ih),e(Ih,LA),e(Ie,BA),e(lt,GA),e(lt,Ao),e(Ao,ZA),e(Ao,Sh),e(Sh,VA),e(Ao,XA),e(Ao,qh),e(qh,YA),e(Ao,HA),e(lt,QA),e(lt,dd),e(dd,Uh),e(Uh,KA),e(dd,e$),e(lt,t$),e(lt,qt),e(qt,Dh),e(Dh,o$),e(qt,r$),e(qt,jh),e(jh,a$),e(qt,n$),e(qt,Ph),e(Ph,s$),e(qt,i$),e(P,l$),e(P,Jh),e(Jh,d$),e(P,c$),e(P,Ch),e(Ch,p$),e(P,m$),e(P,as),e(as,h$),e(as,Fh),e(Fh,u$),e(as,f$),e(P,g$),e(P,dt),e(dt,_$),e(dt,Nh),e(Nh,b$),e(dt,v$),e(dt,zh),e(zh,y$),e(dt,w$),e(dt,Oh),e(Oh,T$),e(dt,E$),e(P,A$),e(P,fe),e(fe,$$),e(fe,cd),e(cd,k$),e(fe,x$),e(fe,Wh),e(Wh,M$),e(fe,I$),e(fe,Rh),e(Rh,S$),e(fe,q$),e(fe,Lh),e(Lh,U$),e(fe,D$),e(fe,Bh),e(Bh,j$),e(fe,P$),e(P,J$),e(P,Z),e(Z,C$),e(Z,Gh),e(Gh,F$),e(Z,N$),e(Z,Zh),e(Zh,z$),e(Z,O$),e(Z,Vh),e(Vh,W$),e(Z,R$),e(Z,Xh),e(Xh,L$),e(Z,B$),e(Z,ns),e(ns,G$),e(Z,Z$),e(Z,Yh),e(Yh,V$),e(Z,X$),e(Z,Hh),e(Hh,Y$),e(Z,H$),e(Z,Qh),e(Qh,Q$),e(Z,K$),e(Z,Kh),e(Kh,e3),e(Z,t3),e(Z,eu),e(eu,o3),e(Z,r3),e(P,a3),e(P,Se),e(Se,n3),e(Se,pd),e(pd,s3),e(Se,i3),e(Se,tu),e(tu,l3),e(Se,d3),e(Se,md),e(md,c3),e(Se,p3),e(Se,ou),e(ou,m3),e(Se,h3),e(P,u3),e(P,ru),e(ru,f3),e(A,g3),e(A,jr),_(ss,jr,null),e(jr,_3),e(jr,au),e(au,b3),e(A,v3),e(A,Pr),_(is,Pr,null),e(Pr,y3),e(Pr,ls),e(ls,w3),e(ls,nu),e(nu,T3),e(ls,E3),e(A,A3),e(A,Ut),_(ds,Ut,null),e(Ut,$3),e(Ut,cs),e(cs,k3),e(cs,su),e(su,x3),e(cs,M3),e(Ut,I3),e(Ut,ps),e(ps,S3),e(ps,iu),e(iu,q3),e(ps,U3),e(A,D3),e(A,de),_(ms,de,null),e(de,j3),e(de,lu),e(lu,P3),e(de,J3),e(de,hs),e(hs,C3),e(hs,du),e(du,F3),e(hs,N3),e(de,z3),_(Jr,de,null),e(de,O3),e(de,us),e(us,W3),e(us,cu),e(cu,R3),e(us,L3),e(de,B3),e(de,$o),e($o,ko),e(ko,G3),e(ko,pu),e(pu,Z3),e(ko,V3),e(ko,mu),e(mu,X3),e(ko,Y3),e($o,H3),e($o,xo),e(xo,Q3),e(xo,hu),e(hu,K3),e(xo,ek),e(xo,uu),e(uu,tk),e(xo,ok),e($o,rk),e($o,Mo),e(Mo,ak),e(Mo,fu),e(fu,nk),e(Mo,sk),e(Mo,gu),e(gu,ik),e(Mo,lk),e(A,dk),e(A,Dt),_(fs,Dt,null),e(Dt,ck),e(Dt,Io),e(Io,pk),e(Io,_u),e(_u,mk),e(Io,hk),e(Io,bu),e(bu,uk),e(Io,fk),e(Dt,gk),e(Dt,vu),e(vu,_k),e(A,bk),e(A,jt),_(gs,jt,null),e(jt,vk),e(jt,So),e(So,yk),e(So,yu),e(yu,wk),e(So,Tk),e(So,wu),e(wu,Ek),e(So,Ak),e(jt,$k),e(jt,Tu),e(Tu,kk),e(A,xk),e(A,Cr),_(_s,Cr,null),e(Cr,Mk),e(Cr,ct),e(ct,Ik),e(ct,Eu),e(Eu,Sk),e(ct,qk),e(ct,Au),e(Au,Uk),e(ct,Dk),e(ct,$u),e($u,jk),e(ct,Pk),e(A,Jk),e(A,Fr),_(bs,Fr,null),e(Fr,Ck),e(Fr,vs),e(vs,Fk),e(vs,ku),e(ku,Nk),e(vs,zk),e(A,Ok),e(A,Ne),_(ys,Ne,null),e(Ne,Wk),e(Ne,ws),e(ws,Rk),e(ws,xu),e(xu,Lk),e(ws,Bk),e(Ne,Gk),e(Ne,Mu),e(Mu,Zk),e(Ne,Vk),e(Ne,Ts),e(Ts,Xk),e(Ts,hd),e(hd,Yk),e(Ts,Hk),e(A,Qk),e(A,Pt),_(Es,Pt,null),e(Pt,Kk),e(Pt,As),e(As,ex),e(As,Iu),e(Iu,tx),e(As,ox),e(Pt,rx),e(Pt,Su),e(Su,ax),e(A,nx),e(A,Jt),_($s,Jt,null),e(Jt,sx),e(Jt,qu),e(qu,ix),e(Jt,lx),e(Jt,Uu),e(Uu,dx),e(A,cx),e(A,Nr),_(ks,Nr,null),e(Nr,px),e(Nr,Du),e(Du,mx),e(A,hx),e(A,Ct),_(xs,Ct,null),e(Ct,ux),e(Ct,ju),e(ju,fx),e(Ct,gx),e(Ct,Pu),e(Pu,_x),p(t,Fv,c),p(t,qo,c),e(qo,zr),e(zr,Ju),_(Ms,Ju,null),e(qo,bx),e(qo,Cu),e(Cu,vx),p(t,Nv,c),p(t,pt,c),_(Is,pt,null),e(pt,yx),e(pt,ze),_(Ss,ze,null),e(ze,wx),e(ze,Fu),e(Fu,Tx),e(ze,Ex),e(ze,qs),e(qs,Ax),e(qs,Nu),e(Nu,$x),e(qs,kx),e(ze,xx),e(ze,zu),e(zu,Mx),e(pt,Ix),e(pt,ce),_(Us,ce,null),e(ce,Sx),e(ce,Ou),e(Ou,qx),e(ce,Ux),e(ce,Ds),e(Ds,Dx),e(Ds,Wu),e(Wu,jx),e(Ds,Px),e(ce,Jx),_(Or,ce,null),e(ce,Cx),e(ce,js),e(js,Fx),e(js,Ru),e(Ru,Nx),e(js,zx),e(ce,Ox),e(ce,Uo),e(Uo,Do),e(Do,Wx),e(Do,Lu),e(Lu,Rx),e(Do,Lx),e(Do,Bu),e(Bu,Bx),e(Do,Gx),e(Uo,Zx),e(Uo,jo),e(jo,Vx),e(jo,Gu),e(Gu,Xx),e(jo,Yx),e(jo,Zu),e(Zu,Hx),e(jo,Qx),e(Uo,Kx),e(Uo,Po),e(Po,eM),e(Po,Vu),e(Vu,tM),e(Po,oM),e(Po,Xu),e(Xu,rM),e(Po,aM),p(t,zv,c),p(t,Jo,c),e(Jo,Wr),e(Wr,Yu),_(Ps,Yu,null),e(Jo,nM),e(Jo,Hu),e(Hu,sM),p(t,Ov,c),p(t,q,c),_(Js,q,null),e(q,iM),e(q,Cs),e(Cs,lM),e(Cs,Qu),e(Qu,dM),e(Cs,cM),e(q,pM),e(q,Co),e(Co,mM),e(Co,ud),e(ud,hM),e(Co,uM),e(Co,Fs),e(Fs,fM),e(Co,gM),e(q,_M),e(q,ve),_(Ns,ve,null),e(ve,bM),e(ve,Ku),e(Ku,vM),e(ve,yM),e(ve,Fo),e(Fo,wM),e(Fo,ef),e(ef,TM),e(Fo,EM),e(Fo,tf),e(tf,AM),e(Fo,$M),e(ve,kM),e(ve,No),e(No,xM),e(No,of),e(of,MM),e(No,IM),e(No,rf),e(rf,SM),e(No,qM),e(ve,UM),e(ve,zs),e(zs,DM),e(zs,af),e(af,jM),e(zs,PM),e(q,JM),e(q,Rr),_(Os,Rr,null),e(Rr,CM),e(Rr,nf),e(nf,FM),e(q,NM),e(q,Ft),_(Ws,Ft,null),e(Ft,zM),e(Ft,sf),e(sf,OM),e(Ft,WM),e(Ft,zo),e(zo,RM),e(zo,lf),e(lf,LM),e(zo,BM),e(zo,df),e(df,GM),e(zo,ZM),e(q,VM),e(q,Nt),_(Rs,Nt,null),e(Nt,XM),e(Nt,cf),e(cf,YM),e(Nt,HM),_(Lr,Nt,null),e(q,QM),e(q,zt),_(Ls,zt,null),e(zt,KM),e(zt,pf),e(pf,e5),e(zt,t5),_(Br,zt,null),e(q,o5),e(q,Ot),_(Bs,Ot,null),e(Ot,r5),e(Ot,mf),e(mf,a5),e(Ot,n5),_(Gr,Ot,null),e(q,s5),e(q,Wt),_(Gs,Wt,null),e(Wt,i5),e(Wt,hf),e(hf,l5),e(Wt,d5),_(Zr,Wt,null),e(q,c5),e(q,Rt),_(Zs,Rt,null),e(Rt,p5),e(Rt,uf),e(uf,m5),e(Rt,h5),_(Vr,Rt,null),e(q,u5),e(q,Oe),_(Vs,Oe,null),e(Oe,f5),e(Oe,ff),e(ff,g5),e(Oe,_5),_(Xr,Oe,null),e(Oe,b5),_(Yr,Oe,null),e(q,v5),e(q,Lt),_(Xs,Lt,null),e(Lt,y5),e(Lt,gf),e(gf,w5),e(Lt,T5),_(Hr,Lt,null),e(q,E5),e(q,We),_(Ys,We,null),e(We,A5),e(We,_f),e(_f,$5),e(We,k5),_(Qr,We,null),e(We,x5),_(Kr,We,null),e(q,M5),e(q,Re),_(Hs,Re,null),e(Re,I5),e(Re,bf),e(bf,S5),e(Re,q5),_(ea,Re,null),e(Re,U5),_(ta,Re,null),e(q,D5),e(q,oa),_(Qs,oa,null),e(oa,j5),e(oa,Ks),e(Ks,P5),e(Ks,vf),e(vf,J5),e(Ks,C5),e(q,F5),e(q,ra),_(ei,ra,null),e(ra,N5),e(ra,yf),e(yf,z5),e(q,O5),e(q,aa),_(ti,aa,null),e(aa,W5),e(aa,wf),e(wf,R5),p(t,Wv,c),p(t,Oo,c),e(Oo,na),e(na,Tf),_(oi,Tf,null),e(Oo,L5),e(Oo,Ef),e(Ef,B5),p(t,Rv,c),p(t,qe,c),_(ri,qe,null),e(qe,G5),e(qe,ai),e(ai,Z5),e(ai,Af),e(Af,V5),e(ai,X5),e(qe,Y5),e(qe,Wo),e(Wo,H5),e(Wo,fd),e(fd,Q5),e(Wo,K5),e(Wo,ni),e(ni,e9),e(Wo,t9),e(qe,o9),e(qe,sa),_(si,sa,null),e(sa,r9),e(sa,Ro),e(Ro,a9),e(Ro,$f),e($f,n9),e(Ro,s9),e(Ro,kf),e(kf,i9),e(Ro,l9),p(t,Lv,c),p(t,Lo,c),e(Lo,ia),e(ia,xf),_(ii,xf,null),e(Lo,d9),e(Lo,Mf),e(Mf,c9),p(t,Bv,c),p(t,ye,c),e(ye,p9),e(ye,gd),e(gd,m9),e(ye,h9),e(ye,If),e(If,u9),e(ye,f9),e(ye,_d),e(_d,g9),e(ye,_9),e(ye,Sf),e(Sf,b9),e(ye,v9),p(t,Gv,c),p(t,la,c),e(la,y9),e(la,bd),e(bd,w9),e(la,T9),p(t,Zv,c),p(t,da,c),e(da,vd),e(vd,qf),e(qf,E9),e(vd,A9),e(da,$9),e(da,yd),e(yd,Uf),e(Uf,k9),e(yd,x9),p(t,Vv,c),p(t,Le,c),e(Le,M9),e(Le,Df),e(Df,I9),e(Le,S9),e(Le,jf),e(jf,q9),e(Le,U9),e(Le,wd),e(wd,D9),e(Le,j9),p(t,Xv,c),p(t,ca,c),e(ca,pa),e(pa,Pf),e(Pf,P9),e(pa,J9),e(pa,Jf),e(Jf,C9),e(pa,F9),e(ca,N9),e(ca,Td),e(Td,Cf),e(Cf,z9),e(Td,O9),p(t,Yv,c),p(t,Bo,c),e(Bo,ma),e(ma,Ff),_(li,Ff,null),e(Bo,W9),e(Bo,Nf),e(Nf,R9),p(t,Hv,c),p(t,Be,c),e(Be,L9),e(Be,Ed),e(Ed,B9),e(Be,G9),e(Be,zf),e(zf,Z9),e(Be,V9),e(Be,Of),e(Of,X9),e(Be,Y9),p(t,Qv,c),p(t,Bt,c),e(Bt,H9),e(Bt,Wf),e(Wf,Q9),e(Bt,K9),e(Bt,Ad),e(Ad,eI),e(Bt,tI),p(t,Kv,c),p(t,ha,c),e(ha,$d),e($d,Rf),e(Rf,oI),e($d,rI),e(ha,aI),e(ha,kd),e(kd,Lf),e(Lf,nI),e(kd,sI),p(t,ey,c),p(t,Ge,c),e(Ge,iI),e(Ge,xd),e(xd,lI),e(Ge,dI),e(Ge,Bf),e(Bf,cI),e(Ge,pI),e(Ge,Gf),e(Gf,mI),e(Ge,hI),p(t,ty,c),p(t,pe,c),e(pe,uI),e(pe,Md),e(Md,fI),e(pe,gI),e(pe,Zf),e(Zf,_I),e(pe,bI),e(pe,Vf),e(Vf,vI),e(pe,yI),e(pe,Xf),e(Xf,wI),e(pe,TI),e(pe,Id),e(Id,EI),e(pe,AI),p(t,oy,c),p(t,Sd,c),e(Sd,$I),p(t,ry,c),_(di,t,c),p(t,ay,c),p(t,qd,c),e(qd,kI),p(t,ny,c),_(ci,t,c),p(t,sy,c),p(t,Ud,c),e(Ud,xI),p(t,iy,c),_(pi,t,c),p(t,ly,c),p(t,Dd,c),e(Dd,MI),p(t,dy,c),p(t,jd,c),e(jd,II),p(t,cy,c),_(mi,t,c),p(t,py,c),p(t,ua,c),e(ua,SI),e(ua,Yf),e(Yf,qI),e(ua,UI),p(t,my,c),p(t,Go,c),e(Go,fa),e(fa,Hf),_(hi,Hf,null),e(Go,DI),e(Go,Qf),e(Qf,jI),p(t,hy,c),p(t,we,c),e(we,PI),e(we,Pd),e(Pd,JI),e(we,CI),e(we,Kf),e(Kf,FI),e(we,NI),e(we,eg),e(eg,zI),e(we,OI),e(we,tg),e(tg,WI),e(we,RI),p(t,uy,c),p(t,Gt,c),e(Gt,LI),e(Gt,ui),e(ui,BI),e(Gt,GI),e(Gt,og),e(og,ZI),e(Gt,VI),p(t,fy,c),p(t,Zo,c),e(Zo,ga),e(ga,rg),_(fi,rg,null),e(Zo,XI),e(Zo,ag),e(ag,YI),p(t,gy,c),p(t,Jd,c),e(Jd,HI),p(t,_y,c),p(t,_a,c),e(_a,QI),e(_a,gi),e(gi,ng),e(ng,KI),e(_a,eS),p(t,by,c),_(_i,t,c),p(t,vy,c),p(t,Zt,c),e(Zt,tS),e(Zt,bi),e(bi,sg),e(sg,oS),e(Zt,rS),e(Zt,vi),e(vi,ig),e(ig,aS),e(Zt,nS),p(t,yy,c),_(yi,t,c),p(t,wy,c),_(wi,t,c),p(t,Ty,c),p(t,ba,c),e(ba,sS),e(ba,Cd),e(Cd,iS),e(ba,lS),p(t,Ey,c),p(t,Fd,c),e(Fd,dS),p(t,Ay,c),p(t,Nd,c),e(Nd,cS),p(t,$y,c),p(t,zd,c),e(zd,lg),e(lg,dg),e(dg,pS),p(t,ky,c),p(t,va,c),e(va,mS),e(va,cg),e(cg,hS),e(va,uS),p(t,xy,c),p(t,Od,c),e(Od,fS),p(t,My,c),_(Ti,t,c),p(t,Iy,c),p(t,Vt,c),e(Vt,gS),e(Vt,pg),e(pg,_S),e(Vt,bS),e(Vt,mg),e(mg,vS),e(Vt,yS),p(t,Sy,c),p(t,Wd,c),e(Wd,wS),p(t,qy,c),_(Ei,t,c),p(t,Uy,c),p(t,Xt,c),e(Xt,TS),e(Xt,hg),e(hg,ES),e(Xt,AS),e(Xt,ug),e(ug,$S),e(Xt,kS),p(t,Dy,c),p(t,Yt,c),e(Yt,xS),e(Yt,fg),e(fg,MS),e(Yt,IS),e(Yt,Ai),e(Ai,gg),e(gg,SS),e(Yt,qS),p(t,jy,c),_($i,t,c),p(t,Py,c),p(t,Rd,c),e(Rd,US),p(t,Jy,c),_(ki,t,c),p(t,Cy,c),p(t,Ld,c),e(Ld,DS),p(t,Fy,c),_(xi,t,c),p(t,Ny,c),p(t,Bd,c),e(Bd,jS),p(t,zy,c),p(t,Gd,c),e(Gd,_g),e(_g,bg),e(bg,PS),p(t,Oy,c),p(t,ya,c),e(ya,JS),e(ya,vg),e(vg,CS),e(ya,FS),p(t,Wy,c),p(t,Zd,c),e(Zd,Mi),e(Mi,NS),e(Mi,yg),e(yg,zS),e(Mi,OS),p(t,Ry,c),_(Ii,t,c),p(t,Ly,c),p(t,Si,c),e(Si,wg),e(wg,WS),p(t,By,c),_(qi,t,c),p(t,Gy,c),p(t,Ht,c),e(Ht,RS),e(Ht,Tg),e(Tg,LS),e(Ht,BS),e(Ht,Eg),e(Eg,GS),e(Ht,ZS),p(t,Zy,c),p(t,Vd,c),e(Vd,VS),p(t,Vy,c),_(Ui,t,c),p(t,Xy,c),p(t,Xd,c),e(Xd,XS),p(t,Yy,c),p(t,wa,c),e(wa,YS),e(wa,Ag),e(Ag,HS),e(wa,QS),p(t,Hy,c),p(t,Vo,c),e(Vo,Ta),e(Ta,$g),_(Di,$g,null),e(Vo,KS),e(Vo,kg),e(kg,eq),p(t,Qy,c),p(t,Ea,c),e(Ea,tq),e(Ea,Yd),e(Yd,oq),e(Ea,rq),p(t,Ky,c),p(t,Ze,c),e(Ze,aq),e(Ze,ji),e(ji,nq),e(Ze,sq),e(Ze,Pi),e(Pi,iq),e(Ze,lq),e(Ze,Ji),e(Ji,dq),e(Ze,cq),p(t,e1,c),p(t,Aa,c),e(Aa,pq),e(Aa,Hd),e(Hd,mq),e(Aa,hq),p(t,t1,c),p(t,Qd,c),p(t,o1,c),p(t,Xo,c),e(Xo,$a),e($a,xg),_(Ci,xg,null),e(Xo,uq),e(Xo,Mg),e(Mg,fq),p(t,r1,c),p(t,Kd,c),e(Kd,gq),p(t,a1,c),p(t,ka,c),e(ka,_q),e(ka,Fi),e(Fi,bq),e(ka,vq),p(t,n1,c),p(t,ec,c),e(ec,yq),p(t,s1,c),_(Ni,t,c),p(t,i1,c),p(t,tc,c),e(tc,wq),p(t,l1,c),p(t,Qt,c),e(Qt,Tq),e(Qt,Ig),e(Ig,Eq),e(Qt,Aq),e(Qt,Sg),e(Sg,$q),e(Qt,kq),p(t,d1,c),p(t,Yo,c),e(Yo,xa),e(xa,qg),_(zi,qg,null),e(Yo,xq),e(Yo,Ug),e(Ug,Mq),p(t,c1,c),p(t,oc,c),e(oc,Iq),p(t,p1,c),p(t,Ve,c),e(Ve,Sq),e(Ve,Dg),e(Dg,qq),e(Ve,Uq),e(Ve,jg),e(jg,Dq),e(Ve,jq),e(Ve,Pg),e(Pg,Pq),e(Ve,Jq),p(t,m1,c),p(t,Kt,c),e(Kt,Cq),e(Kt,Jg),e(Jg,Fq),e(Kt,Nq),e(Kt,Cg),e(Cg,zq),e(Kt,Oq),p(t,h1,c),_(Oi,t,c),p(t,u1,c),p(t,Ma,c),e(Ma,Wq),e(Ma,Wi),e(Wi,Rq),e(Ma,Lq),p(t,f1,c),p(t,Ho,c),e(Ho,Ia),e(Ia,Fg),_(Ri,Fg,null),e(Ho,Bq),e(Ho,Ng),e(Ng,Gq),p(t,g1,c),p(t,rc,c),e(rc,Zq),p(t,_1,c),_(Li,t,c),p(t,b1,c),p(t,eo,c),e(eo,Vq),e(eo,zg),e(zg,Xq),e(eo,Yq),e(eo,Og),e(Og,Hq),e(eo,Qq),p(t,v1,c),p(t,ac,c),e(ac,Kq),p(t,y1,c),_(Bi,t,c),p(t,w1,c),p(t,nc,c),e(nc,eU),p(t,T1,c),p(t,Sa,c),e(Sa,tU),e(Sa,Wg),e(Wg,oU),e(Sa,rU),p(t,E1,c),p(t,mt,c),e(mt,Rg),e(Rg,aU),e(mt,nU),e(mt,Lg),e(Lg,sU),e(mt,iU),e(mt,Bg),e(Bg,lU),e(mt,dU),p(t,A1,c),p(t,sc,c),e(sc,cU),p(t,$1,c),_(Gi,t,c),p(t,k1,c),p(t,ic,c),e(ic,pU),p(t,x1,c),p(t,Xe,c),e(Xe,mU),e(Xe,Gg),e(Gg,hU),e(Xe,uU),e(Xe,Zg),e(Zg,fU),e(Xe,gU),e(Xe,Vg),e(Vg,_U),e(Xe,bU),p(t,M1,c),p(t,Qo,c),e(Qo,qa),e(qa,Xg),_(Zi,Xg,null),e(Qo,vU),e(Qo,Yg),e(Yg,yU),p(t,I1,c),p(t,to,c),e(to,wU),e(to,Hg),e(Hg,TU),e(to,EU),e(to,Qg),e(Qg,AU),e(to,$U),p(t,S1,c),p(t,lc,c),e(lc,kU),p(t,q1,c),p(t,dc,c),e(dc,xU),p(t,U1,c),p(t,Ua,c),e(Ua,MU),e(Ua,Kg),e(Kg,IU),e(Ua,SU),p(t,D1,c),_(Vi,t,c),p(t,j1,c),p(t,te,c),e(te,qU),e(te,e_),e(e_,UU),e(te,DU),e(te,t_),e(t_,jU),e(te,PU),e(te,o_),e(o_,JU),e(te,CU),e(te,r_),e(r_,FU),e(te,NU),e(te,a_),e(a_,zU),e(te,OU),e(te,n_),e(n_,WU),e(te,RU),p(t,P1,c),p(t,cc,c),e(cc,LU),p(t,J1,c),p(t,Ko,c),e(Ko,Da),e(Da,s_),_(Xi,s_,null),e(Ko,BU),e(Ko,i_),e(i_,GU),p(t,C1,c),p(t,ja,c),e(ja,ZU),e(ja,Yi),e(Yi,VU),e(ja,XU),p(t,F1,c),p(t,Hi,c),e(Hi,l_),e(l_,YU),e(Hi,HU),p(t,N1,c),p(t,Qi,c),e(Qi,d_),e(d_,QU),e(Qi,KU),p(t,z1,c),p(t,me,c),e(me,c_),e(c_,Ki),e(Ki,eD),e(Ki,p_),e(p_,tD),e(Ki,oD),e(me,rD),e(me,el),e(el,pc),e(pc,m_),e(m_,aD),e(pc,nD),e(el,sD),e(el,er),e(er,tl),e(tl,iD),e(tl,h_),e(h_,lD),e(tl,dD),e(er,cD),e(er,ol),e(ol,pD),e(ol,u_),e(u_,mD),e(ol,hD),e(er,uD),e(er,rl),e(rl,fD),e(rl,f_),e(f_,gD),e(rl,_D),e(me,bD),e(me,g_),e(g_,tr),e(tr,vD),e(tr,__),e(__,yD),e(tr,wD),e(tr,b_),e(b_,TD),e(tr,ED),e(me,AD),e(me,v_),e(v_,ht),e(ht,$D),e(ht,y_),e(y_,kD),e(ht,xD),e(ht,w_),e(w_,MD),e(ht,ID),e(ht,T_),e(T_,SD),e(ht,qD),e(me,UD),e(me,E_),e(E_,or),e(or,DD),e(or,A_),e(A_,jD),e(or,PD),e(or,$_),e($_,JD),e(or,CD),e(me,FD),e(me,al),e(al,ut),e(ut,ND),e(ut,k_),e(k_,zD),e(ut,OD),e(ut,x_),e(x_,WD),e(ut,RD),e(ut,M_),e(M_,LD),e(ut,BD),e(al,GD),e(al,ft),e(ft,mc),e(mc,ZD),e(mc,nl),e(nl,ge),e(ge,VD),e(ge,I_),e(I_,XD),e(ge,YD),e(ge,S_),e(S_,HD),e(ge,QD),e(ge,q_),e(q_,KD),e(ge,ej),e(ge,U_),e(U_,tj),e(ge,oj),e(ge,D_),e(D_,rj),e(ge,aj),e(nl,nj),e(nl,sl),e(sl,sj),e(sl,j_),e(j_,ij),e(sl,lj),e(ft,dj),e(ft,gt),e(gt,P_),e(P_,cj),e(gt,pj),e(gt,J_),e(J_,mj),e(gt,hj),e(gt,C_),e(C_,uj),e(gt,fj),e(gt,F_),e(F_,gj),e(ft,_j),e(ft,Pa),e(Pa,N_),e(N_,bj),e(Pa,vj),e(Pa,z_),e(z_,yj),e(Pa,wj),e(ft,Tj),e(ft,Ja),e(Ja,O_),e(O_,Ej),e(Ja,Aj),e(Ja,W_),e(W_,$j),e(Ja,kj),p(t,O1,c),p(t,hc,c),e(hc,R_),e(R_,xj),p(t,W1,c),p(t,uc,c),e(uc,Ye),e(Ye,Mj),e(Ye,L_),e(L_,Ij),e(Ye,Sj),e(Ye,B_),e(B_,qj),e(Ye,Uj),e(Ye,Dj),e(Ye,jj),e(Ye,il),e(il,Pj),p(t,R1,c),p(t,rr,c),e(rr,Ca),e(Ca,G_),_(ll,G_,null),e(rr,Jj),e(rr,Z_),e(Z_,Cj),p(t,L1,c),p(t,oo,c),e(oo,Fj),e(oo,dl),e(dl,Nj),e(oo,zj),e(oo,cl),e(cl,Oj),e(oo,Wj),p(t,B1,c),p(t,pl,c),e(pl,V_),e(V_,Rj),e(pl,Lj),p(t,G1,c),p(t,ml,c),e(ml,X_),e(X_,Bj),e(ml,Gj),p(t,Z1,c),p(t,ro,c),e(ro,Zj),e(ro,Y_),e(Y_,Vj),e(ro,Xj),e(ro,H_),e(H_,Yj),e(ro,Hj),p(t,V1,c),p(t,He,c),e(He,Fa),e(Fa,Q_),e(Q_,Qj),e(Fa,Kj),e(Fa,K_),e(K_,eP),e(Fa,tP),e(He,oP),e(He,Na),e(Na,eb),e(eb,rP),e(Na,aP),e(Na,hl),e(hl,nP),e(Na,sP),e(He,iP),e(He,Qe),e(Qe,tb),e(tb,lP),e(Qe,dP),e(Qe,ob),e(ob,cP),e(Qe,pP),e(Qe,rb),e(rb,mP),e(Qe,hP),e(Qe,ab),e(ab,uP),e(Qe,fP),e(He,gP),e(He,fc),e(fc,_P),e(fc,ul),e(ul,_e),e(_e,bP),e(_e,nb),e(nb,vP),e(_e,yP),e(_e,sb),e(sb,wP),e(_e,TP),e(_e,ib),e(ib,EP),e(_e,AP),e(_e,lb),e(lb,$P),e(_e,kP),e(_e,db),e(db,xP),e(_e,MP),e(ul,IP),e(ul,fl),e(fl,SP),e(fl,cb),e(cb,qP),e(fl,UP),p(t,X1,c),p(t,ar,c),e(ar,za),e(za,pb),_(gl,pb,null),e(ar,DP),e(ar,mb),e(mb,jP),p(t,Y1,c),p(t,Ke,c),e(Ke,PP),e(Ke,hb),e(hb,JP),e(Ke,CP),e(Ke,_l),e(_l,FP),e(Ke,NP),e(Ke,bl),e(bl,zP),e(Ke,OP),p(t,H1,c),_(Oa,t,c),p(t,Q1,c),p(t,gc,c),e(gc,ub),e(ub,WP),p(t,K1,c),p(t,ao,c),e(ao,fb),e(fb,RP),e(ao,LP),e(ao,gb),e(gb,BP),e(ao,GP),e(ao,_b),e(_b,ZP),p(t,ew,c),p(t,nr,c),e(nr,bb),e(bb,VP),e(nr,XP),e(nr,vl),e(vl,YP),e(nr,HP),p(t,tw,c),p(t,_t,c),e(_t,vb),e(vb,QP),e(_t,KP),e(_t,yb),e(yb,e6),e(_t,t6),e(_t,wb),e(wb,o6),e(_t,r6),p(t,ow,c),_(yl,t,c),p(t,rw,c),p(t,_c,c),e(_c,Tb),e(Tb,a6),p(t,aw,c),p(t,Wa,c),e(Wa,wl),e(wl,n6),e(wl,Eb),e(Eb,s6),e(wl,i6),e(Wa,l6),e(Wa,Ue),e(Ue,d6),e(Ue,Ab),e(Ab,c6),e(Ue,p6),e(Ue,$b),e($b,m6),e(Ue,h6),e(Ue,kb),e(kb,u6),e(Ue,f6),e(Ue,xb),e(xb,g6),e(Ue,_6),p(t,nw,c),p(t,no,c),e(no,b6),e(no,Mb),e(Mb,v6),e(no,y6),e(no,Tl),e(Tl,w6),e(no,T6),p(t,sw,c),p(t,sr,c),e(sr,Ra),e(Ra,Ib),_(El,Ib,null),e(sr,E6),e(sr,Sb),e(Sb,A6),p(t,iw,c),p(t,bc,c),e(bc,$6),p(t,lw,c),p(t,La,c),e(La,qb),e(qb,k6),e(La,x6),e(La,Ub),e(Ub,M6),p(t,dw,c),p(t,vc,c),e(vc,I6),p(t,cw,c),p(t,so,c),e(so,Db),e(Db,io),e(io,S6),e(io,jb),e(jb,q6),e(io,U6),e(io,Pb),e(Pb,D6),e(io,j6),e(io,Jb),e(Jb,P6),e(so,J6),e(so,K),e(K,Al),e(Al,C6),e(Al,Cb),e(Cb,F6),e(Al,N6),e(K,z6),_($l,K,null),e(K,O6),e(K,Fb),e(Fb,W6),e(K,R6),_(kl,K,null),e(K,L6),e(K,Nb),e(Nb,B6),e(K,G6),_(xl,K,null),e(K,Z6),e(K,zb),e(zb,V6),e(K,X6),_(Ml,K,null),e(so,Y6),e(so,Ob),e(Ob,ir),e(ir,H6),e(ir,Wb),e(Wb,Q6),e(ir,K6),e(ir,Rb),e(Rb,eJ),e(ir,tJ),p(t,pw,c),_(Il,t,c),p(t,mw,c),p(t,Sl,c),e(Sl,ql),e(ql,oJ),e(ql,Lb),e(Lb,rJ),e(ql,aJ),p(t,hw,c),_(Ul,t,c),p(t,uw,c),p(t,Ba,c),e(Ba,nJ),e(Ba,Dl),e(Dl,sJ),e(Ba,iJ),p(t,fw,c),p(t,yc,c),e(yc,lJ),p(t,gw,c),p(t,M,c),e(M,dJ),e(M,wc),e(wc,cJ),e(M,Bb),e(M,pJ),e(M,Tc),e(Tc,mJ),e(M,Gb),e(M,hJ),e(M,Ec),e(Ec,uJ),e(M,Zb),e(M,fJ),e(M,Ac),e(Ac,gJ),e(M,Vb),e(M,_J),e(M,$c),e($c,bJ),e(M,Xb),e(M,vJ),e(M,kc),e(kc,yJ),e(M,Yb),e(M,wJ),e(M,xc),e(xc,TJ),e(M,Hb),e(M,EJ),e(M,Mc),e(Mc,AJ),e(M,Qb),e(M,$J),e(M,Ic),e(Ic,kJ),e(M,Kb),e(M,xJ),e(M,Sc),e(Sc,MJ),e(M,ev),e(M,IJ),e(M,qc),e(qc,SJ),e(M,tv),e(M,qJ),e(M,Uc),e(Uc,UJ),e(M,ov),e(M,DJ),e(M,Dc),e(Dc,jJ),e(M,rv),e(M,PJ),e(M,jc),e(jc,JJ),e(M,av),e(M,CJ),e(M,Pc),e(Pc,FJ),e(M,nv),e(M,NJ),e(M,Jc),e(Jc,zJ),e(M,sv),e(M,OJ),e(M,Cc),e(Cc,WJ),e(M,iv),e(M,RJ),e(M,Fc),e(Fc,LJ),e(M,lv),e(M,BJ),e(M,Nc),e(Nc,GJ),e(M,dv),e(M,ZJ),e(M,zc),e(zc,VJ),e(M,cv),e(M,XJ),e(M,Oc),e(Oc,YJ),e(M,pv),e(M,HJ),e(M,Wc),e(Wc,QJ),e(M,mv),e(M,KJ),e(M,Rc),e(Rc,e8),e(M,hv),e(M,t8),_w=!0},p(t,[c]){const jl={};c&2&&(jl.$$scope={dirty:c,ctx:t}),_r.$set(jl);const uv={};c&2&&(uv.$$scope={dirty:c,ctx:t}),Mr.$set(uv);const fv={};c&2&&(fv.$$scope={dirty:c,ctx:t}),Ir.$set(fv);const gv={};c&2&&(gv.$$scope={dirty:c,ctx:t}),Dr.$set(gv);const lr={};c&2&&(lr.$$scope={dirty:c,ctx:t}),Jr.$set(lr);const _v={};c&2&&(_v.$$scope={dirty:c,ctx:t}),Or.$set(_v);const bv={};c&2&&(bv.$$scope={dirty:c,ctx:t}),Lr.$set(bv);const dr={};c&2&&(dr.$$scope={dirty:c,ctx:t}),Br.$set(dr);const vv={};c&2&&(vv.$$scope={dirty:c,ctx:t}),Gr.$set(vv);const yv={};c&2&&(yv.$$scope={dirty:c,ctx:t}),Zr.$set(yv);const Pl={};c&2&&(Pl.$$scope={dirty:c,ctx:t}),Vr.$set(Pl);const wv={};c&2&&(wv.$$scope={dirty:c,ctx:t}),Xr.$set(wv);const Jl={};c&2&&(Jl.$$scope={dirty:c,ctx:t}),Yr.$set(Jl);const Tv={};c&2&&(Tv.$$scope={dirty:c,ctx:t}),Hr.$set(Tv);const B={};c&2&&(B.$$scope={dirty:c,ctx:t}),Qr.$set(B);const Lc={};c&2&&(Lc.$$scope={dirty:c,ctx:t}),Kr.$set(Lc);const Ev={};c&2&&(Ev.$$scope={dirty:c,ctx:t}),ea.$set(Ev);const Bc={};c&2&&(Bc.$$scope={dirty:c,ctx:t}),ta.$set(Bc);const Av={};c&2&&(Av.$$scope={dirty:c,ctx:t}),Oa.$set(Av)},i(t){_w||(b(h.$$.fragment,t),b(_r.$$.fragment,t),b(yn.$$.fragment,t),b(wn.$$.fragment,t),b(Tn.$$.fragment,t),b(En.$$.fragment,t),b($n.$$.fragment,t),b(xn.$$.fragment,t),b(Mn.$$.fragment,t),b(In.$$.fragment,t),b(qn.$$.fragment,t),b(Dn.$$.fragment,t),b(jn.$$.fragment,t),b(Pn.$$.fragment,t),b(Cn.$$.fragment,t),b(Fn.$$.fragment,t),b(zn.$$.fragment,t),b(Wn.$$.fragment,t),b(Rn.$$.fragment,t),b(Bn.$$.fragment,t),b(Zn.$$.fragment,t),b(Mr.$$.fragment,t),b(Vn.$$.fragment,t),b(Ir.$$.fragment,t),b(Yn.$$.fragment,t),b(Qn.$$.fragment,t),b(Kn.$$.fragment,t),b(ts.$$.fragment,t),b(rs.$$.fragment,t),b(Dr.$$.fragment,t),b(ss.$$.fragment,t),b(is.$$.fragment,t),b(ds.$$.fragment,t),b(ms.$$.fragment,t),b(Jr.$$.fragment,t),b(fs.$$.fragment,t),b(gs.$$.fragment,t),b(_s.$$.fragment,t),b(bs.$$.fragment,t),b(ys.$$.fragment,t),b(Es.$$.fragment,t),b($s.$$.fragment,t),b(ks.$$.fragment,t),b(xs.$$.fragment,t),b(Ms.$$.fragment,t),b(Is.$$.fragment,t),b(Ss.$$.fragment,t),b(Us.$$.fragment,t),b(Or.$$.fragment,t),b(Ps.$$.fragment,t),b(Js.$$.fragment,t),b(Ns.$$.fragment,t),b(Os.$$.fragment,t),b(Ws.$$.fragment,t),b(Rs.$$.fragment,t),b(Lr.$$.fragment,t),b(Ls.$$.fragment,t),b(Br.$$.fragment,t),b(Bs.$$.fragment,t),b(Gr.$$.fragment,t),b(Gs.$$.fragment,t),b(Zr.$$.fragment,t),b(Zs.$$.fragment,t),b(Vr.$$.fragment,t),b(Vs.$$.fragment,t),b(Xr.$$.fragment,t),b(Yr.$$.fragment,t),b(Xs.$$.fragment,t),b(Hr.$$.fragment,t),b(Ys.$$.fragment,t),b(Qr.$$.fragment,t),b(Kr.$$.fragment,t),b(Hs.$$.fragment,t),b(ea.$$.fragment,t),b(ta.$$.fragment,t),b(Qs.$$.fragment,t),b(ei.$$.fragment,t),b(ti.$$.fragment,t),b(oi.$$.fragment,t),b(ri.$$.fragment,t),b(si.$$.fragment,t),b(ii.$$.fragment,t),b(li.$$.fragment,t),b(di.$$.fragment,t),b(ci.$$.fragment,t),b(pi.$$.fragment,t),b(mi.$$.fragment,t),b(hi.$$.fragment,t),b(fi.$$.fragment,t),b(_i.$$.fragment,t),b(yi.$$.fragment,t),b(wi.$$.fragment,t),b(Ti.$$.fragment,t),b(Ei.$$.fragment,t),b($i.$$.fragment,t),b(ki.$$.fragment,t),b(xi.$$.fragment,t),b(Ii.$$.fragment,t),b(qi.$$.fragment,t),b(Ui.$$.fragment,t),b(Di.$$.fragment,t),b(Ci.$$.fragment,t),b(Ni.$$.fragment,t),b(zi.$$.fragment,t),b(Oi.$$.fragment,t),b(Ri.$$.fragment,t),b(Li.$$.fragment,t),b(Bi.$$.fragment,t),b(Gi.$$.fragment,t),b(Zi.$$.fragment,t),b(Vi.$$.fragment,t),b(Xi.$$.fragment,t),b(ll.$$.fragment,t),b(gl.$$.fragment,t),b(Oa.$$.fragment,t),b(yl.$$.fragment,t),b(El.$$.fragment,t),b($l.$$.fragment,t),b(kl.$$.fragment,t),b(xl.$$.fragment,t),b(Ml.$$.fragment,t),b(Il.$$.fragment,t),b(Ul.$$.fragment,t),_w=!0)},o(t){v(h.$$.fragment,t),v(_r.$$.fragment,t),v(yn.$$.fragment,t),v(wn.$$.fragment,t),v(Tn.$$.fragment,t),v(En.$$.fragment,t),v($n.$$.fragment,t),v(xn.$$.fragment,t),v(Mn.$$.fragment,t),v(In.$$.fragment,t),v(qn.$$.fragment,t),v(Dn.$$.fragment,t),v(jn.$$.fragment,t),v(Pn.$$.fragment,t),v(Cn.$$.fragment,t),v(Fn.$$.fragment,t),v(zn.$$.fragment,t),v(Wn.$$.fragment,t),v(Rn.$$.fragment,t),v(Bn.$$.fragment,t),v(Zn.$$.fragment,t),v(Mr.$$.fragment,t),v(Vn.$$.fragment,t),v(Ir.$$.fragment,t),v(Yn.$$.fragment,t),v(Qn.$$.fragment,t),v(Kn.$$.fragment,t),v(ts.$$.fragment,t),v(rs.$$.fragment,t),v(Dr.$$.fragment,t),v(ss.$$.fragment,t),v(is.$$.fragment,t),v(ds.$$.fragment,t),v(ms.$$.fragment,t),v(Jr.$$.fragment,t),v(fs.$$.fragment,t),v(gs.$$.fragment,t),v(_s.$$.fragment,t),v(bs.$$.fragment,t),v(ys.$$.fragment,t),v(Es.$$.fragment,t),v($s.$$.fragment,t),v(ks.$$.fragment,t),v(xs.$$.fragment,t),v(Ms.$$.fragment,t),v(Is.$$.fragment,t),v(Ss.$$.fragment,t),v(Us.$$.fragment,t),v(Or.$$.fragment,t),v(Ps.$$.fragment,t),v(Js.$$.fragment,t),v(Ns.$$.fragment,t),v(Os.$$.fragment,t),v(Ws.$$.fragment,t),v(Rs.$$.fragment,t),v(Lr.$$.fragment,t),v(Ls.$$.fragment,t),v(Br.$$.fragment,t),v(Bs.$$.fragment,t),v(Gr.$$.fragment,t),v(Gs.$$.fragment,t),v(Zr.$$.fragment,t),v(Zs.$$.fragment,t),v(Vr.$$.fragment,t),v(Vs.$$.fragment,t),v(Xr.$$.fragment,t),v(Yr.$$.fragment,t),v(Xs.$$.fragment,t),v(Hr.$$.fragment,t),v(Ys.$$.fragment,t),v(Qr.$$.fragment,t),v(Kr.$$.fragment,t),v(Hs.$$.fragment,t),v(ea.$$.fragment,t),v(ta.$$.fragment,t),v(Qs.$$.fragment,t),v(ei.$$.fragment,t),v(ti.$$.fragment,t),v(oi.$$.fragment,t),v(ri.$$.fragment,t),v(si.$$.fragment,t),v(ii.$$.fragment,t),v(li.$$.fragment,t),v(di.$$.fragment,t),v(ci.$$.fragment,t),v(pi.$$.fragment,t),v(mi.$$.fragment,t),v(hi.$$.fragment,t),v(fi.$$.fragment,t),v(_i.$$.fragment,t),v(yi.$$.fragment,t),v(wi.$$.fragment,t),v(Ti.$$.fragment,t),v(Ei.$$.fragment,t),v($i.$$.fragment,t),v(ki.$$.fragment,t),v(xi.$$.fragment,t),v(Ii.$$.fragment,t),v(qi.$$.fragment,t),v(Ui.$$.fragment,t),v(Di.$$.fragment,t),v(Ci.$$.fragment,t),v(Ni.$$.fragment,t),v(zi.$$.fragment,t),v(Oi.$$.fragment,t),v(Ri.$$.fragment,t),v(Li.$$.fragment,t),v(Bi.$$.fragment,t),v(Gi.$$.fragment,t),v(Zi.$$.fragment,t),v(Vi.$$.fragment,t),v(Xi.$$.fragment,t),v(ll.$$.fragment,t),v(gl.$$.fragment,t),v(Oa.$$.fragment,t),v(yl.$$.fragment,t),v(El.$$.fragment,t),v($l.$$.fragment,t),v(kl.$$.fragment,t),v(xl.$$.fragment,t),v(Ml.$$.fragment,t),v(Il.$$.fragment,t),v(Ul.$$.fragment,t),_w=!1},d(t){o(u),t&&o($),t&&o(T),y(h),t&&o(j),t&&o(R),t&&o(L),t&&o(O),t&&o(be),t&&o(je),t&&o(ie),t&&o(re),t&&o(vo),t&&o(W),t&&o(Uv),y(_r,t),t&&o(Dv),t&&o(br),t&&o(jv),y(yn,t),t&&o(Pv),t&&o(wt),t&&o(Jv),t&&o(yo),y(wn),t&&o(Cv),t&&o(A),y(Tn),y(En),y($n),y(xn),y(Mn),y(In),y(qn),y(Dn),y(jn),y(Pn),y(Cn),y(Fn),y(zn),y(Wn),y(Rn),y(Bn),y(Zn),y(Mr),y(Vn),y(Ir),y(Yn),y(Qn),y(Kn),y(ts),y(rs),y(Dr),y(ss),y(is),y(ds),y(ms),y(Jr),y(fs),y(gs),y(_s),y(bs),y(ys),y(Es),y($s),y(ks),y(xs),t&&o(Fv),t&&o(qo),y(Ms),t&&o(Nv),t&&o(pt),y(Is),y(Ss),y(Us),y(Or),t&&o(zv),t&&o(Jo),y(Ps),t&&o(Ov),t&&o(q),y(Js),y(Ns),y(Os),y(Ws),y(Rs),y(Lr),y(Ls),y(Br),y(Bs),y(Gr),y(Gs),y(Zr),y(Zs),y(Vr),y(Vs),y(Xr),y(Yr),y(Xs),y(Hr),y(Ys),y(Qr),y(Kr),y(Hs),y(ea),y(ta),y(Qs),y(ei),y(ti),t&&o(Wv),t&&o(Oo),y(oi),t&&o(Rv),t&&o(qe),y(ri),y(si),t&&o(Lv),t&&o(Lo),y(ii),t&&o(Bv),t&&o(ye),t&&o(Gv),t&&o(la),t&&o(Zv),t&&o(da),t&&o(Vv),t&&o(Le),t&&o(Xv),t&&o(ca),t&&o(Yv),t&&o(Bo),y(li),t&&o(Hv),t&&o(Be),t&&o(Qv),t&&o(Bt),t&&o(Kv),t&&o(ha),t&&o(ey),t&&o(Ge),t&&o(ty),t&&o(pe),t&&o(oy),t&&o(Sd),t&&o(ry),y(di,t),t&&o(ay),t&&o(qd),t&&o(ny),y(ci,t),t&&o(sy),t&&o(Ud),t&&o(iy),y(pi,t),t&&o(ly),t&&o(Dd),t&&o(dy),t&&o(jd),t&&o(cy),y(mi,t),t&&o(py),t&&o(ua),t&&o(my),t&&o(Go),y(hi),t&&o(hy),t&&o(we),t&&o(uy),t&&o(Gt),t&&o(fy),t&&o(Zo),y(fi),t&&o(gy),t&&o(Jd),t&&o(_y),t&&o(_a),t&&o(by),y(_i,t),t&&o(vy),t&&o(Zt),t&&o(yy),y(yi,t),t&&o(wy),y(wi,t),t&&o(Ty),t&&o(ba),t&&o(Ey),t&&o(Fd),t&&o(Ay),t&&o(Nd),t&&o($y),t&&o(zd),t&&o(ky),t&&o(va),t&&o(xy),t&&o(Od),t&&o(My),y(Ti,t),t&&o(Iy),t&&o(Vt),t&&o(Sy),t&&o(Wd),t&&o(qy),y(Ei,t),t&&o(Uy),t&&o(Xt),t&&o(Dy),t&&o(Yt),t&&o(jy),y($i,t),t&&o(Py),t&&o(Rd),t&&o(Jy),y(ki,t),t&&o(Cy),t&&o(Ld),t&&o(Fy),y(xi,t),t&&o(Ny),t&&o(Bd),t&&o(zy),t&&o(Gd),t&&o(Oy),t&&o(ya),t&&o(Wy),t&&o(Zd),t&&o(Ry),y(Ii,t),t&&o(Ly),t&&o(Si),t&&o(By),y(qi,t),t&&o(Gy),t&&o(Ht),t&&o(Zy),t&&o(Vd),t&&o(Vy),y(Ui,t),t&&o(Xy),t&&o(Xd),t&&o(Yy),t&&o(wa),t&&o(Hy),t&&o(Vo),y(Di),t&&o(Qy),t&&o(Ea),t&&o(Ky),t&&o(Ze),t&&o(e1),t&&o(Aa),t&&o(t1),t&&o(Qd),t&&o(o1),t&&o(Xo),y(Ci),t&&o(r1),t&&o(Kd),t&&o(a1),t&&o(ka),t&&o(n1),t&&o(ec),t&&o(s1),y(Ni,t),t&&o(i1),t&&o(tc),t&&o(l1),t&&o(Qt),t&&o(d1),t&&o(Yo),y(zi),t&&o(c1),t&&o(oc),t&&o(p1),t&&o(Ve),t&&o(m1),t&&o(Kt),t&&o(h1),y(Oi,t),t&&o(u1),t&&o(Ma),t&&o(f1),t&&o(Ho),y(Ri),t&&o(g1),t&&o(rc),t&&o(_1),y(Li,t),t&&o(b1),t&&o(eo),t&&o(v1),t&&o(ac),t&&o(y1),y(Bi,t),t&&o(w1),t&&o(nc),t&&o(T1),t&&o(Sa),t&&o(E1),t&&o(mt),t&&o(A1),t&&o(sc),t&&o($1),y(Gi,t),t&&o(k1),t&&o(ic),t&&o(x1),t&&o(Xe),t&&o(M1),t&&o(Qo),y(Zi),t&&o(I1),t&&o(to),t&&o(S1),t&&o(lc),t&&o(q1),t&&o(dc),t&&o(U1),t&&o(Ua),t&&o(D1),y(Vi,t),t&&o(j1),t&&o(te),t&&o(P1),t&&o(cc),t&&o(J1),t&&o(Ko),y(Xi),t&&o(C1),t&&o(ja),t&&o(F1),t&&o(Hi),t&&o(N1),t&&o(Qi),t&&o(z1),t&&o(me),t&&o(O1),t&&o(hc),t&&o(W1),t&&o(uc),t&&o(R1),t&&o(rr),y(ll),t&&o(L1),t&&o(oo),t&&o(B1),t&&o(pl),t&&o(G1),t&&o(ml),t&&o(Z1),t&&o(ro),t&&o(V1),t&&o(He),t&&o(X1),t&&o(ar),y(gl),t&&o(Y1),t&&o(Ke),t&&o(H1),y(Oa,t),t&&o(Q1),t&&o(gc),t&&o(K1),t&&o(ao),t&&o(ew),t&&o(nr),t&&o(tw),t&&o(_t),t&&o(ow),y(yl,t),t&&o(rw),t&&o(_c),t&&o(aw),t&&o(Wa),t&&o(nw),t&&o(no),t&&o(sw),t&&o(sr),y(El),t&&o(iw),t&&o(bc),t&&o(lw),t&&o(La),t&&o(dw),t&&o(vc),t&&o(cw),t&&o(so),y($l),y(kl),y(xl),y(Ml),t&&o(pw),y(Il,t),t&&o(mw),t&&o(Sl),t&&o(hw),y(Ul,t),t&&o(uw),t&&o(Ba),t&&o(fw),t&&o(yc),t&&o(gw),t&&o(M)}}}const tB={local:"trainer",sections:[{local:"transformers.Trainer",title:"Trainer"},{local:"transformers.Seq2SeqTrainer",title:"Seq2SeqTrainer"},{local:"transformers.TrainingArguments",title:"TrainingArguments"},{local:"transformers.Seq2SeqTrainingArguments",title:"Seq2SeqTrainingArguments"},{local:"checkpoints",title:"Checkpoints"},{local:"logging",title:"Logging"},{local:"randomness",title:"Randomness"},{local:"specific-gpus-selection",title:"Specific GPUs Selection"},{local:"trainer-integrations",sections:[{local:"cuda-extension-installation-notes",sections:[{local:"possible-problem-1",title:"Possible problem #1"},{local:"possible-problem-2",title:"Possible problem #2"},{local:"possible-problem-3",title:"Possible problem #3"}],title:"CUDA Extension Installation Notes"},{local:"pytorch-fully-sharded-data-parallel",title:"PyTorch Fully Sharded Data parallel"},{local:"pytorchxla-fully-sharded-data-parallel",title:"PyTorch/XLA Fully Sharded Data parallel"},{local:"using-trainer-for-accelerated-pytorch-training-on-mac",title:"Using Trainer for accelerated PyTorch Training on Mac "}],title:"Trainer Integrations"},{local:"using-accelerate-launcher-with-trainer",title:"Using Accelerate Launcher with Trainer"}],title:"Trainer"};function oB(U){return jL(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class dB extends SL{constructor(u){super();qL(this,u,oB,eB,UL,{})}}export{dB as default,tB as metadata};
