import{S as rT,i as aT,s as nT,w as b,x as v,y as E,q as g,o as u,B as T,F as lT,e as n,t,k as c,c as o,a as s,h as r,d as a,m as d,b as i,g as f,G as e,j as iT,H as cT,I as dT,J as mT,M as fT,v as hT,L as oT}from"../../chunks/vendor-hf-doc-builder.js";import{T as sT}from"../../chunks/Tip-hf-doc-builder.js";import{D as M}from"../../chunks/Docstring-hf-doc-builder.js";import{C as mc}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Pl}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as tT}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function pT(j){let h,L,_,k,w;const p=j[1].default,$=lT(p,j,j[2],null);return{c(){h=n("p"),L=t("Deprecated in "),_=t(j[0]),k=c(),$&&$.c(),this.h()},l(A){h=o(A,"P",{class:!0});var O=s(h);L=r(O,"Deprecated in "),_=r(O,j[0]),O.forEach(a),k=d(A),$&&$.l(A),this.h()},h(){i(h,"class","font-medium")},m(A,O){f(A,h,O),e(h,L),e(h,_),f(A,k,O),$&&$.m(A,O),w=!0},p(A,O){(!w||O&1)&&iT(_,A[0]),$&&$.p&&(!w||O&4)&&cT($,p,A,A[2],w?mT(p,A[2],O,null):dT(A[2]),null)},i(A){w||(g($,A),w=!0)},o(A){u($,A),w=!1},d(A){A&&a(h),A&&a(k),$&&$.d(A)}}}function gT(j){let h,L;return h=new sT({props:{warning:!0,$$slots:{default:[pT]},$$scope:{ctx:j}}}),{c(){b(h.$$.fragment)},l(_){v(h.$$.fragment,_)},m(_,k){E(h,_,k),L=!0},p(_,[k]){const w={};k&5&&(w.$$scope={dirty:k,ctx:_}),h.$set(w)},i(_){L||(g(h.$$.fragment,_),L=!0)},o(_){u(h.$$.fragment,_),L=!1},d(_){T(h,_)}}}function uT(j,h,L){let{$$slots:_={},$$scope:k}=h,{version:w}=h;return j.$$set=p=>{"version"in p&&L(0,w=p.version),"$$scope"in p&&L(2,k=p.$$scope)},[w,_,k]}class _T extends rT{constructor(h){super();aT(this,h,uT,gT,nT,{version:0})}}function bT(j){let h,L,_,k,w,p,$,A;return{c(){h=n("p"),L=t("Setting "),_=n("code"),k=t("WANDB_LOG_MODEL"),w=t(" as "),p=n("code"),$=t("bool"),A=t(" will be deprecated in version 5 of \u{1F917} Transformers.")},l(O){h=o(O,"P",{});var S=s(h);L=r(S,"Setting "),_=o(S,"CODE",{});var Z=s(_);k=r(Z,"WANDB_LOG_MODEL"),Z.forEach(a),w=r(S," as "),p=o(S,"CODE",{});var We=s(p);$=r(We,"bool"),We.forEach(a),A=r(S," will be deprecated in version 5 of \u{1F917} Transformers."),S.forEach(a)},m(O,S){f(O,h,S),e(h,L),e(h,_),e(_,k),e(h,w),e(h,p),e(p,$),e(h,A)},d(O){O&&a(h)}}}function vT(j){let h,L,_,k,w;return k=new mc({props:{code:"JTIzJTIwTm90ZSUzQSUyMFRoaXMlMjBleGFtcGxlJTIwc2tpcHMlMjBvdmVyJTIwc29tZSUyMHNldHVwJTIwc3RlcHMlMjBmb3IlMjBicmV2aXR5LiUwQWZyb20lMjBmbHl0ZWtpdCUyMGltcG9ydCUyMGN1cnJlbnRfY29udGV4dCUyQyUyMHRhc2slMEElMEElMEElNDB0YXNrJTBBZGVmJTIwdHJhaW5faGZfdHJhbnNmb3JtZXIoKSUzQSUwQSUyMCUyMCUyMCUyMGNwJTIwJTNEJTIwY3VycmVudF9jb250ZXh0KCkuY2hlY2twb2ludCUwQSUyMCUyMCUyMCUyMHRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKC4uLiUyQyUyMGNhbGxiYWNrcyUzRCU1QkZseXRlQ2FsbGJhY2soKSU1RCklMEElMjAlMjAlMjAlMjBvdXRwdXQlMjAlM0QlMjB0cmFpbmVyLnRyYWluKHJlc3VtZV9mcm9tX2NoZWNrcG9pbnQlM0RjcC5yZXN0b3JlKCkp",highlighted:`<span class="hljs-comment"># Note: This example skips over some setup steps for brevity.</span>
<span class="hljs-keyword">from</span> flytekit <span class="hljs-keyword">import</span> current_context, task


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