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