import{S as sE,i as lE,s as iE,w as u,x as v,y as _,q as p,o as g,B as b,F as dE,e as o,t,k as c,c as n,a as s,h as r,d as a,m as d,b as i,g as h,G as e,j as fE,H as hE,I as mE,J as pE,M as gE,v as uE,L as vE}from"../../chunks/vendor-hf-doc-builder.js";import{T as cE}from"../../chunks/Tip-hf-doc-builder.js";import{D as y}from"../../chunks/Docstring-hf-doc-builder.js";import{C as c_}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as $l}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as _E}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function bE(W){let m,D,E,C,A;const k=W[1].default,L=dE(k,W,W[2],null);return{c(){m=o("p"),D=t("Deprecated in "),E=t(W[0]),C=c(),L&&L.c(),this.h()},l(w){m=n(w,"P",{class:!0});var I=s(m);D=r(I,"Deprecated in "),E=r(I,W[0]),I.forEach(a),C=d(w),L&&L.l(w),this.h()},h(){i(m,"class","font-medium")},m(w,I){h(w,m,I),e(m,D),e(m,E),h(w,C,I),L&&L.m(w,I),A=!0},p(w,I){(!A||I&1)&&fE(E,w[0]),L&&L.p&&(!A||I&4)&&hE(L,k,w,w[2],A?pE(k,w[2],I,null):mE(w[2]),null)},i(w){A||(p(L,w),A=!0)},o(w){g(L,w),A=!1},d(w){w&&a(m),w&&a(C),L&&L.d(w)}}}function EE(W){let m,D;return m=new cE({props:{warning:!0,$$slots:{default:[bE]},$$scope:{ctx:W}}}),{c(){u(m.$$.fragment)},l(E){v(m.$$.fragment,E)},m(E,C){_(m,E,C),D=!0},p(E,[C]){const A={};C&5&&(A.$$scope={dirty:C,ctx:E}),m.$set(A)},i(E){D||(p(m.$$.fragment,E),D=!0)},o(E){g(m.$$.fragment,E),D=!1},d(E){b(m,E)}}}function kE(W,m,D){let{$$slots:E={},$$scope:C}=m,{version:A}=m;return W.$$set=k=>{"version"in k&&D(0,A=k.version),"$$scope"in k&&D(2,C=k.$$scope)},[A,E,C]}class $E extends sE{constructor(m){super();lE(this,m,kE,EE,iE,{version:0})}}function CE(W){let m,D,E,C,A,k,L,w;return{c(){m=o("p"),D=t("Setting "),E=o("code"),C=t("WANDB_LOG_MODEL"),A=t(" as "),k=o("code"),L=t("bool"),w=t(" will be deprecated in version 5 of \u{1F917} Transformers.")},l(I){m=n(I,"P",{});var x=s(m);D=r(x,"Setting "),E=n(x,"CODE",{});var Y=s(E);C=r(Y,"WANDB_LOG_MODEL"),Y.forEach(a),A=r(x," as "),k=n(x,"CODE",{});var Fe=s(k);L=r(Fe,"bool"),Fe.forEach(a),w=r(x," will be deprecated in version 5 of \u{1F917} Transformers."),x.forEach(a)},m(I,x){h(I,m,x),e(m,D),e(m,E),e(E,C),e(m,A),e(m,k),e(k,L),e(m,w)},d(I){I&&a(m)}}}function TE(W){let m,D,E,C,A;return C=new c_({props:{code:`class PrinterCallback(TrainerCallback):
    def on_log(self, args, state, control, logs=None, **kwargs):
        _ = logs.pop("total_flos", None)
        if state.is_local_process_zero:
            print(logs)`,highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">PrinterCallback</span>(<span class="hljs-title class_ inherited__">TrainerCallback</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">on_log</span>(<span class="hljs-params">self, args, state, control, logs=<span class="hljs-literal">None</span>, **kwargs</span>):
        _ = logs.pop(<span class="hljs-string">&quot;total_flos&quot;</span>, <span class="hljs-literal">None</span>)
        <span class="hljs-keyword">if</span> state.is_local_process_zero:
            <span class="hljs-built_in">print</span>(logs)`}}),{c(){m=o("p"),D=t("Example:"),E=c(),u(C.$$.fragment)},l(k){m=n(k,"P",{});var L=s(m);D=r(L,"Example:"),L.forEach(a),E=d(k),v(C.$$.fragment,k)},m(k,L){h(k,m,L),e(m,D),h(k,E,L),_(C,k,L),A=!0},p:vE,i(k){A||(p(C.$$.fragment,k),A=!0)},o(k){g(C.$$.fragment,k),A=!1},d(k){k&&a(m),k&&a(E),b(C,k)}}}function wE(W){let m,D,E,C,A,k,L,w;return{c(){m=o("p"),D=t(`In all this class, one step is to be understood as one update step. When using gradient accumulation, one update
step may require several forward and backward passes: if you use `),E=o("code"),C=t("gradient_accumulation_steps=n"),A=t(`, then one update
step requires going through `),k=o("em"),L=t("n"),w=t(" batches.")},l(I){m=n(I,"P",{});var x=s(m);D=r(x,`In all this class, one step is to be understood as one update step. When using gradient accumulation, one update
step may require several forward and backward passes: if you use `),E=n(x,"CODE",{});var Y=s(E);C=r(Y,"gradient_accumulation_steps=n"),Y.forEach(a),A=r(x,`, then one update
step requires going through `),k=n(x,"EM",{});var Fe=s(k);L=r(Fe,"n"),Fe.forEach(a),w=r(x," batches."),x.forEach(a)},m(I,x){h(I,m,x),e(m,D),e(m,E),e(E,C),e(m,A),e(m,k),e(k,L),e(m,w)},d(I){I&&a(m)}}}function yE(W){let m,D,E,C,A,k,L,w,I,x,Y,Fe,$a,Hi,Ui,Cl,ne,qi,Ca,Ji,Yi,Ta,Xi,Ki,wa,Qi,Zi,Tl,ft,ec,ya,tc,rc,wl,S,Aa,La,ac,oc,nc,Ie,Da,sc,lc,Oa,ic,cc,Ia,dc,fc,hc,Sa,Ma,mc,pc,gc,ht,xa,uc,vc,Zt,_c,bc,Ec,mt,Na,kc,$c,er,Cc,Tc,wc,pt,Pa,yc,Ac,tr,Lc,Dc,Oc,gt,Fa,Ic,Sc,rr,Mc,xc,Nc,ut,Wa,Pc,Fc,ar,Wc,Rc,jc,vt,Ra,zc,Bc,or,Gc,Vc,Hc,_t,ja,Uc,qc,nr,Jc,Yc,Xc,bt,za,Kc,Qc,sr,Zc,ed,yl,B,td,Ba,rd,ad,Ga,od,nd,Va,sd,ld,Ha,id,cd,Ua,dd,fd,Al,We,Et,Do,lr,hd,Oo,md,Ll,kt,pd,qa,gd,ud,Dl,_e,ir,vd,Re,_d,Ja,bd,Ed,cr,kd,$d,Cd,X,dr,Td,Io,wd,yd,So,Ad,Ld,be,j,Mo,Dd,Od,xo,Id,Sd,No,Md,xd,Po,Nd,Pd,Fo,Fd,Wd,Wo,Rd,jd,Ro,zd,Bd,Gd,Se,jo,Vd,Hd,zo,Ud,qd,Bo,Jd,Yd,Xd,K,Go,Kd,Qd,Vo,Zd,ef,Ho,tf,rf,Uo,af,of,qo,nf,sf,lf,G,Jo,cf,df,Yo,ff,hf,Xo,mf,pf,Ko,gf,uf,Qo,vf,_f,Zo,bf,Ef,kf,fr,$f,hr,Cf,Tf,Ol,je,mr,wf,pr,yf,Ya,Af,Lf,Il,ze,gr,Df,ur,Of,Xa,If,Sf,Sl,Be,vr,Mf,_r,xf,Ka,Nf,Pf,Ml,Ee,br,Ff,Er,Wf,Qa,Rf,jf,zf,ke,Bf,Za,Gf,Vf,en,Hf,Uf,eo,qf,Jf,xl,Ge,kr,Yf,Ve,Xf,to,Kf,Qf,$r,Zf,eh,Nl,$e,Cr,th,He,rh,ro,ah,oh,Tr,nh,sh,lh,Q,wr,ih,yr,ch,tn,dh,fh,hh,Ar,mh,Lr,ph,gh,uh,rn,vh,_h,Ce,Dr,O,an,bh,Eh,on,kh,$h,nn,Ch,Th,sn,wh,yh,ln,Ah,Lh,cn,Dh,Oh,dn,Ih,Sh,fn,Mh,xh,hn,Nh,Ph,mn,Fh,Wh,pn,Rh,jh,gn,zh,Bh,Gh,$t,Vh,un,N,vn,Hh,Uh,_n,qh,Jh,bn,Yh,Xh,En,Kh,Qh,kn,Zh,em,$n,tm,rm,Cn,am,om,Tn,nm,sm,wn,lm,im,cm,yn,se,An,dm,fm,Ln,hm,mm,Dn,pm,gm,On,um,vm,_m,In,Z,Sn,bm,Em,Mn,km,$m,xn,Cm,Tm,Nn,wm,ym,Pn,Am,Lm,Pl,Te,Or,Dm,we,Om,ao,Im,Sm,Ir,Mm,xm,Fn,Nm,Pm,Fm,le,Sr,Wm,Wn,Rm,jm,Rn,zm,Bm,H,F,jn,Gm,Vm,zn,Hm,Um,Bn,qm,Jm,Gn,Ym,Xm,Vn,Km,Qm,Hn,Zm,ep,oo,tp,rp,Un,ap,op,np,V,qn,sp,lp,Jn,ip,cp,Yn,dp,fp,Xn,hp,mp,Kn,pp,gp,Qn,up,vp,_p,ie,Zn,bp,Ep,es,kp,$p,ts,Cp,Tp,rs,wp,yp,Ap,ee,as,Lp,Dp,os,Op,Ip,ns,Sp,Mp,ss,xp,Np,ls,Pp,Fp,Wp,te,is,Rp,jp,cs,zp,Bp,ds,Gp,Vp,fs,Hp,Up,hs,qp,Jp,Yp,ce,ms,Xp,Kp,ps,Qp,Zp,gs,eg,tg,us,rg,ag,Fl,Ue,Mr,og,qe,ng,no,sg,lg,xr,ig,cg,Wl,Je,Nr,dg,Pr,fg,so,hg,mg,Rl,Ye,Fr,pg,Wr,gg,Rr,ug,vg,jl,re,jr,_g,Xe,bg,lo,Eg,kg,zr,$g,Cg,Tg,vs,wg,yg,Ke,de,_s,Ag,Lg,bs,Dg,Og,Es,Ig,Sg,ks,Mg,xg,Ng,fe,$s,Pg,Fg,Cs,Wg,Rg,Ts,jg,zg,ws,Bg,Gg,Vg,he,ys,Hg,Ug,As,qg,Jg,Ls,Yg,Xg,Ds,Kg,Qg,zl,ye,Br,Zg,Me,eu,io,tu,ru,Gr,au,ou,Os,nu,su,me,Vr,lu,Is,iu,cu,Ss,du,fu,Ms,pe,xs,hu,mu,Ns,pu,gu,Ps,uu,vu,Fs,_u,bu,Bl,Qe,Ct,Ws,Hr,Eu,Rs,ku,Gl,$,Ur,$u,js,Cu,Tu,qr,wu,zs,yu,Au,Lu,U,Du,Bs,Ou,Iu,Gs,Su,Mu,Vs,xu,Nu,Hs,Pu,Fu,Us,Wu,Ru,ju,Tt,zu,wt,Jr,Bu,qs,Gu,Vu,yt,Yr,Hu,Js,Uu,qu,At,Xr,Ju,Ys,Yu,Xu,Lt,Kr,Ku,Qr,Qu,co,Zu,ev,tv,Dt,Zr,rv,Xs,av,ov,Ot,ea,nv,Ks,sv,lv,It,ta,iv,Qs,cv,dv,St,ra,fv,Zs,hv,mv,Mt,aa,pv,el,gv,uv,xt,oa,vv,tl,_v,bv,Nt,na,Ev,rl,kv,$v,Pt,sa,Cv,al,Tv,wv,Ft,la,yv,ol,Av,Vl,Wt,Lv,fo,Dv,Ov,Hl,ia,Ul,Rt,Iv,nl,Sv,Mv,ql,ca,Jl,Ze,jt,sl,da,xv,ll,Nv,Yl,q,fa,Pv,et,Fv,ho,Wv,Rv,mo,jv,zv,Bv,zt,Gv,Bt,ha,Vv,ma,Hv,il,Uv,qv,Jv,Gt,pa,Yv,ga,Xv,cl,Kv,Qv,Xl,tt,Vt,dl,ua,Zv,fl,e_,Kl,rt,va,t_,at,r_,po,a_,o_,go,n_,s_,Ql;return k=new $l({}),lr=new $l({}),ir=new y({props:{name:"class transformers.integrations.CometCallback",anchor:"transformers.integrations.CometCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L819"}}),dr=new y({props:{name:"setup",anchor:"transformers.integrations.CometCallback.setup",parameters:[{name:"args",val:""},{name:"state",val:""},{name:"model",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L830"}}),mr=new y({props:{name:"class transformers.DefaultFlowCallback",anchor:"transformers.DefaultFlowCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L415"}}),gr=new y({props:{name:"class transformers.PrinterCallback",anchor:"transformers.PrinterCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L513"}}),vr=new y({props:{name:"class transformers.ProgressCallback",anchor:"transformers.ProgressCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L465"}}),br=new y({props:{name:"class transformers.EarlyStoppingCallback",anchor:"transformers.EarlyStoppingCallback",parameters:[{name:"early_stopping_patience",val:": int = 1"},{name:"early_stopping_threshold",val:": typing.Optional[float] = 0.0"}],parametersDescription:[{anchor:"transformers.EarlyStoppingCallback.early_stopping_patience",description:`<strong>early_stopping_patience</strong> (<code>int</code>) &#x2014;
Use with <code>metric_for_best_model</code> to stop training when the specified metric worsens for
<code>early_stopping_patience</code> evaluation calls.`,name:"early_stopping_patience"},{anchor:"transformers.EarlyStoppingCallback.early_stopping_threshold(float,",description:`<strong>early_stopping_threshold(<code>float</code>,</strong> <em>optional</em>) &#x2014;
Use with TrainingArguments <code>metric_for_best_model</code> and <code>early_stopping_patience</code> to denote how much the
specified metric must improve to satisfy early stopping conditions. \``,name:"early_stopping_threshold(float,"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L524"}}),kr=new y({props:{name:"class transformers.integrations.TensorBoardCallback",anchor:"transformers.integrations.TensorBoardCallback",parameters:[{name:"tb_writer",val:" = None"}],parametersDescription:[{anchor:"transformers.integrations.TensorBoardCallback.tb_writer",description:`<strong>tb_writer</strong> (<code>SummaryWriter</code>, <em>optional</em>) &#x2014;
The writer to use. Will instantiate one if not set.`,name:"tb_writer"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L563"}}),Cr=new y({props:{name:"class transformers.integrations.WandbCallback",anchor:"transformers.integrations.WandbCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L652"}}),wr=new y({props:{name:"setup",anchor:"transformers.integrations.WandbCallback.setup",parameters:[{name:"args",val:""},{name:"state",val:""},{name:"model",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L677"}}),$t=new $E({props:{version:"5.0",$$slots:{default:[CE]},$$scope:{ctx:W}}}),Or=new y({props:{name:"class transformers.integrations.MLflowCallback",anchor:"transformers.integrations.MLflowCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L919"}}),Sr=new y({props:{name:"setup",anchor:"transformers.integrations.MLflowCallback.setup",parameters:[{name:"args",val:""},{name:"state",val:""},{name:"model",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L938"}}),Mr=new y({props:{name:"class transformers.integrations.AzureMLCallback",anchor:"transformers.integrations.AzureMLCallback",parameters:[{name:"azureml_run",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L896"}}),Nr=new y({props:{name:"class transformers.integrations.CodeCarbonCallback",anchor:"transformers.integrations.CodeCarbonCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L1375"}}),Fr=new y({props:{name:"class transformers.integrations.NeptuneCallback",anchor:"transformers.integrations.NeptuneCallback",parameters:[{name:"api_token",val:": typing.Optional[str] = None"},{name:"project",val:": typing.Optional[str] = None"},{name:"name",val:": typing.Optional[str] = None"},{name:"base_namespace",val:": str = 'finetuning'"},{name:"run",val:": typing.Optional[ForwardRef('Run')] = None"},{name:"log_parameters",val:": bool = True"},{name:"log_checkpoints",val:": typing.Optional[str] = None"},{name:"**neptune_run_kwargs",val:""}],parametersDescription:[{anchor:"transformers.integrations.NeptuneCallback.api_token",description:`<strong>api_token</strong> (<code>str</code>, optional) &#x2014;
Neptune API token obtained upon registration. You can leave this argument out if you have saved your token
to the <code>NEPTUNE_API_TOKEN</code> environment variable (strongly recommended). See full setup instructions in the
<a href="https://docs.neptune.ai/getting-started/installation" rel="nofollow">docs</a>.`,name:"api_token"},{anchor:"transformers.integrations.NeptuneCallback.project",description:`<strong>project</strong> (<code>str</code>, optional) &#x2014;
Name of an existing Neptune project, in the form: &#x201C;workspace-name/project-name&#x201D;. You can find and copy the
name from the project Settings -&gt; Properties in Neptune. If None (default), the value of the
<code>NEPTUNE_PROJECT</code> environment variable will be used.`,name:"project"},{anchor:"transformers.integrations.NeptuneCallback.name",description:"<strong>name</strong> (<code>str</code>, optional) &#x2014; Custom name for the run.",name:"name"},{anchor:"transformers.integrations.NeptuneCallback.base_namespace",description:`<strong>base_namespace</strong> (<code>str</code>, optional, defaults to &#x201C;finetuning&#x201D;) &#x2014; In the Neptune run, the root namespace
that will contain all of the logged metadata.`,name:"base_namespace"},{anchor:"transformers.integrations.NeptuneCallback.log_parameters",description:`<strong>log_parameters</strong> (<code>bool</code>, optional, defaults to True) &#x2014;
If True, logs all Trainer arguments and model parameters provided by the Trainer.`,name:"log_parameters"},{anchor:"transformers.integrations.NeptuneCallback.log_checkpoints",description:`<strong>log_checkpoints</strong> (<code>str</code>, optional, defaults to None) &#x2014;
If &#x201C;same&#x201D;, uploads checkpoints whenever they are saved by the Trainer. If &#x201C;last&#x201D;, uploads only the most
recently saved checkpoint. If &#x201C;best&#x201D;, uploads the best checkpoint (among the ones saved by the Trainer). If
None, does not upload checkpoints.`,name:"log_checkpoints"},{anchor:"transformers.integrations.NeptuneCallback.run",description:`<strong>run</strong> (<code>Run</code>, optional) &#x2014;
Pass a Neptune run object if you want to continue logging to an existing run. Read more about resuming runs
in the <a href="https://docs.neptune.ai/how-to-guides/neptune-api/resume-run" rel="nofollow">docs</a>.`,name:"run"},{anchor:"transformers.integrations.NeptuneCallback.*neptune_run_kwargs",description:`*<strong>*neptune_run_kwargs</strong> (optional) &#x2014;
Additional keyword arguments to be passed directly to the
<a href="https://docs.neptune.ai/api-reference/neptune#.init_run" rel="nofollow">neptune.init_run()</a> function when a new run is
created.`,name:"*neptune_run_kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L1114"}}),jr=new y({props:{name:"class transformers.integrations.ClearMLCallback",anchor:"transformers.integrations.ClearMLCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L1404"}}),Br=new y({props:{name:"class transformers.integrations.DagsHubCallback",anchor:"transformers.integrations.DagsHubCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L1054"}}),Vr=new y({props:{name:"setup",anchor:"transformers.integrations.DagsHubCallback.setup",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/integrations.py#L1068"}}),Hr=new $l({}),Ur=new y({props:{name:"class transformers.TrainerCallback",anchor:"transformers.TrainerCallback",parameters:[],parametersDescription:[{anchor:"transformers.TrainerCallback.args",description:`<strong>args</strong> (<a href="/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>) &#x2014;
The training arguments used to instantiate the <a href="/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.Trainer">Trainer</a>.`,name:"args"},{anchor:"transformers.TrainerCallback.state",description:`<strong>state</strong> (<a href="/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerState">TrainerState</a>) &#x2014;
The current state of the <a href="/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.Trainer">Trainer</a>.`,name:"state"},{anchor:"transformers.TrainerCallback.control",description:`<strong>control</strong> (<a href="/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerControl">TrainerControl</a>) &#x2014;
The object that is returned to the <a href="/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.Trainer">Trainer</a> and can be used to make some decisions.`,name:"control"},{anchor:"transformers.TrainerCallback.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <code>torch.nn.Module</code>) &#x2014;
The model being trained.`,name:"model"},{anchor:"transformers.TrainerCallback.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer used for encoding the data.`,name:"tokenizer"},{anchor:"transformers.TrainerCallback.optimizer",description:`<strong>optimizer</strong> (<code>torch.optim.Optimizer</code>) &#x2014;
The optimizer used for the training steps.`,name:"optimizer"},{anchor:"transformers.TrainerCallback.lr_scheduler",description:`<strong>lr_scheduler</strong> (<code>torch.optim.lr_scheduler.LambdaLR</code>) &#x2014;
The scheduler used for setting the learning rate.`,name:"lr_scheduler"},{anchor:"transformers.TrainerCallback.train_dataloader",description:`<strong>train_dataloader</strong> (<code>torch.utils.data.DataLoader</code>, <em>optional</em>) &#x2014;
The current dataloader used for training.`,name:"train_dataloader"},{anchor:"transformers.TrainerCallback.eval_dataloader",description:`<strong>eval_dataloader</strong> (<code>torch.utils.data.DataLoader</code>, <em>optional</em>) &#x2014;
The current dataloader used for training.`,name:"eval_dataloader"},{anchor:"transformers.TrainerCallback.metrics",description:`<strong>metrics</strong> (<code>Dict[str, float]</code>) &#x2014;
The metrics computed by the last evaluation phase.</p>
<p>Those are only accessible in the event <code>on_evaluate</code>.`,name:"metrics"},{anchor:"transformers.TrainerCallback.logs",description:`<strong>logs</strong>  (<code>Dict[str, float]</code>) &#x2014;
The values to log.</p>
<p>Those are only accessible in the event <code>on_log</code>.`,name:"logs"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L159"}}),Tt=new _E({props:{anchor:"transformers.TrainerCallback.example",$$slots:{default:[TE]},$$scope:{ctx:W}}}),Jr=new y({props:{name:"on_epoch_begin",anchor:"transformers.TrainerCallback.on_epoch_begin",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L227"}}),Yr=new y({props:{name:"on_epoch_end",anchor:"transformers.TrainerCallback.on_epoch_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L233"}}),Xr=new y({props:{name:"on_evaluate",anchor:"transformers.TrainerCallback.on_evaluate",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L259"}}),Kr=new y({props:{name:"on_init_end",anchor:"transformers.TrainerCallback.on_init_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L209"}}),Zr=new y({props:{name:"on_log",anchor:"transformers.TrainerCallback.on_log",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L277"}}),ea=new y({props:{name:"on_predict",anchor:"transformers.TrainerCallback.on_predict",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"metrics",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L265"}}),ta=new y({props:{name:"on_prediction_step",anchor:"transformers.TrainerCallback.on_prediction_step",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L283"}}),ra=new y({props:{name:"on_save",anchor:"transformers.TrainerCallback.on_save",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L271"}}),aa=new y({props:{name:"on_step_begin",anchor:"transformers.TrainerCallback.on_step_begin",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L239"}}),oa=new y({props:{name:"on_step_end",anchor:"transformers.TrainerCallback.on_step_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L252"}}),na=new y({props:{name:"on_substep_end",anchor:"transformers.TrainerCallback.on_substep_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L246"}}),sa=new y({props:{name:"on_train_begin",anchor:"transformers.TrainerCallback.on_train_begin",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L215"}}),la=new y({props:{name:"on_train_end",anchor:"transformers.TrainerCallback.on_train_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L221"}}),ia=new c_({props:{code:`class MyCallback(TrainerCallback):
    "A callback that prints a message at the beginning of training"

    def on_train_begin(self, args, state, control, **kwargs):
        print("Starting training")


trainer = Trainer(
    model,
    args,
    train_dataset=train_dataset,
    eval_dataset=eval_dataset,
    callbacks=[MyCallback],  # We can either pass the callback class this way or an instance of it (MyCallback())
)`,highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">MyCallback</span>(<span class="hljs-title class_ inherited__">TrainerCallback</span>):
    <span class="hljs-string">&quot;A callback that prints a message at the beginning of training&quot;</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">on_train_begin</span>(<span class="hljs-params">self, args, state, control, **kwargs</span>):
        <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Starting training&quot;</span>)


trainer = Trainer(
    model,
    args,
    train_dataset=train_dataset,
    eval_dataset=eval_dataset,
    callbacks=[MyCallback],  <span class="hljs-comment"># We can either pass the callback class this way or an instance of it (MyCallback())</span>
)`}}),ca=new c_({props:{code:`trainer = Trainer(...)
trainer.add_callback(MyCallback)
# Alternatively, we can pass an instance of the callback class
trainer.add_callback(MyCallback())`,highlighted:`trainer = Trainer(...)
trainer.add_callback(MyCallback)
<span class="hljs-comment"># Alternatively, we can pass an instance of the callback class</span>
trainer.add_callback(MyCallback())`}}),da=new $l({}),fa=new y({props:{name:"class transformers.TrainerState",anchor:"transformers.TrainerState",parameters:[{name:"epoch",val:": typing.Optional[float] = None"},{name:"global_step",val:": int = 0"},{name:"max_steps",val:": int = 0"},{name:"num_train_epochs",val:": int = 0"},{name:"total_flos",val:": float = 0"},{name:"log_history",val:": typing.List[typing.Dict[str, float]] = None"},{name:"best_metric",val:": typing.Optional[float] = None"},{name:"best_model_checkpoint",val:": typing.Optional[str] = None"},{name:"is_local_process_zero",val:": bool = True"},{name:"is_world_process_zero",val:": bool = True"},{name:"is_hyper_param_search",val:": bool = False"},{name:"trial_name",val:": str = None"},{name:"trial_params",val:": typing.Dict[str, typing.Union[str, float, int, bool]] = None"}],parametersDescription:[{anchor:"transformers.TrainerState.epoch",description:`<strong>epoch</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Only set during training, will represent the epoch the training is at (the decimal part being the
percentage of the current epoch completed).`,name:"epoch"},{anchor:"transformers.TrainerState.global_step",description:`<strong>global_step</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
During training, represents the number of update steps completed.`,name:"global_step"},{anchor:"transformers.TrainerState.max_steps",description:`<strong>max_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The number of update steps to do during the current training.`,name:"max_steps"},{anchor:"transformers.TrainerState.total_flos",description:`<strong>total_flos</strong> (<code>float</code>, <em>optional</em>, defaults to 0) &#x2014;
The total number of floating operations done by the model since the beginning of training (stored as floats
to avoid overflow).`,name:"total_flos"},{anchor:"transformers.TrainerState.log_history",description:`<strong>log_history</strong> (<code>List[Dict[str, float]]</code>, <em>optional</em>) &#x2014;
The list of logs done since the beginning of training.`,name:"log_history"},{anchor:"transformers.TrainerState.best_metric",description:`<strong>best_metric</strong> (<code>float</code>, <em>optional</em>) &#x2014;
When tracking the best model, the value of the best metric encountered so far.`,name:"best_metric"},{anchor:"transformers.TrainerState.best_model_checkpoint",description:`<strong>best_model_checkpoint</strong> (<code>str</code>, <em>optional</em>) &#x2014;
When tracking the best model, the value of the name of the checkpoint for the best model encountered so
far.`,name:"best_model_checkpoint"},{anchor:"transformers.TrainerState.is_local_process_zero",description:`<strong>is_local_process_zero</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not this process is the local (e.g., on one machine if training in a distributed fashion on
several machines) main process.`,name:"is_local_process_zero"},{anchor:"transformers.TrainerState.is_world_process_zero",description:`<strong>is_world_process_zero</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
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 <code>True</code> for one process).`,name:"is_world_process_zero"},{anchor:"transformers.TrainerState.is_hyper_param_search",description:`<strong>is_hyper_param_search</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether we are in the process of a hyper parameter search using Trainer.hyperparameter_search. This will
impact the way data will be logged in TensorBoard.`,name:"is_hyper_param_search"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L35"}}),zt=new cE({props:{$$slots:{default:[wE]},$$scope:{ctx:W}}}),ha=new y({props:{name:"load_from_json",anchor:"transformers.TrainerState.load_from_json",parameters:[{name:"json_path",val:": str"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L101"}}),pa=new y({props:{name:"save_to_json",anchor:"transformers.TrainerState.save_to_json",parameters:[{name:"json_path",val:": str"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L95"}}),ua=new $l({}),va=new y({props:{name:"class transformers.TrainerControl",anchor:"transformers.TrainerControl",parameters:[{name:"should_training_stop",val:": bool = False"},{name:"should_epoch_stop",val:": bool = False"},{name:"should_save",val:": bool = False"},{name:"should_evaluate",val:": bool = False"},{name:"should_log",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TrainerControl.should_training_stop",description:`<strong>should_training_stop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the training should be interrupted.</p>
<p>If <code>True</code>, this variable will not be set back to <code>False</code>. The training will just stop.`,name:"should_training_stop"},{anchor:"transformers.TrainerControl.should_epoch_stop",description:`<strong>should_epoch_stop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the current epoch should be interrupted.</p>
<p>If <code>True</code>, this variable will be set back to <code>False</code> at the beginning of the next epoch.`,name:"should_epoch_stop"},{anchor:"transformers.TrainerControl.should_save",description:`<strong>should_save</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should be saved at this step.</p>
<p>If <code>True</code>, this variable will be set back to <code>False</code> at the beginning of the next step.`,name:"should_save"},{anchor:"transformers.TrainerControl.should_evaluate",description:`<strong>should_evaluate</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should be evaluated at this step.</p>
<p>If <code>True</code>, this variable will be set back to <code>False</code> at the beginning of the next step.`,name:"should_evaluate"},{anchor:"transformers.TrainerControl.should_log",description:`<strong>should_log</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the logs should be reported at this step.</p>
<p>If <code>True</code>, this variable will be set back to <code>False</code> at the beginning of the next step.`,name:"should_log"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/trainer_callback.py#L110"}}),{c(){m=o("meta"),D=c(),E=o("h1"),C=o("a"),A=o("span"),u(k.$$.fragment),L=c(),w=o("span"),I=t("Callbacks"),x=c(),Y=o("p"),Fe=t(`Callbacks are objects that can customize the behavior of the training loop in the PyTorch
`),$a=o("a"),Hi=t("Trainer"),Ui=t(` (this feature is not yet implemented in TensorFlow) that can inspect the training loop
state (for progress reporting, logging on TensorBoard or other ML platforms\u2026) and take decisions (like early
stopping).`),Cl=c(),ne=o("p"),qi=t("Callbacks are \u201Cread only\u201D pieces of code, apart from the "),Ca=o("a"),Ji=t("TrainerControl"),Yi=t(` object they return, they
cannot change anything in the training loop. For customizations that require changes in the training loop, you should
subclass `),Ta=o("a"),Xi=t("Trainer"),Ki=t(" and override the methods you need (see "),wa=o("a"),Qi=t("trainer"),Zi=t(" for examples)."),Tl=c(),ft=o("p"),ec=t("By default a "),ya=o("a"),tc=t("Trainer"),rc=t(" will use the following callbacks:"),wl=c(),S=o("ul"),Aa=o("li"),La=o("a"),ac=t("DefaultFlowCallback"),oc=t(" which handles the default behavior for logging, saving and evaluation."),nc=c(),Ie=o("li"),Da=o("a"),sc=t("PrinterCallback"),lc=t(" or "),Oa=o("a"),ic=t("ProgressCallback"),cc=t(` to display progress and print the
logs (the first one is used if you deactivate tqdm through the `),Ia=o("a"),dc=t("TrainingArguments"),fc=t(`, otherwise
it\u2019s the second one).`),hc=c(),Sa=o("li"),Ma=o("a"),mc=t("TensorBoardCallback"),pc=t(` if tensorboard is accessible (either through PyTorch >= 1.4
or tensorboardX).`),gc=c(),ht=o("li"),xa=o("a"),uc=t("WandbCallback"),vc=t(" if "),Zt=o("a"),_c=t("wandb"),bc=t(" is installed."),Ec=c(),mt=o("li"),Na=o("a"),kc=t("CometCallback"),$c=t(" if "),er=o("a"),Cc=t("comet_ml"),Tc=t(" is installed."),wc=c(),pt=o("li"),Pa=o("a"),yc=t("MLflowCallback"),Ac=t(" if "),tr=o("a"),Lc=t("mlflow"),Dc=t(" is installed."),Oc=c(),gt=o("li"),Fa=o("a"),Ic=t("NeptuneCallback"),Sc=t(" if "),rr=o("a"),Mc=t("neptune"),xc=t(" is installed."),Nc=c(),ut=o("li"),Wa=o("a"),Pc=t("AzureMLCallback"),Fc=t(" if "),ar=o("a"),Wc=t("azureml-sdk"),Rc=t(` is
installed.`),jc=c(),vt=o("li"),Ra=o("a"),zc=t("CodeCarbonCallback"),Bc=t(" if "),or=o("a"),Gc=t("codecarbon"),Vc=t(` is
installed.`),Hc=c(),_t=o("li"),ja=o("a"),Uc=t("ClearMLCallback"),qc=t(" if "),nr=o("a"),Jc=t("clearml"),Yc=t(" is installed."),Xc=c(),bt=o("li"),za=o("a"),Kc=t("DagsHubCallback"),Qc=t(" if "),sr=o("a"),Zc=t("dagshub"),ed=t(" is installed."),yl=c(),B=o("p"),td=t("The main class that implements callbacks is "),Ba=o("a"),rd=t("TrainerCallback"),ad=t(`. It gets the
`),Ga=o("a"),od=t("TrainingArguments"),nd=t(" used to instantiate the "),Va=o("a"),sd=t("Trainer"),ld=t(`, can access that
Trainer\u2019s internal state via `),Ha=o("a"),id=t("TrainerState"),cd=t(`, and can take some actions on the training loop via
`),Ua=o("a"),dd=t("TrainerControl"),fd=t("."),Al=c(),We=o("h2"),Et=o("a"),Do=o("span"),u(lr.$$.fragment),hd=c(),Oo=o("span"),md=t("Available Callbacks"),Ll=c(),kt=o("p"),pd=t("Here is the list of the available "),qa=o("a"),gd=t("TrainerCallback"),ud=t(" in the library:"),Dl=c(),_e=o("div"),u(ir.$$.fragment),vd=c(),Re=o("p"),_d=t("A "),Ja=o("a"),bd=t("TrainerCallback"),Ed=t(" that sends the logs to "),cr=o("a"),kd=t("Comet ML"),$d=t("."),Cd=c(),X=o("div"),u(dr.$$.fragment),Td=c(),Io=o("p"),wd=t("Setup the optional Comet.ml integration."),yd=c(),So=o("p"),Ad=t("Environment:"),Ld=c(),be=o("ul"),j=o("li"),Mo=o("strong"),Dd=t("COMET_MODE"),Od=t(" ("),xo=o("code"),Id=t("str"),Sd=t(", "),No=o("em"),Md=t("optional"),xd=t(", defaults to "),Po=o("code"),Nd=t("ONLINE"),Pd=t(`):
Whether to create an online, offline experiment or disable Comet logging. Can be `),Fo=o("code"),Fd=t("OFFLINE"),Wd=t(", "),Wo=o("code"),Rd=t("ONLINE"),jd=t(`, or
`),Ro=o("code"),zd=t("DISABLED"),Bd=t("."),Gd=c(),Se=o("li"),jo=o("strong"),Vd=t("COMET_PROJECT_NAME"),Hd=t(" ("),zo=o("code"),Ud=t("str"),qd=t(", "),Bo=o("em"),Jd=t("optional"),Yd=t(`):
Comet project name for experiments.`),Xd=c(),K=o("li"),Go=o("strong"),Kd=t("COMET_OFFLINE_DIRECTORY"),Qd=t(" ("),Vo=o("code"),Zd=t("str"),ef=t(", "),Ho=o("em"),tf=t("optional"),rf=t(`):
Folder to use for saving offline experiments when `),Uo=o("code"),af=t("COMET_MODE"),of=t(" is "),qo=o("code"),nf=t("OFFLINE"),sf=t("."),lf=c(),G=o("li"),Jo=o("strong"),cf=t("COMET_LOG_ASSETS"),df=t(" ("),Yo=o("code"),ff=t("str"),hf=t(", "),Xo=o("em"),mf=t("optional"),pf=t(", defaults to "),Ko=o("code"),gf=t("TRUE"),uf=t(`):
Whether or not to log training assets (tf event logs, checkpoints, etc), to Comet. Can be `),Qo=o("code"),vf=t("TRUE"),_f=t(`, or
`),Zo=o("code"),bf=t("FALSE"),Ef=t("."),kf=c(),fr=o("p"),$f=t(`For a number of configurable items in the environment, see
`),hr=o("a"),Cf=t("here"),Tf=t("."),Ol=c(),je=o("div"),u(mr.$$.fragment),wf=c(),pr=o("p"),yf=t("A "),Ya=o("a"),Af=t("TrainerCallback"),Lf=t(" that handles the default flow of the training loop for logs, evaluation and checkpoints."),Il=c(),ze=o("div"),u(gr.$$.fragment),Df=c(),ur=o("p"),Of=t("A bare "),Xa=o("a"),If=t("TrainerCallback"),Sf=t(" that just prints the logs."),Sl=c(),Be=o("div"),u(vr.$$.fragment),Mf=c(),_r=o("p"),xf=t("A "),Ka=o("a"),Nf=t("TrainerCallback"),Pf=t(" that displays the progress of training or evaluation."),Ml=c(),Ee=o("div"),u(br.$$.fragment),Ff=c(),Er=o("p"),Wf=t("A "),Qa=o("a"),Rf=t("TrainerCallback"),jf=t(" that handles early stopping."),zf=c(),ke=o("p"),Bf=t("This callback depends on "),Za=o("a"),Gf=t("TrainingArguments"),Vf=t(" argument "),en=o("em"),Hf=t("load_best_model_at_end"),Uf=t(` functionality to set best_metric
in `),eo=o("a"),qf=t("TrainerState"),Jf=t("."),xl=c(),Ge=o("div"),u(kr.$$.fragment),Yf=c(),Ve=o("p"),Xf=t("A "),to=o("a"),Kf=t("TrainerCallback"),Qf=t(" that sends the logs to "),$r=o("a"),Zf=t("TensorBoard"),eh=t("."),Nl=c(),$e=o("div"),u(Cr.$$.fragment),th=c(),He=o("p"),rh=t("A "),ro=o("a"),ah=t("TrainerCallback"),oh=t(" that logs metrics, media, model checkpoints to "),Tr=o("a"),nh=t("Weight and Biases"),sh=t("."),lh=c(),Q=o("div"),u(wr.$$.fragment),ih=c(),yr=o("p"),ch=t("Setup the optional Weights & Biases ("),tn=o("em"),dh=t("wandb"),fh=t(") integration."),hh=c(),Ar=o("p"),mh=t(`One can subclass and override this method to customize the setup if needed. Find more information
`),Lr=o("a"),ph=t("here"),gh=t(`. You can also override the following environment
variables:`),uh=c(),rn=o("p"),vh=t("Environment:"),_h=c(),Ce=o("ul"),Dr=o("li"),O=o("p"),an=o("strong"),bh=t("WANDB_LOG_MODEL"),Eh=t(" ("),on=o("code"),kh=t("str"),$h=t(", "),nn=o("em"),Ch=t("optional"),Th=t(", defaults to "),sn=o("code"),wh=t('"false"'),yh=t(`):
Whether to log model and checkpoints during training. Can be `),ln=o("code"),Ah=t('"end"'),Lh=t(", "),cn=o("code"),Dh=t('"checkpoint"'),Oh=t(" or "),dn=o("code"),Ih=t('"false"'),Sh=t(`. If set
to `),fn=o("code"),Mh=t('"end"'),xh=t(", the model will be uploaded at the end of training. If set to "),hn=o("code"),Nh=t('"checkpoint"'),Ph=t(`, the checkpoint
will be uploaded every `),mn=o("code"),Fh=t("args.save_steps"),Wh=t(" . If set to "),pn=o("code"),Rh=t('"false"'),jh=t(`, the model will not be uploaded. Use along
with `),gn=o("code"),zh=t("load_best_model_at_end()"),Bh=t(" to upload best model."),Gh=c(),u($t.$$.fragment),Vh=c(),un=o("li"),N=o("p"),vn=o("strong"),Hh=t("WANDB_WATCH"),Uh=t(" ("),_n=o("code"),qh=t("str"),Jh=t(", "),bn=o("em"),Yh=t("optional"),Xh=t(" defaults to "),En=o("code"),Kh=t('"false"'),Qh=t(`):
Can be `),kn=o("code"),Zh=t('"gradients"'),em=t(", "),$n=o("code"),tm=t('"all"'),rm=t(", "),Cn=o("code"),am=t('"parameters"'),om=t(", or "),Tn=o("code"),nm=t('"false"'),sm=t(". Set to "),wn=o("code"),lm=t('"all"'),im=t(` to log gradients and
parameters.`),cm=c(),yn=o("li"),se=o("p"),An=o("strong"),dm=t("WANDB_PROJECT"),fm=t(" ("),Ln=o("code"),hm=t("str"),mm=t(", "),Dn=o("em"),pm=t("optional"),gm=t(", defaults to "),On=o("code"),um=t('"huggingface"'),vm=t(`):
Set this to a custom string to store results in a different project.`),_m=c(),In=o("li"),Z=o("p"),Sn=o("strong"),bm=t("WANDB_DISABLED"),Em=t(" ("),Mn=o("code"),km=t("bool"),$m=t(", "),xn=o("em"),Cm=t("optional"),Tm=t(", defaults to "),Nn=o("code"),wm=t("False"),ym=t(`):
Whether to disable wandb entirely. Set `),Pn=o("code"),Am=t("WANDB_DISABLED=true"),Lm=t(" to disable."),Pl=c(),Te=o("div"),u(Or.$$.fragment),Dm=c(),we=o("p"),Om=t("A "),ao=o("a"),Im=t("TrainerCallback"),Sm=t(" that sends the logs to "),Ir=o("a"),Mm=t("MLflow"),xm=t(`. Can be disabled by setting
environment variable `),Fn=o("code"),Nm=t("DISABLE_MLFLOW_INTEGRATION = TRUE"),Pm=t("."),Fm=c(),le=o("div"),u(Sr.$$.fragment),Wm=c(),Wn=o("p"),Rm=t("Setup the optional MLflow integration."),jm=c(),Rn=o("p"),zm=t("Environment:"),Bm=c(),H=o("ul"),F=o("li"),jn=o("strong"),Gm=t("HF_MLFLOW_LOG_ARTIFACTS"),Vm=t(" ("),zn=o("code"),Hm=t("str"),Um=t(", "),Bn=o("em"),qm=t("optional"),Jm=t(`):
Whether to use MLflow `),Gn=o("code"),Ym=t(".log_artifact()"),Xm=t(` facility to log artifacts. This only makes sense if logging to a
remote server, e.g. s3 or GCS. If set to `),Vn=o("code"),Km=t("True"),Qm=t(" or "),Hn=o("em"),Zm=t("1"),ep=t(`, will copy each saved checkpoint on each save in
`),oo=o("a"),tp=t("TrainingArguments"),rp=t("\u2019s "),Un=o("code"),ap=t("output_dir"),op=t(` to the local or remote artifact storage. Using it without a remote
storage will just copy the files to your artifact location.`),np=c(),V=o("li"),qn=o("strong"),sp=t("MLFLOW_EXPERIMENT_NAME"),lp=t(" ("),Jn=o("code"),ip=t("str"),cp=t(", "),Yn=o("em"),dp=t("optional"),fp=t(", defaults to "),Xn=o("code"),hp=t("None"),mp=t(`):
Whether to use an MLflow experiment_name under which to launch the run. Default to `),Kn=o("code"),pp=t("None"),gp=t(` which will point
to the `),Qn=o("code"),up=t("Default"),vp=t(` experiment in MLflow. Otherwise, it is a case sensitive name of the experiment to be
activated. If an experiment with this name does not exist, a new experiment with this name is created.`),_p=c(),ie=o("li"),Zn=o("strong"),bp=t("MLFLOW_TAGS"),Ep=t(" ("),es=o("code"),kp=t("str"),$p=t(", "),ts=o("em"),Cp=t("optional"),Tp=t(`):
A string dump of a dictionary of key/value pair to be added to the MLflow run as tags. Example:
`),rs=o("code"),wp=t(`os.environ['MLFLOW_TAGS']='{"release.candidate": "RC1", "release.version": "2.2.0"}'`),yp=t("."),Ap=c(),ee=o("li"),as=o("strong"),Lp=t("MLFLOW_NESTED_RUN"),Dp=t(" ("),os=o("code"),Op=t("str"),Ip=t(", "),ns=o("em"),Sp=t("optional"),Mp=t(`):
Whether to use MLflow nested runs. If set to `),ss=o("code"),xp=t("True"),Np=t(" or "),ls=o("em"),Pp=t("1"),Fp=t(`, will create a nested run inside the current
run.`),Wp=c(),te=o("li"),is=o("strong"),Rp=t("MLFLOW_RUN_ID"),jp=t(" ("),cs=o("code"),zp=t("str"),Bp=t(", "),ds=o("em"),Gp=t("optional"),Vp=t(`):
Allow to reattach to an existing run which can be usefull when resuming training from a checkpoint. When
`),fs=o("code"),Hp=t("MLFLOW_RUN_ID"),Up=t(" environment variable is set, "),hs=o("code"),qp=t("start_run"),Jp=t(` attempts to resume a run with the specified run ID
and other parameters are ignored.`),Yp=c(),ce=o("li"),ms=o("strong"),Xp=t("MLFLOW_FLATTEN_PARAMS"),Kp=t(" ("),ps=o("code"),Qp=t("str"),Zp=t(", "),gs=o("em"),eg=t("optional"),tg=t(", defaults to "),us=o("code"),rg=t("False"),ag=t(`):
Whether to flatten the parameters dictionary before logging.`),Fl=c(),Ue=o("div"),u(Mr.$$.fragment),og=c(),qe=o("p"),ng=t("A "),no=o("a"),sg=t("TrainerCallback"),lg=t(" that sends the logs to "),xr=o("a"),ig=t("AzureML"),cg=t("."),Wl=c(),Je=o("div"),u(Nr.$$.fragment),dg=c(),Pr=o("p"),fg=t("A "),so=o("a"),hg=t("TrainerCallback"),mg=t(" that tracks the CO2 emission of training."),Rl=c(),Ye=o("div"),u(Fr.$$.fragment),pg=c(),Wr=o("p"),gg=t("TrainerCallback that sends the logs to "),Rr=o("a"),ug=t("Neptune"),vg=t("."),jl=c(),re=o("div"),u(jr.$$.fragment),_g=c(),Xe=o("p"),bg=t("A "),lo=o("a"),Eg=t("TrainerCallback"),kg=t(" that sends the logs to "),zr=o("a"),$g=t("ClearML"),Cg=t("."),Tg=c(),vs=o("p"),wg=t("Environment:"),yg=c(),Ke=o("ul"),de=o("li"),_s=o("strong"),Ag=t("CLEARML_PROJECT"),Lg=t(" ("),bs=o("code"),Dg=t("str"),Og=t(", "),Es=o("em"),Ig=t("optional"),Sg=t(", defaults to "),ks=o("code"),Mg=t("HuggingFace Transformers"),xg=t(`):
ClearML project name.`),Ng=c(),fe=o("li"),$s=o("strong"),Pg=t("CLEARML_TASK"),Fg=t(" ("),Cs=o("code"),Wg=t("str"),Rg=t(", "),Ts=o("em"),jg=t("optional"),zg=t(", defaults to "),ws=o("code"),Bg=t("Trainer"),Gg=t(`):
ClearML task name.`),Vg=c(),he=o("li"),ys=o("strong"),Hg=t("CLEARML_LOG_MODEL"),Ug=t(" ("),As=o("code"),qg=t("bool"),Jg=t(", "),Ls=o("em"),Yg=t("optional"),Xg=t(", defaults to "),Ds=o("code"),Kg=t("False"),Qg=t(`):
Whether to log models as artifacts during training.`),zl=c(),ye=o("div"),u(Br.$$.fragment),Zg=c(),Me=o("p"),eu=t("A "),io=o("a"),tu=t("TrainerCallback"),ru=t(" that logs to "),Gr=o("a"),au=t("DagsHub"),ou=t(". Extends "),Os=o("code"),nu=t("MLflowCallback"),su=c(),me=o("div"),u(Vr.$$.fragment),lu=c(),Is=o("p"),iu=t("Setup the DagsHub\u2019s Logging integration."),cu=c(),Ss=o("p"),du=t("Environment:"),fu=c(),Ms=o("ul"),pe=o("li"),xs=o("strong"),hu=t("HF_DAGSHUB_LOG_ARTIFACTS"),mu=t(" ("),Ns=o("code"),pu=t("str"),gu=t(", "),Ps=o("em"),uu=t("optional"),vu=t(`):
Whether to save the data and model artifacts for the experiment. Default to `),Fs=o("code"),_u=t("False"),bu=t("."),Bl=c(),Qe=o("h2"),Ct=o("a"),Ws=o("span"),u(Hr.$$.fragment),Eu=c(),Rs=o("span"),ku=t("TrainerCallback"),Gl=c(),$=o("div"),u(Ur.$$.fragment),$u=c(),js=o("p"),Cu=t(`A class for objects that will inspect the state of the training loop at some events and take some decisions. At
each of those events the following arguments are available:`),Tu=c(),qr=o("p"),wu=t("The "),zs=o("code"),yu=t("control"),Au=t(` object is the only one that can be changed by the callback, in which case the event that changes it
should return the modified version.`),Lu=c(),U=o("p"),Du=t("The argument "),Bs=o("code"),Ou=t("args"),Iu=t(", "),Gs=o("code"),Su=t("state"),Mu=t(" and "),Vs=o("code"),xu=t("control"),Nu=t(" are positionals for all events, all the others are grouped in "),Hs=o("code"),Pu=t("kwargs"),Fu=t(`.
You can unpack the ones you need in the signature of the event using them. As an example, see the code of the
simple `),Us=o("code"),Wu=t("~transformer.PrinterCallback"),Ru=t("."),ju=c(),u(Tt.$$.fragment),zu=c(),wt=o("div"),u(Jr.$$.fragment),Bu=c(),qs=o("p"),Gu=t("Event called at the beginning of an epoch."),Vu=c(),yt=o("div"),u(Yr.$$.fragment),Hu=c(),Js=o("p"),Uu=t("Event called at the end of an epoch."),qu=c(),At=o("div"),u(Xr.$$.fragment),Ju=c(),Ys=o("p"),Yu=t("Event called after an evaluation phase."),Xu=c(),Lt=o("div"),u(Kr.$$.fragment),Ku=c(),Qr=o("p"),Qu=t("Event called at the end of the initialization of the "),co=o("a"),Zu=t("Trainer"),ev=t("."),tv=c(),Dt=o("div"),u(Zr.$$.fragment),rv=c(),Xs=o("p"),av=t("Event called after logging the last logs."),ov=c(),Ot=o("div"),u(ea.$$.fragment),nv=c(),Ks=o("p"),sv=t("Event called after a successful prediction."),lv=c(),It=o("div"),u(ta.$$.fragment),iv=c(),Qs=o("p"),cv=t("Event called after a prediction step."),dv=c(),St=o("div"),u(ra.$$.fragment),fv=c(),Zs=o("p"),hv=t("Event called after a checkpoint save."),mv=c(),Mt=o("div"),u(aa.$$.fragment),pv=c(),el=o("p"),gv=t(`Event called at the beginning of a training step. If using gradient accumulation, one training step might take
several inputs.`),uv=c(),xt=o("div"),u(oa.$$.fragment),vv=c(),tl=o("p"),_v=t(`Event called at the end of a training step. If using gradient accumulation, one training step might take
several inputs.`),bv=c(),Nt=o("div"),u(na.$$.fragment),Ev=c(),rl=o("p"),kv=t("Event called at the end of an substep during gradient accumulation."),$v=c(),Pt=o("div"),u(sa.$$.fragment),Cv=c(),al=o("p"),Tv=t("Event called at the beginning of training."),wv=c(),Ft=o("div"),u(la.$$.fragment),yv=c(),ol=o("p"),Av=t("Event called at the end of training."),Vl=c(),Wt=o("p"),Lv=t("Here is an example of how to register a custom callback with the PyTorch "),fo=o("a"),Dv=t("Trainer"),Ov=t(":"),Hl=c(),u(ia.$$.fragment),Ul=c(),Rt=o("p"),Iv=t("Another way to register a callback is to call "),nl=o("code"),Sv=t("trainer.add_callback()"),Mv=t(" as follows:"),ql=c(),u(ca.$$.fragment),Jl=c(),Ze=o("h2"),jt=o("a"),sl=o("span"),u(da.$$.fragment),xv=c(),ll=o("span"),Nv=t("TrainerState"),Yl=c(),q=o("div"),u(fa.$$.fragment),Pv=c(),et=o("p"),Fv=t("A class containing the "),ho=o("a"),Wv=t("Trainer"),Rv=t(` inner state that will be saved along the model and optimizer when checkpointing
and passed to the `),mo=o("a"),jv=t("TrainerCallback"),zv=t("."),Bv=c(),u(zt.$$.fragment),Gv=c(),Bt=o("div"),u(ha.$$.fragment),Vv=c(),ma=o("p"),Hv=t("Create an instance from the content of "),il=o("code"),Uv=t("json_path"),qv=t("."),Jv=c(),Gt=o("div"),u(pa.$$.fragment),Yv=c(),ga=o("p"),Xv=t("Save the content of this instance in JSON format inside "),cl=o("code"),Kv=t("json_path"),Qv=t("."),Xl=c(),tt=o("h2"),Vt=o("a"),dl=o("span"),u(ua.$$.fragment),Zv=c(),fl=o("span"),e_=t("TrainerControl"),Kl=c(),rt=o("div"),u(va.$$.fragment),t_=c(),at=o("p"),r_=t("A class that handles the "),po=o("a"),a_=t("Trainer"),o_=t(" control flow. This class is used by the "),go=o("a"),n_=t("TrainerCallback"),s_=t(` to activate some
switches in the training loop.`),this.h()},l(l){const f=gE('[data-svelte="svelte-1phssyn"]',document.head);m=n(f,"META",{name:!0,content:!0}),f.forEach(a),D=d(l),E=n(l,"H1",{class:!0});var _a=s(E);C=n(_a,"A",{id:!0,class:!0,href:!0});var hl=s(C);A=n(hl,"SPAN",{});var ml=s(A);v(k.$$.fragment,ml),ml.forEach(a),hl.forEach(a),L=d(_a),w=n(_a,"SPAN",{});var d_=s(w);I=r(d_,"Callbacks"),d_.forEach(a),_a.forEach(a),x=d(l),Y=n(l,"P",{});var Zl=s(Y);Fe=r(Zl,`Callbacks are objects that can customize the behavior of the training loop in the PyTorch
`),$a=n(Zl,"A",{href:!0});var f_=s($a);Hi=r(f_,"Trainer"),f_.forEach(a),Ui=r(Zl,` (this feature is not yet implemented in TensorFlow) that can inspect the training loop
state (for progress reporting, logging on TensorBoard or other ML platforms\u2026) and take decisions (like early
stopping).`),Zl.forEach(a),Cl=d(l),ne=n(l,"P",{});var Ht=s(ne);qi=r(Ht,"Callbacks are \u201Cread only\u201D pieces of code, apart from the "),Ca=n(Ht,"A",{href:!0});var h_=s(Ca);Ji=r(h_,"TrainerControl"),h_.forEach(a),Yi=r(Ht,` object they return, they
cannot change anything in the training loop. For customizations that require changes in the training loop, you should
subclass `),Ta=n(Ht,"A",{href:!0});var m_=s(Ta);Xi=r(m_,"Trainer"),m_.forEach(a),Ki=r(Ht," and override the methods you need (see "),wa=n(Ht,"A",{href:!0});var p_=s(wa);Qi=r(p_,"trainer"),p_.forEach(a),Zi=r(Ht," for examples)."),Ht.forEach(a),Tl=d(l),ft=n(l,"P",{});var ei=s(ft);ec=r(ei,"By default a "),ya=n(ei,"A",{href:!0});var g_=s(ya);tc=r(g_,"Trainer"),g_.forEach(a),rc=r(ei," will use the following callbacks:"),ei.forEach(a),wl=d(l),S=n(l,"UL",{});var P=s(S);Aa=n(P,"LI",{});var l_=s(Aa);La=n(l_,"A",{href:!0});var u_=s(La);ac=r(u_,"DefaultFlowCallback"),u_.forEach(a),oc=r(l_," which handles the default behavior for logging, saving and evaluation."),l_.forEach(a),nc=d(P),Ie=n(P,"LI",{});var ba=s(Ie);Da=n(ba,"A",{href:!0});var v_=s(Da);sc=r(v_,"PrinterCallback"),v_.forEach(a),lc=r(ba," or "),Oa=n(ba,"A",{href:!0});var __=s(Oa);ic=r(__,"ProgressCallback"),__.forEach(a),cc=r(ba,` to display progress and print the
logs (the first one is used if you deactivate tqdm through the `),Ia=n(ba,"A",{href:!0});var b_=s(Ia);dc=r(b_,"TrainingArguments"),b_.forEach(a),fc=r(ba,`, otherwise
it\u2019s the second one).`),ba.forEach(a),hc=d(P),Sa=n(P,"LI",{});var i_=s(Sa);Ma=n(i_,"A",{href:!0});var E_=s(Ma);mc=r(E_,"TensorBoardCallback"),E_.forEach(a),pc=r(i_,` if tensorboard is accessible (either through PyTorch >= 1.4
or tensorboardX).`),i_.forEach(a),gc=d(P),ht=n(P,"LI",{});var pl=s(ht);xa=n(pl,"A",{href:!0});var k_=s(xa);uc=r(k_,"WandbCallback"),k_.forEach(a),vc=r(pl," if "),Zt=n(pl,"A",{href:!0,rel:!0});var $_=s(Zt);_c=r($_,"wandb"),$_.forEach(a),bc=r(pl," is installed."),pl.forEach(a),Ec=d(P),mt=n(P,"LI",{});var gl=s(mt);Na=n(gl,"A",{href:!0});var C_=s(Na);kc=r(C_,"CometCallback"),C_.forEach(a),$c=r(gl," if "),er=n(gl,"A",{href:!0,rel:!0});var T_=s(er);Cc=r(T_,"comet_ml"),T_.forEach(a),Tc=r(gl," is installed."),gl.forEach(a),wc=d(P),pt=n(P,"LI",{});var ul=s(pt);Pa=n(ul,"A",{href:!0});var w_=s(Pa);yc=r(w_,"MLflowCallback"),w_.forEach(a),Ac=r(ul," if "),tr=n(ul,"A",{href:!0,rel:!0});var y_=s(tr);Lc=r(y_,"mlflow"),y_.forEach(a),Dc=r(ul," is installed."),ul.forEach(a),Oc=d(P),gt=n(P,"LI",{});var vl=s(gt);Fa=n(vl,"A",{href:!0});var A_=s(Fa);Ic=r(A_,"NeptuneCallback"),A_.forEach(a),Sc=r(vl," if "),rr=n(vl,"A",{href:!0,rel:!0});var L_=s(rr);Mc=r(L_,"neptune"),L_.forEach(a),xc=r(vl," is installed."),vl.forEach(a),Nc=d(P),ut=n(P,"LI",{});var _l=s(ut);Wa=n(_l,"A",{href:!0});var D_=s(Wa);Pc=r(D_,"AzureMLCallback"),D_.forEach(a),Fc=r(_l," if "),ar=n(_l,"A",{href:!0,rel:!0});var O_=s(ar);Wc=r(O_,"azureml-sdk"),O_.forEach(a),Rc=r(_l,` is
installed.`),_l.forEach(a),jc=d(P),vt=n(P,"LI",{});var bl=s(vt);Ra=n(bl,"A",{href:!0});var I_=s(Ra);zc=r(I_,"CodeCarbonCallback"),I_.forEach(a),Bc=r(bl," if "),or=n(bl,"A",{href:!0,rel:!0});var S_=s(or);Gc=r(S_,"codecarbon"),S_.forEach(a),Vc=r(bl,` is
installed.`),bl.forEach(a),Hc=d(P),_t=n(P,"LI",{});var El=s(_t);ja=n(El,"A",{href:!0});var M_=s(ja);Uc=r(M_,"ClearMLCallback"),M_.forEach(a),qc=r(El," if "),nr=n(El,"A",{href:!0,rel:!0});var x_=s(nr);Jc=r(x_,"clearml"),x_.forEach(a),Yc=r(El," is installed."),El.forEach(a),Xc=d(P),bt=n(P,"LI",{});var kl=s(bt);za=n(kl,"A",{href:!0});var N_=s(za);Kc=r(N_,"DagsHubCallback"),N_.forEach(a),Qc=r(kl," if "),sr=n(kl,"A",{href:!0,rel:!0});var P_=s(sr);Zc=r(P_,"dagshub"),P_.forEach(a),ed=r(kl," is installed."),kl.forEach(a),P.forEach(a),yl=d(l),B=n(l,"P",{});var ge=s(B);td=r(ge,"The main class that implements callbacks is "),Ba=n(ge,"A",{href:!0});var F_=s(Ba);rd=r(F_,"TrainerCallback"),F_.forEach(a),ad=r(ge,`. It gets the
`),Ga=n(ge,"A",{href:!0});var W_=s(Ga);od=r(W_,"TrainingArguments"),W_.forEach(a),nd=r(ge," used to instantiate the "),Va=n(ge,"A",{href:!0});var R_=s(Va);sd=r(R_,"Trainer"),R_.forEach(a),ld=r(ge,`, can access that
Trainer\u2019s internal state via `),Ha=n(ge,"A",{href:!0});var j_=s(Ha);id=r(j_,"TrainerState"),j_.forEach(a),cd=r(ge,`, and can take some actions on the training loop via
`),Ua=n(ge,"A",{href:!0});var z_=s(Ua);dd=r(z_,"TrainerControl"),z_.forEach(a),fd=r(ge,"."),ge.forEach(a),Al=d(l),We=n(l,"H2",{class:!0});var ti=s(We);Et=n(ti,"A",{id:!0,class:!0,href:!0});var B_=s(Et);Do=n(B_,"SPAN",{});var G_=s(Do);v(lr.$$.fragment,G_),G_.forEach(a),B_.forEach(a),hd=d(ti),Oo=n(ti,"SPAN",{});var V_=s(Oo);md=r(V_,"Available Callbacks"),V_.forEach(a),ti.forEach(a),Ll=d(l),kt=n(l,"P",{});var ri=s(kt);pd=r(ri,"Here is the list of the available "),qa=n(ri,"A",{href:!0});var H_=s(qa);gd=r(H_,"TrainerCallback"),H_.forEach(a),ud=r(ri," in the library:"),ri.forEach(a),Dl=d(l),_e=n(l,"DIV",{class:!0});var uo=s(_e);v(ir.$$.fragment,uo),vd=d(uo),Re=n(uo,"P",{});var vo=s(Re);_d=r(vo,"A "),Ja=n(vo,"A",{href:!0});var U_=s(Ja);bd=r(U_,"TrainerCallback"),U_.forEach(a),Ed=r(vo," that sends the logs to "),cr=n(vo,"A",{href:!0,rel:!0});var q_=s(cr);kd=r(q_,"Comet ML"),q_.forEach(a),$d=r(vo,"."),vo.forEach(a),Cd=d(uo),X=n(uo,"DIV",{class:!0});var xe=s(X);v(dr.$$.fragment,xe),Td=d(xe),Io=n(xe,"P",{});var J_=s(Io);wd=r(J_,"Setup the optional Comet.ml integration."),J_.forEach(a),yd=d(xe),So=n(xe,"P",{});var Y_=s(So);Ad=r(Y_,"Environment:"),Y_.forEach(a),Ld=d(xe),be=n(xe,"UL",{});var Ut=s(be);j=n(Ut,"LI",{});var J=s(j);Mo=n(J,"STRONG",{});var X_=s(Mo);Dd=r(X_,"COMET_MODE"),X_.forEach(a),Od=r(J," ("),xo=n(J,"CODE",{});var K_=s(xo);Id=r(K_,"str"),K_.forEach(a),Sd=r(J,", "),No=n(J,"EM",{});var Q_=s(No);Md=r(Q_,"optional"),Q_.forEach(a),xd=r(J,", defaults to "),Po=n(J,"CODE",{});var Z_=s(Po);Nd=r(Z_,"ONLINE"),Z_.forEach(a),Pd=r(J,`):
Whether to create an online, offline experiment or disable Comet logging. Can be `),Fo=n(J,"CODE",{});var eb=s(Fo);Fd=r(eb,"OFFLINE"),eb.forEach(a),Wd=r(J,", "),Wo=n(J,"CODE",{});var tb=s(Wo);Rd=r(tb,"ONLINE"),tb.forEach(a),jd=r(J,`, or
`),Ro=n(J,"CODE",{});var rb=s(Ro);zd=r(rb,"DISABLED"),rb.forEach(a),Bd=r(J,"."),J.forEach(a),Gd=d(Ut),Se=n(Ut,"LI",{});var Ea=s(Se);jo=n(Ea,"STRONG",{});var ab=s(jo);Vd=r(ab,"COMET_PROJECT_NAME"),ab.forEach(a),Hd=r(Ea," ("),zo=n(Ea,"CODE",{});var ob=s(zo);Ud=r(ob,"str"),ob.forEach(a),qd=r(Ea,", "),Bo=n(Ea,"EM",{});var nb=s(Bo);Jd=r(nb,"optional"),nb.forEach(a),Yd=r(Ea,`):
Comet project name for experiments.`),Ea.forEach(a),Xd=d(Ut),K=n(Ut,"LI",{});var Ae=s(K);Go=n(Ae,"STRONG",{});var sb=s(Go);Kd=r(sb,"COMET_OFFLINE_DIRECTORY"),sb.forEach(a),Qd=r(Ae," ("),Vo=n(Ae,"CODE",{});var lb=s(Vo);Zd=r(lb,"str"),lb.forEach(a),ef=r(Ae,", "),Ho=n(Ae,"EM",{});var ib=s(Ho);tf=r(ib,"optional"),ib.forEach(a),rf=r(Ae,`):
Folder to use for saving offline experiments when `),Uo=n(Ae,"CODE",{});var cb=s(Uo);af=r(cb,"COMET_MODE"),cb.forEach(a),of=r(Ae," is "),qo=n(Ae,"CODE",{});var db=s(qo);nf=r(db,"OFFLINE"),db.forEach(a),sf=r(Ae,"."),Ae.forEach(a),lf=d(Ut),G=n(Ut,"LI",{});var ae=s(G);Jo=n(ae,"STRONG",{});var fb=s(Jo);cf=r(fb,"COMET_LOG_ASSETS"),fb.forEach(a),df=r(ae," ("),Yo=n(ae,"CODE",{});var hb=s(Yo);ff=r(hb,"str"),hb.forEach(a),hf=r(ae,", "),Xo=n(ae,"EM",{});var mb=s(Xo);mf=r(mb,"optional"),mb.forEach(a),pf=r(ae,", defaults to "),Ko=n(ae,"CODE",{});var pb=s(Ko);gf=r(pb,"TRUE"),pb.forEach(a),uf=r(ae,`):
Whether or not to log training assets (tf event logs, checkpoints, etc), to Comet. Can be `),Qo=n(ae,"CODE",{});var gb=s(Qo);vf=r(gb,"TRUE"),gb.forEach(a),_f=r(ae,`, or
`),Zo=n(ae,"CODE",{});var ub=s(Zo);bf=r(ub,"FALSE"),ub.forEach(a),Ef=r(ae,"."),ae.forEach(a),Ut.forEach(a),kf=d(xe),fr=n(xe,"P",{});var ai=s(fr);$f=r(ai,`For a number of configurable items in the environment, see
`),hr=n(ai,"A",{href:!0,rel:!0});var vb=s(hr);Cf=r(vb,"here"),vb.forEach(a),Tf=r(ai,"."),ai.forEach(a),xe.forEach(a),uo.forEach(a),Ol=d(l),je=n(l,"DIV",{class:!0});var oi=s(je);v(mr.$$.fragment,oi),wf=d(oi),pr=n(oi,"P",{});var ni=s(pr);yf=r(ni,"A "),Ya=n(ni,"A",{href:!0});var _b=s(Ya);Af=r(_b,"TrainerCallback"),_b.forEach(a),Lf=r(ni," that handles the default flow of the training loop for logs, evaluation and checkpoints."),ni.forEach(a),oi.forEach(a),Il=d(l),ze=n(l,"DIV",{class:!0});var si=s(ze);v(gr.$$.fragment,si),Df=d(si),ur=n(si,"P",{});var li=s(ur);Of=r(li,"A bare "),Xa=n(li,"A",{href:!0});var bb=s(Xa);If=r(bb,"TrainerCallback"),bb.forEach(a),Sf=r(li," that just prints the logs."),li.forEach(a),si.forEach(a),Sl=d(l),Be=n(l,"DIV",{class:!0});var ii=s(Be);v(vr.$$.fragment,ii),Mf=d(ii),_r=n(ii,"P",{});var ci=s(_r);xf=r(ci,"A "),Ka=n(ci,"A",{href:!0});var Eb=s(Ka);Nf=r(Eb,"TrainerCallback"),Eb.forEach(a),Pf=r(ci," that displays the progress of training or evaluation."),ci.forEach(a),ii.forEach(a),Ml=d(l),Ee=n(l,"DIV",{class:!0});var _o=s(Ee);v(br.$$.fragment,_o),Ff=d(_o),Er=n(_o,"P",{});var di=s(Er);Wf=r(di,"A "),Qa=n(di,"A",{href:!0});var kb=s(Qa);Rf=r(kb,"TrainerCallback"),kb.forEach(a),jf=r(di," that handles early stopping."),di.forEach(a),zf=d(_o),ke=n(_o,"P",{});var qt=s(ke);Bf=r(qt,"This callback depends on "),Za=n(qt,"A",{href:!0});var $b=s(Za);Gf=r($b,"TrainingArguments"),$b.forEach(a),Vf=r(qt," argument "),en=n(qt,"EM",{});var Cb=s(en);Hf=r(Cb,"load_best_model_at_end"),Cb.forEach(a),Uf=r(qt,` functionality to set best_metric
in `),eo=n(qt,"A",{href:!0});var Tb=s(eo);qf=r(Tb,"TrainerState"),Tb.forEach(a),Jf=r(qt,"."),qt.forEach(a),_o.forEach(a),xl=d(l),Ge=n(l,"DIV",{class:!0});var fi=s(Ge);v(kr.$$.fragment,fi),Yf=d(fi),Ve=n(fi,"P",{});var bo=s(Ve);Xf=r(bo,"A "),to=n(bo,"A",{href:!0});var wb=s(to);Kf=r(wb,"TrainerCallback"),wb.forEach(a),Qf=r(bo," that sends the logs to "),$r=n(bo,"A",{href:!0,rel:!0});var yb=s($r);Zf=r(yb,"TensorBoard"),yb.forEach(a),eh=r(bo,"."),bo.forEach(a),fi.forEach(a),Nl=d(l),$e=n(l,"DIV",{class:!0});var Eo=s($e);v(Cr.$$.fragment,Eo),th=d(Eo),He=n(Eo,"P",{});var ko=s(He);rh=r(ko,"A "),ro=n(ko,"A",{href:!0});var Ab=s(ro);ah=r(Ab,"TrainerCallback"),Ab.forEach(a),oh=r(ko," that logs metrics, media, model checkpoints to "),Tr=n(ko,"A",{href:!0,rel:!0});var Lb=s(Tr);nh=r(Lb,"Weight and Biases"),Lb.forEach(a),sh=r(ko,"."),ko.forEach(a),lh=d(Eo),Q=n(Eo,"DIV",{class:!0});var Ne=s(Q);v(wr.$$.fragment,Ne),ih=d(Ne),yr=n(Ne,"P",{});var hi=s(yr);ch=r(hi,"Setup the optional Weights & Biases ("),tn=n(hi,"EM",{});var Db=s(tn);dh=r(Db,"wandb"),Db.forEach(a),fh=r(hi,") integration."),hi.forEach(a),hh=d(Ne),Ar=n(Ne,"P",{});var mi=s(Ar);mh=r(mi,`One can subclass and override this method to customize the setup if needed. Find more information
`),Lr=n(mi,"A",{href:!0,rel:!0});var Ob=s(Lr);ph=r(Ob,"here"),Ob.forEach(a),gh=r(mi,`. You can also override the following environment
variables:`),mi.forEach(a),uh=d(Ne),rn=n(Ne,"P",{});var Ib=s(rn);vh=r(Ib,"Environment:"),Ib.forEach(a),_h=d(Ne),Ce=n(Ne,"UL",{});var Jt=s(Ce);Dr=n(Jt,"LI",{});var pi=s(Dr);O=n(pi,"P",{});var M=s(O);an=n(M,"STRONG",{});var Sb=s(an);bh=r(Sb,"WANDB_LOG_MODEL"),Sb.forEach(a),Eh=r(M," ("),on=n(M,"CODE",{});var Mb=s(on);kh=r(Mb,"str"),Mb.forEach(a),$h=r(M,", "),nn=n(M,"EM",{});var xb=s(nn);Ch=r(xb,"optional"),xb.forEach(a),Th=r(M,", defaults to "),sn=n(M,"CODE",{});var Nb=s(sn);wh=r(Nb,'"false"'),Nb.forEach(a),yh=r(M,`):
Whether to log model and checkpoints during training. Can be `),ln=n(M,"CODE",{});var Pb=s(ln);Ah=r(Pb,'"end"'),Pb.forEach(a),Lh=r(M,", "),cn=n(M,"CODE",{});var Fb=s(cn);Dh=r(Fb,'"checkpoint"'),Fb.forEach(a),Oh=r(M," or "),dn=n(M,"CODE",{});var Wb=s(dn);Ih=r(Wb,'"false"'),Wb.forEach(a),Sh=r(M,`. If set
to `),fn=n(M,"CODE",{});var Rb=s(fn);Mh=r(Rb,'"end"'),Rb.forEach(a),xh=r(M,", the model will be uploaded at the end of training. If set to "),hn=n(M,"CODE",{});var jb=s(hn);Nh=r(jb,'"checkpoint"'),jb.forEach(a),Ph=r(M,`, the checkpoint
will be uploaded every `),mn=n(M,"CODE",{});var zb=s(mn);Fh=r(zb,"args.save_steps"),zb.forEach(a),Wh=r(M," . If set to "),pn=n(M,"CODE",{});var Bb=s(pn);Rh=r(Bb,'"false"'),Bb.forEach(a),jh=r(M,`, the model will not be uploaded. Use along
with `),gn=n(M,"CODE",{});var Gb=s(gn);zh=r(Gb,"load_best_model_at_end()"),Gb.forEach(a),Bh=r(M," to upload best model."),M.forEach(a),Gh=d(pi),v($t.$$.fragment,pi),pi.forEach(a),Vh=d(Jt),un=n(Jt,"LI",{});var Vb=s(un);N=n(Vb,"P",{});var R=s(N);vn=n(R,"STRONG",{});var Hb=s(vn);Hh=r(Hb,"WANDB_WATCH"),Hb.forEach(a),Uh=r(R," ("),_n=n(R,"CODE",{});var Ub=s(_n);qh=r(Ub,"str"),Ub.forEach(a),Jh=r(R,", "),bn=n(R,"EM",{});var qb=s(bn);Yh=r(qb,"optional"),qb.forEach(a),Xh=r(R," defaults to "),En=n(R,"CODE",{});var Jb=s(En);Kh=r(Jb,'"false"'),Jb.forEach(a),Qh=r(R,`):
Can be `),kn=n(R,"CODE",{});var Yb=s(kn);Zh=r(Yb,'"gradients"'),Yb.forEach(a),em=r(R,", "),$n=n(R,"CODE",{});var Xb=s($n);tm=r(Xb,'"all"'),Xb.forEach(a),rm=r(R,", "),Cn=n(R,"CODE",{});var Kb=s(Cn);am=r(Kb,'"parameters"'),Kb.forEach(a),om=r(R,", or "),Tn=n(R,"CODE",{});var Qb=s(Tn);nm=r(Qb,'"false"'),Qb.forEach(a),sm=r(R,". Set to "),wn=n(R,"CODE",{});var Zb=s(wn);lm=r(Zb,'"all"'),Zb.forEach(a),im=r(R,` to log gradients and
parameters.`),R.forEach(a),Vb.forEach(a),cm=d(Jt),yn=n(Jt,"LI",{});var e1=s(yn);se=n(e1,"P",{});var ot=s(se);An=n(ot,"STRONG",{});var t1=s(An);dm=r(t1,"WANDB_PROJECT"),t1.forEach(a),fm=r(ot," ("),Ln=n(ot,"CODE",{});var r1=s(Ln);hm=r(r1,"str"),r1.forEach(a),mm=r(ot,", "),Dn=n(ot,"EM",{});var a1=s(Dn);pm=r(a1,"optional"),a1.forEach(a),gm=r(ot,", defaults to "),On=n(ot,"CODE",{});var o1=s(On);um=r(o1,'"huggingface"'),o1.forEach(a),vm=r(ot,`):
Set this to a custom string to store results in a different project.`),ot.forEach(a),e1.forEach(a),_m=d(Jt),In=n(Jt,"LI",{});var n1=s(In);Z=n(n1,"P",{});var Le=s(Z);Sn=n(Le,"STRONG",{});var s1=s(Sn);bm=r(s1,"WANDB_DISABLED"),s1.forEach(a),Em=r(Le," ("),Mn=n(Le,"CODE",{});var l1=s(Mn);km=r(l1,"bool"),l1.forEach(a),$m=r(Le,", "),xn=n(Le,"EM",{});var i1=s(xn);Cm=r(i1,"optional"),i1.forEach(a),Tm=r(Le,", defaults to "),Nn=n(Le,"CODE",{});var c1=s(Nn);wm=r(c1,"False"),c1.forEach(a),ym=r(Le,`):
Whether to disable wandb entirely. Set `),Pn=n(Le,"CODE",{});var d1=s(Pn);Am=r(d1,"WANDB_DISABLED=true"),d1.forEach(a),Lm=r(Le," to disable."),Le.forEach(a),n1.forEach(a),Jt.forEach(a),Ne.forEach(a),Eo.forEach(a),Pl=d(l),Te=n(l,"DIV",{class:!0});var $o=s(Te);v(Or.$$.fragment,$o),Dm=d($o),we=n($o,"P",{});var Yt=s(we);Om=r(Yt,"A "),ao=n(Yt,"A",{href:!0});var f1=s(ao);Im=r(f1,"TrainerCallback"),f1.forEach(a),Sm=r(Yt," that sends the logs to "),Ir=n(Yt,"A",{href:!0,rel:!0});var h1=s(Ir);Mm=r(h1,"MLflow"),h1.forEach(a),xm=r(Yt,`. Can be disabled by setting
environment variable `),Fn=n(Yt,"CODE",{});var m1=s(Fn);Nm=r(m1,"DISABLE_MLFLOW_INTEGRATION = TRUE"),m1.forEach(a),Pm=r(Yt,"."),Yt.forEach(a),Fm=d($o),le=n($o,"DIV",{class:!0});var Xt=s(le);v(Sr.$$.fragment,Xt),Wm=d(Xt),Wn=n(Xt,"P",{});var p1=s(Wn);Rm=r(p1,"Setup the optional MLflow integration."),p1.forEach(a),jm=d(Xt),Rn=n(Xt,"P",{});var g1=s(Rn);zm=r(g1,"Environment:"),g1.forEach(a),Bm=d(Xt),H=n(Xt,"UL",{});var ue=s(H);F=n(ue,"LI",{});var z=s(F);jn=n(z,"STRONG",{});var u1=s(jn);Gm=r(u1,"HF_MLFLOW_LOG_ARTIFACTS"),u1.forEach(a),Vm=r(z," ("),zn=n(z,"CODE",{});var v1=s(zn);Hm=r(v1,"str"),v1.forEach(a),Um=r(z,", "),Bn=n(z,"EM",{});var _1=s(Bn);qm=r(_1,"optional"),_1.forEach(a),Jm=r(z,`):
Whether to use MLflow `),Gn=n(z,"CODE",{});var b1=s(Gn);Ym=r(b1,".log_artifact()"),b1.forEach(a),Xm=r(z,` facility to log artifacts. This only makes sense if logging to a
remote server, e.g. s3 or GCS. If set to `),Vn=n(z,"CODE",{});var E1=s(Vn);Km=r(E1,"True"),E1.forEach(a),Qm=r(z," or "),Hn=n(z,"EM",{});var k1=s(Hn);Zm=r(k1,"1"),k1.forEach(a),ep=r(z,`, will copy each saved checkpoint on each save in
`),oo=n(z,"A",{href:!0});var $1=s(oo);tp=r($1,"TrainingArguments"),$1.forEach(a),rp=r(z,"\u2019s "),Un=n(z,"CODE",{});var C1=s(Un);ap=r(C1,"output_dir"),C1.forEach(a),op=r(z,` to the local or remote artifact storage. Using it without a remote
storage will just copy the files to your artifact location.`),z.forEach(a),np=d(ue),V=n(ue,"LI",{});var oe=s(V);qn=n(oe,"STRONG",{});var T1=s(qn);sp=r(T1,"MLFLOW_EXPERIMENT_NAME"),T1.forEach(a),lp=r(oe," ("),Jn=n(oe,"CODE",{});var w1=s(Jn);ip=r(w1,"str"),w1.forEach(a),cp=r(oe,", "),Yn=n(oe,"EM",{});var y1=s(Yn);dp=r(y1,"optional"),y1.forEach(a),fp=r(oe,", defaults to "),Xn=n(oe,"CODE",{});var A1=s(Xn);hp=r(A1,"None"),A1.forEach(a),mp=r(oe,`):
Whether to use an MLflow experiment_name under which to launch the run. Default to `),Kn=n(oe,"CODE",{});var L1=s(Kn);pp=r(L1,"None"),L1.forEach(a),gp=r(oe,` which will point
to the `),Qn=n(oe,"CODE",{});var D1=s(Qn);up=r(D1,"Default"),D1.forEach(a),vp=r(oe,` experiment in MLflow. Otherwise, it is a case sensitive name of the experiment to be
activated. If an experiment with this name does not exist, a new experiment with this name is created.`),oe.forEach(a),_p=d(ue),ie=n(ue,"LI",{});var nt=s(ie);Zn=n(nt,"STRONG",{});var O1=s(Zn);bp=r(O1,"MLFLOW_TAGS"),O1.forEach(a),Ep=r(nt," ("),es=n(nt,"CODE",{});var I1=s(es);kp=r(I1,"str"),I1.forEach(a),$p=r(nt,", "),ts=n(nt,"EM",{});var S1=s(ts);Cp=r(S1,"optional"),S1.forEach(a),Tp=r(nt,`):
A string dump of a dictionary of key/value pair to be added to the MLflow run as tags. Example:
`),rs=n(nt,"CODE",{});var M1=s(rs);wp=r(M1,`os.environ['MLFLOW_TAGS']='{"release.candidate": "RC1", "release.version": "2.2.0"}'`),M1.forEach(a),yp=r(nt,"."),nt.forEach(a),Ap=d(ue),ee=n(ue,"LI",{});var De=s(ee);as=n(De,"STRONG",{});var x1=s(as);Lp=r(x1,"MLFLOW_NESTED_RUN"),x1.forEach(a),Dp=r(De," ("),os=n(De,"CODE",{});var N1=s(os);Op=r(N1,"str"),N1.forEach(a),Ip=r(De,", "),ns=n(De,"EM",{});var P1=s(ns);Sp=r(P1,"optional"),P1.forEach(a),Mp=r(De,`):
Whether to use MLflow nested runs. If set to `),ss=n(De,"CODE",{});var F1=s(ss);xp=r(F1,"True"),F1.forEach(a),Np=r(De," or "),ls=n(De,"EM",{});var W1=s(ls);Pp=r(W1,"1"),W1.forEach(a),Fp=r(De,`, will create a nested run inside the current
run.`),De.forEach(a),Wp=d(ue),te=n(ue,"LI",{});var Oe=s(te);is=n(Oe,"STRONG",{});var R1=s(is);Rp=r(R1,"MLFLOW_RUN_ID"),R1.forEach(a),jp=r(Oe," ("),cs=n(Oe,"CODE",{});var j1=s(cs);zp=r(j1,"str"),j1.forEach(a),Bp=r(Oe,", "),ds=n(Oe,"EM",{});var z1=s(ds);Gp=r(z1,"optional"),z1.forEach(a),Vp=r(Oe,`):
Allow to reattach to an existing run which can be usefull when resuming training from a checkpoint. When
`),fs=n(Oe,"CODE",{});var B1=s(fs);Hp=r(B1,"MLFLOW_RUN_ID"),B1.forEach(a),Up=r(Oe," environment variable is set, "),hs=n(Oe,"CODE",{});var G1=s(hs);qp=r(G1,"start_run"),G1.forEach(a),Jp=r(Oe,` attempts to resume a run with the specified run ID
and other parameters are ignored.`),Oe.forEach(a),Yp=d(ue),ce=n(ue,"LI",{});var st=s(ce);ms=n(st,"STRONG",{});var V1=s(ms);Xp=r(V1,"MLFLOW_FLATTEN_PARAMS"),V1.forEach(a),Kp=r(st," ("),ps=n(st,"CODE",{});var H1=s(ps);Qp=r(H1,"str"),H1.forEach(a),Zp=r(st,", "),gs=n(st,"EM",{});var U1=s(gs);eg=r(U1,"optional"),U1.forEach(a),tg=r(st,", defaults to "),us=n(st,"CODE",{});var q1=s(us);rg=r(q1,"False"),q1.forEach(a),ag=r(st,`):
Whether to flatten the parameters dictionary before logging.`),st.forEach(a),ue.forEach(a),Xt.forEach(a),$o.forEach(a),Fl=d(l),Ue=n(l,"DIV",{class:!0});var gi=s(Ue);v(Mr.$$.fragment,gi),og=d(gi),qe=n(gi,"P",{});var Co=s(qe);ng=r(Co,"A "),no=n(Co,"A",{href:!0});var J1=s(no);sg=r(J1,"TrainerCallback"),J1.forEach(a),lg=r(Co," that sends the logs to "),xr=n(Co,"A",{href:!0,rel:!0});var Y1=s(xr);ig=r(Y1,"AzureML"),Y1.forEach(a),cg=r(Co,"."),Co.forEach(a),gi.forEach(a),Wl=d(l),Je=n(l,"DIV",{class:!0});var ui=s(Je);v(Nr.$$.fragment,ui),dg=d(ui),Pr=n(ui,"P",{});var vi=s(Pr);fg=r(vi,"A "),so=n(vi,"A",{href:!0});var X1=s(so);hg=r(X1,"TrainerCallback"),X1.forEach(a),mg=r(vi," that tracks the CO2 emission of training."),vi.forEach(a),ui.forEach(a),Rl=d(l),Ye=n(l,"DIV",{class:!0});var _i=s(Ye);v(Fr.$$.fragment,_i),pg=d(_i),Wr=n(_i,"P",{});var bi=s(Wr);gg=r(bi,"TrainerCallback that sends the logs to "),Rr=n(bi,"A",{href:!0,rel:!0});var K1=s(Rr);ug=r(K1,"Neptune"),K1.forEach(a),vg=r(bi,"."),bi.forEach(a),_i.forEach(a),jl=d(l),re=n(l,"DIV",{class:!0});var Kt=s(re);v(jr.$$.fragment,Kt),_g=d(Kt),Xe=n(Kt,"P",{});var To=s(Xe);bg=r(To,"A "),lo=n(To,"A",{href:!0});var Q1=s(lo);Eg=r(Q1,"TrainerCallback"),Q1.forEach(a),kg=r(To," that sends the logs to "),zr=n(To,"A",{href:!0,rel:!0});var Z1=s(zr);$g=r(Z1,"ClearML"),Z1.forEach(a),Cg=r(To,"."),To.forEach(a),Tg=d(Kt),vs=n(Kt,"P",{});var e2=s(vs);wg=r(e2,"Environment:"),e2.forEach(a),yg=d(Kt),Ke=n(Kt,"UL",{});var wo=s(Ke);de=n(wo,"LI",{});var lt=s(de);_s=n(lt,"STRONG",{});var t2=s(_s);Ag=r(t2,"CLEARML_PROJECT"),t2.forEach(a),Lg=r(lt," ("),bs=n(lt,"CODE",{});var r2=s(bs);Dg=r(r2,"str"),r2.forEach(a),Og=r(lt,", "),Es=n(lt,"EM",{});var a2=s(Es);Ig=r(a2,"optional"),a2.forEach(a),Sg=r(lt,", defaults to "),ks=n(lt,"CODE",{});var o2=s(ks);Mg=r(o2,"HuggingFace Transformers"),o2.forEach(a),xg=r(lt,`):
ClearML project name.`),lt.forEach(a),Ng=d(wo),fe=n(wo,"LI",{});var it=s(fe);$s=n(it,"STRONG",{});var n2=s($s);Pg=r(n2,"CLEARML_TASK"),n2.forEach(a),Fg=r(it," ("),Cs=n(it,"CODE",{});var s2=s(Cs);Wg=r(s2,"str"),s2.forEach(a),Rg=r(it,", "),Ts=n(it,"EM",{});var l2=s(Ts);jg=r(l2,"optional"),l2.forEach(a),zg=r(it,", defaults to "),ws=n(it,"CODE",{});var i2=s(ws);Bg=r(i2,"Trainer"),i2.forEach(a),Gg=r(it,`):
ClearML task name.`),it.forEach(a),Vg=d(wo),he=n(wo,"LI",{});var ct=s(he);ys=n(ct,"STRONG",{});var c2=s(ys);Hg=r(c2,"CLEARML_LOG_MODEL"),c2.forEach(a),Ug=r(ct," ("),As=n(ct,"CODE",{});var d2=s(As);qg=r(d2,"bool"),d2.forEach(a),Jg=r(ct,", "),Ls=n(ct,"EM",{});var f2=s(Ls);Yg=r(f2,"optional"),f2.forEach(a),Xg=r(ct,", defaults to "),Ds=n(ct,"CODE",{});var h2=s(Ds);Kg=r(h2,"False"),h2.forEach(a),Qg=r(ct,`):
Whether to log models as artifacts during training.`),ct.forEach(a),wo.forEach(a),Kt.forEach(a),zl=d(l),ye=n(l,"DIV",{class:!0});var yo=s(ye);v(Br.$$.fragment,yo),Zg=d(yo),Me=n(yo,"P",{});var ka=s(Me);eu=r(ka,"A "),io=n(ka,"A",{href:!0});var m2=s(io);tu=r(m2,"TrainerCallback"),m2.forEach(a),ru=r(ka," that logs to "),Gr=n(ka,"A",{href:!0,rel:!0});var p2=s(Gr);au=r(p2,"DagsHub"),p2.forEach(a),ou=r(ka,". Extends "),Os=n(ka,"CODE",{});var g2=s(Os);nu=r(g2,"MLflowCallback"),g2.forEach(a),ka.forEach(a),su=d(yo),me=n(yo,"DIV",{class:!0});var Qt=s(me);v(Vr.$$.fragment,Qt),lu=d(Qt),Is=n(Qt,"P",{});var u2=s(Is);iu=r(u2,"Setup the DagsHub\u2019s Logging integration."),u2.forEach(a),cu=d(Qt),Ss=n(Qt,"P",{});var v2=s(Ss);du=r(v2,"Environment:"),v2.forEach(a),fu=d(Qt),Ms=n(Qt,"UL",{});var _2=s(Ms);pe=n(_2,"LI",{});var dt=s(pe);xs=n(dt,"STRONG",{});var b2=s(xs);hu=r(b2,"HF_DAGSHUB_LOG_ARTIFACTS"),b2.forEach(a),mu=r(dt," ("),Ns=n(dt,"CODE",{});var E2=s(Ns);pu=r(E2,"str"),E2.forEach(a),gu=r(dt,", "),Ps=n(dt,"EM",{});var k2=s(Ps);uu=r(k2,"optional"),k2.forEach(a),vu=r(dt,`):
Whether to save the data and model artifacts for the experiment. Default to `),Fs=n(dt,"CODE",{});var $2=s(Fs);_u=r($2,"False"),$2.forEach(a),bu=r(dt,"."),dt.forEach(a),_2.forEach(a),Qt.forEach(a),yo.forEach(a),Bl=d(l),Qe=n(l,"H2",{class:!0});var Ei=s(Qe);Ct=n(Ei,"A",{id:!0,class:!0,href:!0});var C2=s(Ct);Ws=n(C2,"SPAN",{});var T2=s(Ws);v(Hr.$$.fragment,T2),T2.forEach(a),C2.forEach(a),Eu=d(Ei),Rs=n(Ei,"SPAN",{});var w2=s(Rs);ku=r(w2,"TrainerCallback"),w2.forEach(a),Ei.forEach(a),Gl=d(l),$=n(l,"DIV",{class:!0});var T=s($);v(Ur.$$.fragment,T),$u=d(T),js=n(T,"P",{});var y2=s(js);Cu=r(y2,`A class for objects that will inspect the state of the training loop at some events and take some decisions. At
each of those events the following arguments are available:`),y2.forEach(a),Tu=d(T),qr=n(T,"P",{});var ki=s(qr);wu=r(ki,"The "),zs=n(ki,"CODE",{});var A2=s(zs);yu=r(A2,"control"),A2.forEach(a),Au=r(ki,` object is the only one that can be changed by the callback, in which case the event that changes it
should return the modified version.`),ki.forEach(a),Lu=d(T),U=n(T,"P",{});var ve=s(U);Du=r(ve,"The argument "),Bs=n(ve,"CODE",{});var L2=s(Bs);Ou=r(L2,"args"),L2.forEach(a),Iu=r(ve,", "),Gs=n(ve,"CODE",{});var D2=s(Gs);Su=r(D2,"state"),D2.forEach(a),Mu=r(ve," and "),Vs=n(ve,"CODE",{});var O2=s(Vs);xu=r(O2,"control"),O2.forEach(a),Nu=r(ve," are positionals for all events, all the others are grouped in "),Hs=n(ve,"CODE",{});var I2=s(Hs);Pu=r(I2,"kwargs"),I2.forEach(a),Fu=r(ve,`.
You can unpack the ones you need in the signature of the event using them. As an example, see the code of the
simple `),Us=n(ve,"CODE",{});var S2=s(Us);Wu=r(S2,"~transformer.PrinterCallback"),S2.forEach(a),Ru=r(ve,"."),ve.forEach(a),ju=d(T),v(Tt.$$.fragment,T),zu=d(T),wt=n(T,"DIV",{class:!0});var $i=s(wt);v(Jr.$$.fragment,$i),Bu=d($i),qs=n($i,"P",{});var M2=s(qs);Gu=r(M2,"Event called at the beginning of an epoch."),M2.forEach(a),$i.forEach(a),Vu=d(T),yt=n(T,"DIV",{class:!0});var Ci=s(yt);v(Yr.$$.fragment,Ci),Hu=d(Ci),Js=n(Ci,"P",{});var x2=s(Js);Uu=r(x2,"Event called at the end of an epoch."),x2.forEach(a),Ci.forEach(a),qu=d(T),At=n(T,"DIV",{class:!0});var Ti=s(At);v(Xr.$$.fragment,Ti),Ju=d(Ti),Ys=n(Ti,"P",{});var N2=s(Ys);Yu=r(N2,"Event called after an evaluation phase."),N2.forEach(a),Ti.forEach(a),Xu=d(T),Lt=n(T,"DIV",{class:!0});var wi=s(Lt);v(Kr.$$.fragment,wi),Ku=d(wi),Qr=n(wi,"P",{});var yi=s(Qr);Qu=r(yi,"Event called at the end of the initialization of the "),co=n(yi,"A",{href:!0});var P2=s(co);Zu=r(P2,"Trainer"),P2.forEach(a),ev=r(yi,"."),yi.forEach(a),wi.forEach(a),tv=d(T),Dt=n(T,"DIV",{class:!0});var Ai=s(Dt);v(Zr.$$.fragment,Ai),rv=d(Ai),Xs=n(Ai,"P",{});var F2=s(Xs);av=r(F2,"Event called after logging the last logs."),F2.forEach(a),Ai.forEach(a),ov=d(T),Ot=n(T,"DIV",{class:!0});var Li=s(Ot);v(ea.$$.fragment,Li),nv=d(Li),Ks=n(Li,"P",{});var W2=s(Ks);sv=r(W2,"Event called after a successful prediction."),W2.forEach(a),Li.forEach(a),lv=d(T),It=n(T,"DIV",{class:!0});var Di=s(It);v(ta.$$.fragment,Di),iv=d(Di),Qs=n(Di,"P",{});var R2=s(Qs);cv=r(R2,"Event called after a prediction step."),R2.forEach(a),Di.forEach(a),dv=d(T),St=n(T,"DIV",{class:!0});var Oi=s(St);v(ra.$$.fragment,Oi),fv=d(Oi),Zs=n(Oi,"P",{});var j2=s(Zs);hv=r(j2,"Event called after a checkpoint save."),j2.forEach(a),Oi.forEach(a),mv=d(T),Mt=n(T,"DIV",{class:!0});var Ii=s(Mt);v(aa.$$.fragment,Ii),pv=d(Ii),el=n(Ii,"P",{});var z2=s(el);gv=r(z2,`Event called at the beginning of a training step. If using gradient accumulation, one training step might take
several inputs.`),z2.forEach(a),Ii.forEach(a),uv=d(T),xt=n(T,"DIV",{class:!0});var Si=s(xt);v(oa.$$.fragment,Si),vv=d(Si),tl=n(Si,"P",{});var B2=s(tl);_v=r(B2,`Event called at the end of a training step. If using gradient accumulation, one training step might take
several inputs.`),B2.forEach(a),Si.forEach(a),bv=d(T),Nt=n(T,"DIV",{class:!0});var Mi=s(Nt);v(na.$$.fragment,Mi),Ev=d(Mi),rl=n(Mi,"P",{});var G2=s(rl);kv=r(G2,"Event called at the end of an substep during gradient accumulation."),G2.forEach(a),Mi.forEach(a),$v=d(T),Pt=n(T,"DIV",{class:!0});var xi=s(Pt);v(sa.$$.fragment,xi),Cv=d(xi),al=n(xi,"P",{});var V2=s(al);Tv=r(V2,"Event called at the beginning of training."),V2.forEach(a),xi.forEach(a),wv=d(T),Ft=n(T,"DIV",{class:!0});var Ni=s(Ft);v(la.$$.fragment,Ni),yv=d(Ni),ol=n(Ni,"P",{});var H2=s(ol);Av=r(H2,"Event called at the end of training."),H2.forEach(a),Ni.forEach(a),T.forEach(a),Vl=d(l),Wt=n(l,"P",{});var Pi=s(Wt);Lv=r(Pi,"Here is an example of how to register a custom callback with the PyTorch "),fo=n(Pi,"A",{href:!0});var U2=s(fo);Dv=r(U2,"Trainer"),U2.forEach(a),Ov=r(Pi,":"),Pi.forEach(a),Hl=d(l),v(ia.$$.fragment,l),Ul=d(l),Rt=n(l,"P",{});var Fi=s(Rt);Iv=r(Fi,"Another way to register a callback is to call "),nl=n(Fi,"CODE",{});var q2=s(nl);Sv=r(q2,"trainer.add_callback()"),q2.forEach(a),Mv=r(Fi," as follows:"),Fi.forEach(a),ql=d(l),v(ca.$$.fragment,l),Jl=d(l),Ze=n(l,"H2",{class:!0});var Wi=s(Ze);jt=n(Wi,"A",{id:!0,class:!0,href:!0});var J2=s(jt);sl=n(J2,"SPAN",{});var Y2=s(sl);v(da.$$.fragment,Y2),Y2.forEach(a),J2.forEach(a),xv=d(Wi),ll=n(Wi,"SPAN",{});var X2=s(ll);Nv=r(X2,"TrainerState"),X2.forEach(a),Wi.forEach(a),Yl=d(l),q=n(l,"DIV",{class:!0});var Pe=s(q);v(fa.$$.fragment,Pe),Pv=d(Pe),et=n(Pe,"P",{});var Ao=s(et);Fv=r(Ao,"A class containing the "),ho=n(Ao,"A",{href:!0});var K2=s(ho);Wv=r(K2,"Trainer"),K2.forEach(a),Rv=r(Ao,` inner state that will be saved along the model and optimizer when checkpointing
and passed to the `),mo=n(Ao,"A",{href:!0});var Q2=s(mo);jv=r(Q2,"TrainerCallback"),Q2.forEach(a),zv=r(Ao,"."),Ao.forEach(a),Bv=d(Pe),v(zt.$$.fragment,Pe),Gv=d(Pe),Bt=n(Pe,"DIV",{class:!0});var Ri=s(Bt);v(ha.$$.fragment,Ri),Vv=d(Ri),ma=n(Ri,"P",{});var ji=s(ma);Hv=r(ji,"Create an instance from the content of "),il=n(ji,"CODE",{});var Z2=s(il);Uv=r(Z2,"json_path"),Z2.forEach(a),qv=r(ji,"."),ji.forEach(a),Ri.forEach(a),Jv=d(Pe),Gt=n(Pe,"DIV",{class:!0});var zi=s(Gt);v(pa.$$.fragment,zi),Yv=d(zi),ga=n(zi,"P",{});var Bi=s(ga);Xv=r(Bi,"Save the content of this instance in JSON format inside "),cl=n(Bi,"CODE",{});var eE=s(cl);Kv=r(eE,"json_path"),eE.forEach(a),Qv=r(Bi,"."),Bi.forEach(a),zi.forEach(a),Pe.forEach(a),Xl=d(l),tt=n(l,"H2",{class:!0});var Gi=s(tt);Vt=n(Gi,"A",{id:!0,class:!0,href:!0});var tE=s(Vt);dl=n(tE,"SPAN",{});var rE=s(dl);v(ua.$$.fragment,rE),rE.forEach(a),tE.forEach(a),Zv=d(Gi),fl=n(Gi,"SPAN",{});var aE=s(fl);e_=r(aE,"TrainerControl"),aE.forEach(a),Gi.forEach(a),Kl=d(l),rt=n(l,"DIV",{class:!0});var Vi=s(rt);v(va.$$.fragment,Vi),t_=d(Vi),at=n(Vi,"P",{});var Lo=s(at);r_=r(Lo,"A class that handles the "),po=n(Lo,"A",{href:!0});var oE=s(po);a_=r(oE,"Trainer"),oE.forEach(a),o_=r(Lo," control flow. This class is used by the "),go=n(Lo,"A",{href:!0});var nE=s(go);n_=r(nE,"TrainerCallback"),nE.forEach(a),s_=r(Lo,` to activate some
switches in the training loop.`),Lo.forEach(a),Vi.forEach(a),this.h()},h(){i(m,"name","hf:doc:metadata"),i(m,"content",JSON.stringify(AE)),i(C,"id","callbacks"),i(C,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(C,"href","#callbacks"),i(E,"class","relative group"),i($a,"href","/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.Trainer"),i(Ca,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerControl"),i(Ta,"href","/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.Trainer"),i(wa,"href","trainer"),i(ya,"href","/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.Trainer"),i(La,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.DefaultFlowCallback"),i(Da,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.PrinterCallback"),i(Oa,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.ProgressCallback"),i(Ia,"href","/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.TrainingArguments"),i(Ma,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.integrations.TensorBoardCallback"),i(xa,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.integrations.WandbCallback"),i(Zt,"href","https://www.wandb.com/"),i(Zt,"rel","nofollow"),i(Na,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.integrations.CometCallback"),i(er,"href","https://www.comet.ml/site/"),i(er,"rel","nofollow"),i(Pa,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.integrations.MLflowCallback"),i(tr,"href","https://www.mlflow.org/"),i(tr,"rel","nofollow"),i(Fa,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.integrations.NeptuneCallback"),i(rr,"href","https://neptune.ai/"),i(rr,"rel","nofollow"),i(Wa,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.integrations.AzureMLCallback"),i(ar,"href","https://pypi.org/project/azureml-sdk/"),i(ar,"rel","nofollow"),i(Ra,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.integrations.CodeCarbonCallback"),i(or,"href","https://pypi.org/project/codecarbon/"),i(or,"rel","nofollow"),i(ja,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.integrations.ClearMLCallback"),i(nr,"href","https://github.com/allegroai/clearml"),i(nr,"rel","nofollow"),i(za,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.integrations.DagsHubCallback"),i(sr,"href","https://dagshub.com/"),i(sr,"rel","nofollow"),i(Ba,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(Ga,"href","/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.TrainingArguments"),i(Va,"href","/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.Trainer"),i(Ha,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerState"),i(Ua,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerControl"),i(Et,"id","transformers.integrations.CometCallback"),i(Et,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(Et,"href","#transformers.integrations.CometCallback"),i(We,"class","relative group"),i(qa,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(Ja,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(cr,"href","https://www.comet.ml/site/"),i(cr,"rel","nofollow"),i(hr,"href","https://www.comet.ml/docs/python-sdk/advanced/#comet-configuration-variables"),i(hr,"rel","nofollow"),i(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Ya,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Xa,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Ka,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Qa,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(Za,"href","/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.TrainingArguments"),i(eo,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerState"),i(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(to,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i($r,"href","https://www.tensorflow.org/tensorboard"),i($r,"rel","nofollow"),i(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ro,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(Tr,"href","https://www.wandb.com/"),i(Tr,"rel","nofollow"),i(Lr,"href","https://docs.wandb.ai/guides/integrations/huggingface"),i(Lr,"rel","nofollow"),i(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ao,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(Ir,"href","https://www.mlflow.org/"),i(Ir,"rel","nofollow"),i(oo,"href","/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.TrainingArguments"),i(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(no,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(xr,"href","https://pypi.org/project/azureml-sdk/"),i(xr,"rel","nofollow"),i(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(so,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Rr,"href","https://neptune.ai"),i(Rr,"rel","nofollow"),i(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(lo,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(zr,"href","https://clear.ml/"),i(zr,"rel","nofollow"),i(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(io,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(Gr,"href","https://dagshub.com/"),i(Gr,"rel","nofollow"),i(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Ct,"id","transformers.TrainerCallback"),i(Ct,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(Ct,"href","#transformers.TrainerCallback"),i(Qe,"class","relative group"),i(wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(At,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(co,"href","/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.Trainer"),i(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(St,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(fo,"href","/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.Trainer"),i(jt,"id","transformers.TrainerState"),i(jt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(jt,"href","#transformers.TrainerState"),i(Ze,"class","relative group"),i(ho,"href","/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.Trainer"),i(mo,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Vt,"id","transformers.TrainerControl"),i(Vt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(Vt,"href","#transformers.TrainerControl"),i(tt,"class","relative group"),i(po,"href","/docs/transformers/v4.27.1/en/main_classes/trainer#transformers.Trainer"),i(go,"href","/docs/transformers/v4.27.1/en/main_classes/callback#transformers.TrainerCallback"),i(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(l,f){e(document.head,m),h(l,D,f),h(l,E,f),e(E,C),e(C,A),_(k,A,null),e(E,L),e(E,w),e(w,I),h(l,x,f),h(l,Y,f),e(Y,Fe),e(Y,$a),e($a,Hi),e(Y,Ui),h(l,Cl,f),h(l,ne,f),e(ne,qi),e(ne,Ca),e(Ca,Ji),e(ne,Yi),e(ne,Ta),e(Ta,Xi),e(ne,Ki),e(ne,wa),e(wa,Qi),e(ne,Zi),h(l,Tl,f),h(l,ft,f),e(ft,ec),e(ft,ya),e(ya,tc),e(ft,rc),h(l,wl,f),h(l,S,f),e(S,Aa),e(Aa,La),e(La,ac),e(Aa,oc),e(S,nc),e(S,Ie),e(Ie,Da),e(Da,sc),e(Ie,lc),e(Ie,Oa),e(Oa,ic),e(Ie,cc),e(Ie,Ia),e(Ia,dc),e(Ie,fc),e(S,hc),e(S,Sa),e(Sa,Ma),e(Ma,mc),e(Sa,pc),e(S,gc),e(S,ht),e(ht,xa),e(xa,uc),e(ht,vc),e(ht,Zt),e(Zt,_c),e(ht,bc),e(S,Ec),e(S,mt),e(mt,Na),e(Na,kc),e(mt,$c),e(mt,er),e(er,Cc),e(mt,Tc),e(S,wc),e(S,pt),e(pt,Pa),e(Pa,yc),e(pt,Ac),e(pt,tr),e(tr,Lc),e(pt,Dc),e(S,Oc),e(S,gt),e(gt,Fa),e(Fa,Ic),e(gt,Sc),e(gt,rr),e(rr,Mc),e(gt,xc),e(S,Nc),e(S,ut),e(ut,Wa),e(Wa,Pc),e(ut,Fc),e(ut,ar),e(ar,Wc),e(ut,Rc),e(S,jc),e(S,vt),e(vt,Ra),e(Ra,zc),e(vt,Bc),e(vt,or),e(or,Gc),e(vt,Vc),e(S,Hc),e(S,_t),e(_t,ja),e(ja,Uc),e(_t,qc),e(_t,nr),e(nr,Jc),e(_t,Yc),e(S,Xc),e(S,bt),e(bt,za),e(za,Kc),e(bt,Qc),e(bt,sr),e(sr,Zc),e(bt,ed),h(l,yl,f),h(l,B,f),e(B,td),e(B,Ba),e(Ba,rd),e(B,ad),e(B,Ga),e(Ga,od),e(B,nd),e(B,Va),e(Va,sd),e(B,ld),e(B,Ha),e(Ha,id),e(B,cd),e(B,Ua),e(Ua,dd),e(B,fd),h(l,Al,f),h(l,We,f),e(We,Et),e(Et,Do),_(lr,Do,null),e(We,hd),e(We,Oo),e(Oo,md),h(l,Ll,f),h(l,kt,f),e(kt,pd),e(kt,qa),e(qa,gd),e(kt,ud),h(l,Dl,f),h(l,_e,f),_(ir,_e,null),e(_e,vd),e(_e,Re),e(Re,_d),e(Re,Ja),e(Ja,bd),e(Re,Ed),e(Re,cr),e(cr,kd),e(Re,$d),e(_e,Cd),e(_e,X),_(dr,X,null),e(X,Td),e(X,Io),e(Io,wd),e(X,yd),e(X,So),e(So,Ad),e(X,Ld),e(X,be),e(be,j),e(j,Mo),e(Mo,Dd),e(j,Od),e(j,xo),e(xo,Id),e(j,Sd),e(j,No),e(No,Md),e(j,xd),e(j,Po),e(Po,Nd),e(j,Pd),e(j,Fo),e(Fo,Fd),e(j,Wd),e(j,Wo),e(Wo,Rd),e(j,jd),e(j,Ro),e(Ro,zd),e(j,Bd),e(be,Gd),e(be,Se),e(Se,jo),e(jo,Vd),e(Se,Hd),e(Se,zo),e(zo,Ud),e(Se,qd),e(Se,Bo),e(Bo,Jd),e(Se,Yd),e(be,Xd),e(be,K),e(K,Go),e(Go,Kd),e(K,Qd),e(K,Vo),e(Vo,Zd),e(K,ef),e(K,Ho),e(Ho,tf),e(K,rf),e(K,Uo),e(Uo,af),e(K,of),e(K,qo),e(qo,nf),e(K,sf),e(be,lf),e(be,G),e(G,Jo),e(Jo,cf),e(G,df),e(G,Yo),e(Yo,ff),e(G,hf),e(G,Xo),e(Xo,mf),e(G,pf),e(G,Ko),e(Ko,gf),e(G,uf),e(G,Qo),e(Qo,vf),e(G,_f),e(G,Zo),e(Zo,bf),e(G,Ef),e(X,kf),e(X,fr),e(fr,$f),e(fr,hr),e(hr,Cf),e(fr,Tf),h(l,Ol,f),h(l,je,f),_(mr,je,null),e(je,wf),e(je,pr),e(pr,yf),e(pr,Ya),e(Ya,Af),e(pr,Lf),h(l,Il,f),h(l,ze,f),_(gr,ze,null),e(ze,Df),e(ze,ur),e(ur,Of),e(ur,Xa),e(Xa,If),e(ur,Sf),h(l,Sl,f),h(l,Be,f),_(vr,Be,null),e(Be,Mf),e(Be,_r),e(_r,xf),e(_r,Ka),e(Ka,Nf),e(_r,Pf),h(l,Ml,f),h(l,Ee,f),_(br,Ee,null),e(Ee,Ff),e(Ee,Er),e(Er,Wf),e(Er,Qa),e(Qa,Rf),e(Er,jf),e(Ee,zf),e(Ee,ke),e(ke,Bf),e(ke,Za),e(Za,Gf),e(ke,Vf),e(ke,en),e(en,Hf),e(ke,Uf),e(ke,eo),e(eo,qf),e(ke,Jf),h(l,xl,f),h(l,Ge,f),_(kr,Ge,null),e(Ge,Yf),e(Ge,Ve),e(Ve,Xf),e(Ve,to),e(to,Kf),e(Ve,Qf),e(Ve,$r),e($r,Zf),e(Ve,eh),h(l,Nl,f),h(l,$e,f),_(Cr,$e,null),e($e,th),e($e,He),e(He,rh),e(He,ro),e(ro,ah),e(He,oh),e(He,Tr),e(Tr,nh),e(He,sh),e($e,lh),e($e,Q),_(wr,Q,null),e(Q,ih),e(Q,yr),e(yr,ch),e(yr,tn),e(tn,dh),e(yr,fh),e(Q,hh),e(Q,Ar),e(Ar,mh),e(Ar,Lr),e(Lr,ph),e(Ar,gh),e(Q,uh),e(Q,rn),e(rn,vh),e(Q,_h),e(Q,Ce),e(Ce,Dr),e(Dr,O),e(O,an),e(an,bh),e(O,Eh),e(O,on),e(on,kh),e(O,$h),e(O,nn),e(nn,Ch),e(O,Th),e(O,sn),e(sn,wh),e(O,yh),e(O,ln),e(ln,Ah),e(O,Lh),e(O,cn),e(cn,Dh),e(O,Oh),e(O,dn),e(dn,Ih),e(O,Sh),e(O,fn),e(fn,Mh),e(O,xh),e(O,hn),e(hn,Nh),e(O,Ph),e(O,mn),e(mn,Fh),e(O,Wh),e(O,pn),e(pn,Rh),e(O,jh),e(O,gn),e(gn,zh),e(O,Bh),e(Dr,Gh),_($t,Dr,null),e(Ce,Vh),e(Ce,un),e(un,N),e(N,vn),e(vn,Hh),e(N,Uh),e(N,_n),e(_n,qh),e(N,Jh),e(N,bn),e(bn,Yh),e(N,Xh),e(N,En),e(En,Kh),e(N,Qh),e(N,kn),e(kn,Zh),e(N,em),e(N,$n),e($n,tm),e(N,rm),e(N,Cn),e(Cn,am),e(N,om),e(N,Tn),e(Tn,nm),e(N,sm),e(N,wn),e(wn,lm),e(N,im),e(Ce,cm),e(Ce,yn),e(yn,se),e(se,An),e(An,dm),e(se,fm),e(se,Ln),e(Ln,hm),e(se,mm),e(se,Dn),e(Dn,pm),e(se,gm),e(se,On),e(On,um),e(se,vm),e(Ce,_m),e(Ce,In),e(In,Z),e(Z,Sn),e(Sn,bm),e(Z,Em),e(Z,Mn),e(Mn,km),e(Z,$m),e(Z,xn),e(xn,Cm),e(Z,Tm),e(Z,Nn),e(Nn,wm),e(Z,ym),e(Z,Pn),e(Pn,Am),e(Z,Lm),h(l,Pl,f),h(l,Te,f),_(Or,Te,null),e(Te,Dm),e(Te,we),e(we,Om),e(we,ao),e(ao,Im),e(we,Sm),e(we,Ir),e(Ir,Mm),e(we,xm),e(we,Fn),e(Fn,Nm),e(we,Pm),e(Te,Fm),e(Te,le),_(Sr,le,null),e(le,Wm),e(le,Wn),e(Wn,Rm),e(le,jm),e(le,Rn),e(Rn,zm),e(le,Bm),e(le,H),e(H,F),e(F,jn),e(jn,Gm),e(F,Vm),e(F,zn),e(zn,Hm),e(F,Um),e(F,Bn),e(Bn,qm),e(F,Jm),e(F,Gn),e(Gn,Ym),e(F,Xm),e(F,Vn),e(Vn,Km),e(F,Qm),e(F,Hn),e(Hn,Zm),e(F,ep),e(F,oo),e(oo,tp),e(F,rp),e(F,Un),e(Un,ap),e(F,op),e(H,np),e(H,V),e(V,qn),e(qn,sp),e(V,lp),e(V,Jn),e(Jn,ip),e(V,cp),e(V,Yn),e(Yn,dp),e(V,fp),e(V,Xn),e(Xn,hp),e(V,mp),e(V,Kn),e(Kn,pp),e(V,gp),e(V,Qn),e(Qn,up),e(V,vp),e(H,_p),e(H,ie),e(ie,Zn),e(Zn,bp),e(ie,Ep),e(ie,es),e(es,kp),e(ie,$p),e(ie,ts),e(ts,Cp),e(ie,Tp),e(ie,rs),e(rs,wp),e(ie,yp),e(H,Ap),e(H,ee),e(ee,as),e(as,Lp),e(ee,Dp),e(ee,os),e(os,Op),e(ee,Ip),e(ee,ns),e(ns,Sp),e(ee,Mp),e(ee,ss),e(ss,xp),e(ee,Np),e(ee,ls),e(ls,Pp),e(ee,Fp),e(H,Wp),e(H,te),e(te,is),e(is,Rp),e(te,jp),e(te,cs),e(cs,zp),e(te,Bp),e(te,ds),e(ds,Gp),e(te,Vp),e(te,fs),e(fs,Hp),e(te,Up),e(te,hs),e(hs,qp),e(te,Jp),e(H,Yp),e(H,ce),e(ce,ms),e(ms,Xp),e(ce,Kp),e(ce,ps),e(ps,Qp),e(ce,Zp),e(ce,gs),e(gs,eg),e(ce,tg),e(ce,us),e(us,rg),e(ce,ag),h(l,Fl,f),h(l,Ue,f),_(Mr,Ue,null),e(Ue,og),e(Ue,qe),e(qe,ng),e(qe,no),e(no,sg),e(qe,lg),e(qe,xr),e(xr,ig),e(qe,cg),h(l,Wl,f),h(l,Je,f),_(Nr,Je,null),e(Je,dg),e(Je,Pr),e(Pr,fg),e(Pr,so),e(so,hg),e(Pr,mg),h(l,Rl,f),h(l,Ye,f),_(Fr,Ye,null),e(Ye,pg),e(Ye,Wr),e(Wr,gg),e(Wr,Rr),e(Rr,ug),e(Wr,vg),h(l,jl,f),h(l,re,f),_(jr,re,null),e(re,_g),e(re,Xe),e(Xe,bg),e(Xe,lo),e(lo,Eg),e(Xe,kg),e(Xe,zr),e(zr,$g),e(Xe,Cg),e(re,Tg),e(re,vs),e(vs,wg),e(re,yg),e(re,Ke),e(Ke,de),e(de,_s),e(_s,Ag),e(de,Lg),e(de,bs),e(bs,Dg),e(de,Og),e(de,Es),e(Es,Ig),e(de,Sg),e(de,ks),e(ks,Mg),e(de,xg),e(Ke,Ng),e(Ke,fe),e(fe,$s),e($s,Pg),e(fe,Fg),e(fe,Cs),e(Cs,Wg),e(fe,Rg),e(fe,Ts),e(Ts,jg),e(fe,zg),e(fe,ws),e(ws,Bg),e(fe,Gg),e(Ke,Vg),e(Ke,he),e(he,ys),e(ys,Hg),e(he,Ug),e(he,As),e(As,qg),e(he,Jg),e(he,Ls),e(Ls,Yg),e(he,Xg),e(he,Ds),e(Ds,Kg),e(he,Qg),h(l,zl,f),h(l,ye,f),_(Br,ye,null),e(ye,Zg),e(ye,Me),e(Me,eu),e(Me,io),e(io,tu),e(Me,ru),e(Me,Gr),e(Gr,au),e(Me,ou),e(Me,Os),e(Os,nu),e(ye,su),e(ye,me),_(Vr,me,null),e(me,lu),e(me,Is),e(Is,iu),e(me,cu),e(me,Ss),e(Ss,du),e(me,fu),e(me,Ms),e(Ms,pe),e(pe,xs),e(xs,hu),e(pe,mu),e(pe,Ns),e(Ns,pu),e(pe,gu),e(pe,Ps),e(Ps,uu),e(pe,vu),e(pe,Fs),e(Fs,_u),e(pe,bu),h(l,Bl,f),h(l,Qe,f),e(Qe,Ct),e(Ct,Ws),_(Hr,Ws,null),e(Qe,Eu),e(Qe,Rs),e(Rs,ku),h(l,Gl,f),h(l,$,f),_(Ur,$,null),e($,$u),e($,js),e(js,Cu),e($,Tu),e($,qr),e(qr,wu),e(qr,zs),e(zs,yu),e(qr,Au),e($,Lu),e($,U),e(U,Du),e(U,Bs),e(Bs,Ou),e(U,Iu),e(U,Gs),e(Gs,Su),e(U,Mu),e(U,Vs),e(Vs,xu),e(U,Nu),e(U,Hs),e(Hs,Pu),e(U,Fu),e(U,Us),e(Us,Wu),e(U,Ru),e($,ju),_(Tt,$,null),e($,zu),e($,wt),_(Jr,wt,null),e(wt,Bu),e(wt,qs),e(qs,Gu),e($,Vu),e($,yt),_(Yr,yt,null),e(yt,Hu),e(yt,Js),e(Js,Uu),e($,qu),e($,At),_(Xr,At,null),e(At,Ju),e(At,Ys),e(Ys,Yu),e($,Xu),e($,Lt),_(Kr,Lt,null),e(Lt,Ku),e(Lt,Qr),e(Qr,Qu),e(Qr,co),e(co,Zu),e(Qr,ev),e($,tv),e($,Dt),_(Zr,Dt,null),e(Dt,rv),e(Dt,Xs),e(Xs,av),e($,ov),e($,Ot),_(ea,Ot,null),e(Ot,nv),e(Ot,Ks),e(Ks,sv),e($,lv),e($,It),_(ta,It,null),e(It,iv),e(It,Qs),e(Qs,cv),e($,dv),e($,St),_(ra,St,null),e(St,fv),e(St,Zs),e(Zs,hv),e($,mv),e($,Mt),_(aa,Mt,null),e(Mt,pv),e(Mt,el),e(el,gv),e($,uv),e($,xt),_(oa,xt,null),e(xt,vv),e(xt,tl),e(tl,_v),e($,bv),e($,Nt),_(na,Nt,null),e(Nt,Ev),e(Nt,rl),e(rl,kv),e($,$v),e($,Pt),_(sa,Pt,null),e(Pt,Cv),e(Pt,al),e(al,Tv),e($,wv),e($,Ft),_(la,Ft,null),e(Ft,yv),e(Ft,ol),e(ol,Av),h(l,Vl,f),h(l,Wt,f),e(Wt,Lv),e(Wt,fo),e(fo,Dv),e(Wt,Ov),h(l,Hl,f),_(ia,l,f),h(l,Ul,f),h(l,Rt,f),e(Rt,Iv),e(Rt,nl),e(nl,Sv),e(Rt,Mv),h(l,ql,f),_(ca,l,f),h(l,Jl,f),h(l,Ze,f),e(Ze,jt),e(jt,sl),_(da,sl,null),e(Ze,xv),e(Ze,ll),e(ll,Nv),h(l,Yl,f),h(l,q,f),_(fa,q,null),e(q,Pv),e(q,et),e(et,Fv),e(et,ho),e(ho,Wv),e(et,Rv),e(et,mo),e(mo,jv),e(et,zv),e(q,Bv),_(zt,q,null),e(q,Gv),e(q,Bt),_(ha,Bt,null),e(Bt,Vv),e(Bt,ma),e(ma,Hv),e(ma,il),e(il,Uv),e(ma,qv),e(q,Jv),e(q,Gt),_(pa,Gt,null),e(Gt,Yv),e(Gt,ga),e(ga,Xv),e(ga,cl),e(cl,Kv),e(ga,Qv),h(l,Xl,f),h(l,tt,f),e(tt,Vt),e(Vt,dl),_(ua,dl,null),e(tt,Zv),e(tt,fl),e(fl,e_),h(l,Kl,f),h(l,rt,f),_(va,rt,null),e(rt,t_),e(rt,at),e(at,r_),e(at,po),e(po,a_),e(at,o_),e(at,go),e(go,n_),e(at,s_),Ql=!0},p(l,[f]){const _a={};f&2&&(_a.$$scope={dirty:f,ctx:l}),$t.$set(_a);const hl={};f&2&&(hl.$$scope={dirty:f,ctx:l}),Tt.$set(hl);const ml={};f&2&&(ml.$$scope={dirty:f,ctx:l}),zt.$set(ml)},i(l){Ql||(p(k.$$.fragment,l),p(lr.$$.fragment,l),p(ir.$$.fragment,l),p(dr.$$.fragment,l),p(mr.$$.fragment,l),p(gr.$$.fragment,l),p(vr.$$.fragment,l),p(br.$$.fragment,l),p(kr.$$.fragment,l),p(Cr.$$.fragment,l),p(wr.$$.fragment,l),p($t.$$.fragment,l),p(Or.$$.fragment,l),p(Sr.$$.fragment,l),p(Mr.$$.fragment,l),p(Nr.$$.fragment,l),p(Fr.$$.fragment,l),p(jr.$$.fragment,l),p(Br.$$.fragment,l),p(Vr.$$.fragment,l),p(Hr.$$.fragment,l),p(Ur.$$.fragment,l),p(Tt.$$.fragment,l),p(Jr.$$.fragment,l),p(Yr.$$.fragment,l),p(Xr.$$.fragment,l),p(Kr.$$.fragment,l),p(Zr.$$.fragment,l),p(ea.$$.fragment,l),p(ta.$$.fragment,l),p(ra.$$.fragment,l),p(aa.$$.fragment,l),p(oa.$$.fragment,l),p(na.$$.fragment,l),p(sa.$$.fragment,l),p(la.$$.fragment,l),p(ia.$$.fragment,l),p(ca.$$.fragment,l),p(da.$$.fragment,l),p(fa.$$.fragment,l),p(zt.$$.fragment,l),p(ha.$$.fragment,l),p(pa.$$.fragment,l),p(ua.$$.fragment,l),p(va.$$.fragment,l),Ql=!0)},o(l){g(k.$$.fragment,l),g(lr.$$.fragment,l),g(ir.$$.fragment,l),g(dr.$$.fragment,l),g(mr.$$.fragment,l),g(gr.$$.fragment,l),g(vr.$$.fragment,l),g(br.$$.fragment,l),g(kr.$$.fragment,l),g(Cr.$$.fragment,l),g(wr.$$.fragment,l),g($t.$$.fragment,l),g(Or.$$.fragment,l),g(Sr.$$.fragment,l),g(Mr.$$.fragment,l),g(Nr.$$.fragment,l),g(Fr.$$.fragment,l),g(jr.$$.fragment,l),g(Br.$$.fragment,l),g(Vr.$$.fragment,l),g(Hr.$$.fragment,l),g(Ur.$$.fragment,l),g(Tt.$$.fragment,l),g(Jr.$$.fragment,l),g(Yr.$$.fragment,l),g(Xr.$$.fragment,l),g(Kr.$$.fragment,l),g(Zr.$$.fragment,l),g(ea.$$.fragment,l),g(ta.$$.fragment,l),g(ra.$$.fragment,l),g(aa.$$.fragment,l),g(oa.$$.fragment,l),g(na.$$.fragment,l),g(sa.$$.fragment,l),g(la.$$.fragment,l),g(ia.$$.fragment,l),g(ca.$$.fragment,l),g(da.$$.fragment,l),g(fa.$$.fragment,l),g(zt.$$.fragment,l),g(ha.$$.fragment,l),g(pa.$$.fragment,l),g(ua.$$.fragment,l),g(va.$$.fragment,l),Ql=!1},d(l){a(m),l&&a(D),l&&a(E),b(k),l&&a(x),l&&a(Y),l&&a(Cl),l&&a(ne),l&&a(Tl),l&&a(ft),l&&a(wl),l&&a(S),l&&a(yl),l&&a(B),l&&a(Al),l&&a(We),b(lr),l&&a(Ll),l&&a(kt),l&&a(Dl),l&&a(_e),b(ir),b(dr),l&&a(Ol),l&&a(je),b(mr),l&&a(Il),l&&a(ze),b(gr),l&&a(Sl),l&&a(Be),b(vr),l&&a(Ml),l&&a(Ee),b(br),l&&a(xl),l&&a(Ge),b(kr),l&&a(Nl),l&&a($e),b(Cr),b(wr),b($t),l&&a(Pl),l&&a(Te),b(Or),b(Sr),l&&a(Fl),l&&a(Ue),b(Mr),l&&a(Wl),l&&a(Je),b(Nr),l&&a(Rl),l&&a(Ye),b(Fr),l&&a(jl),l&&a(re),b(jr),l&&a(zl),l&&a(ye),b(Br),b(Vr),l&&a(Bl),l&&a(Qe),b(Hr),l&&a(Gl),l&&a($),b(Ur),b(Tt),b(Jr),b(Yr),b(Xr),b(Kr),b(Zr),b(ea),b(ta),b(ra),b(aa),b(oa),b(na),b(sa),b(la),l&&a(Vl),l&&a(Wt),l&&a(Hl),b(ia,l),l&&a(Ul),l&&a(Rt),l&&a(ql),b(ca,l),l&&a(Jl),l&&a(Ze),b(da),l&&a(Yl),l&&a(q),b(fa),b(zt),b(ha),b(pa),l&&a(Xl),l&&a(tt),b(ua),l&&a(Kl),l&&a(rt),b(va)}}}const AE={local:"callbacks",sections:[{local:"transformers.integrations.CometCallback",title:"Available Callbacks"},{local:"transformers.TrainerCallback",title:"TrainerCallback"},{local:"transformers.TrainerState",title:"TrainerState"},{local:"transformers.TrainerControl",title:"TrainerControl"}],title:"Callbacks"};function LE(W){return uE(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class NE extends sE{constructor(m){super();lE(this,m,LE,yE,iE,{})}}export{NE as default,AE as metadata};
