import{S as xu,i as Mu,s as Ou,e as o,k as c,w as g,t,M as Su,c as s,d as a,m as d,a as l,x as u,h as r,b as i,G as e,g as m,y as b,q as v,o as _,B as E,v as Iu,L as Nu}from"../../chunks/vendor-hf-doc-builder.js";import{T as Pu}from"../../chunks/Tip-hf-doc-builder.js";import{D as w}from"../../chunks/Docstring-hf-doc-builder.js";import{C as jh}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Eo}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Fu}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Wu(wr){let A,B,x,M,W;return M=new jh({props:{code:`class PrinterCallback(TrainerCallback):
    def on_log(self, args, state, control, logs=None, **kwargs):
        _ = logs.pop("total_flos", None)
        if state.is_local_process_zero:
            print(logs)`,highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">PrinterCallback</span>(<span class="hljs-title class_ inherited__">TrainerCallback</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">on_log</span>(<span class="hljs-params">self, args, state, control, logs=<span class="hljs-literal">None</span>, **kwargs</span>):
        _ = logs.pop(<span class="hljs-string">&quot;total_flos&quot;</span>, <span class="hljs-literal">None</span>)
        <span class="hljs-keyword">if</span> state.is_local_process_zero:
            <span class="hljs-built_in">print</span>(logs)`}}),{c(){A=o("p"),B=t("Example:"),x=c(),g(M.$$.fragment)},l(y){A=s(y,"P",{});var j=l(A);B=r(j,"Example:"),j.forEach(a),x=d(y),u(M.$$.fragment,y)},m(y,j){m(y,A,j),e(A,B),m(y,x,j),b(M,y,j),W=!0},p:Nu,i(y){W||(v(M.$$.fragment,y),W=!0)},o(y){_(M.$$.fragment,y),W=!1},d(y){y&&a(A),y&&a(x),E(M,y)}}}function ju(wr){let A,B,x,M,W,y,j,oe;return{c(){A=o("p"),B=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 `),x=o("code"),M=t("gradient_accumulation_steps=n"),W=t(`, then one update
step requires going through `),y=o("em"),j=t("n"),oe=t(" batches.")},l(se){A=s(se,"P",{});var R=l(A);B=r(R,`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 `),x=s(R,"CODE",{});var J=l(x);M=r(J,"gradient_accumulation_steps=n"),J.forEach(a),W=r(R,`, then one update
step requires going through `),y=s(R,"EM",{});var yr=l(y);j=r(yr,"n"),yr.forEach(a),oe=r(R," batches."),R.forEach(a)},m(se,R){m(se,A,R),e(A,B),e(A,x),e(x,M),e(A,W),e(A,y),e(y,j),e(A,oe)},d(se){se&&a(A)}}}function zu(wr){let A,B,x,M,W,y,j,oe,se,R,J,yr,Ar,Rs,Bs,ko,V,Vs,Lr,Us,qs,Dr,Gs,Hs,xr,Js,Ys,To,ye,Xs,Mr,Ks,Qs,$o,L,Or,Sr,Zs,el,tl,re,Ir,rl,al,Nr,nl,ol,Pr,sl,ll,il,Fr,Wr,cl,dl,fl,Ae,jr,ml,hl,ct,pl,gl,ul,Le,zr,bl,vl,dt,_l,El,kl,De,Rr,Tl,$l,ft,Cl,wl,yl,xe,Br,Al,Ll,mt,Dl,xl,Ml,Me,Vr,Ol,Sl,ht,Il,Nl,Pl,Oe,Ur,Fl,Wl,pt,jl,zl,Rl,Se,qr,Bl,Vl,gt,Ul,ql,Co,N,Gl,Gr,Hl,Jl,Hr,Yl,Xl,Jr,Kl,Ql,Yr,Zl,ei,Xr,ti,ri,wo,le,Ie,Ma,ut,ai,Oa,ni,yo,Ne,oi,Kr,si,li,Ao,Y,bt,ii,ie,ci,Qr,di,fi,vt,mi,hi,pi,U,_t,gi,Sa,ui,bi,D,vi,Ia,_i,Ei,Na,ki,Ti,Pa,$i,Ci,Fa,wi,yi,Wa,Ai,Li,ja,Di,xi,za,Mi,Oi,Ra,Si,Ii,Ba,Ni,Pi,Fi,Et,Wi,kt,ji,zi,Lo,ce,Tt,Ri,$t,Bi,Zr,Vi,Ui,Do,de,Ct,qi,wt,Gi,ea,Hi,Ji,xo,fe,yt,Yi,At,Xi,ta,Ki,Qi,Mo,X,Lt,Zi,Dt,ec,ra,tc,rc,ac,K,nc,aa,oc,sc,Va,lc,ic,na,cc,dc,Oo,me,xt,fc,he,mc,oa,hc,pc,Mt,gc,uc,So,Q,Ot,bc,pe,vc,sa,_c,Ec,St,kc,Tc,$c,q,It,Cc,Nt,wc,Ua,yc,Ac,Lc,Pt,Dc,Ft,xc,Mc,Oc,h,Sc,qa,Ic,Nc,Ga,Pc,Fc,Ha,Wc,jc,Ja,zc,Rc,Ya,Bc,Vc,Xa,Uc,qc,Ka,Gc,Hc,Qa,Jc,Yc,Za,Xc,Kc,en,Qc,Zc,tn,ed,td,rn,rd,ad,an,nd,od,nn,sd,ld,on,id,cd,sn,dd,fd,ln,md,hd,cn,pd,gd,dn,ud,bd,Io,Z,Wt,vd,ee,_d,la,Ed,kd,jt,Td,$d,fn,Cd,wd,yd,ae,zt,Ad,mn,Ld,Dd,p,xd,hn,Md,Od,pn,Sd,Id,gn,Nd,Pd,un,Fd,Wd,ia,jd,zd,bn,Rd,Bd,vn,Vd,Ud,_n,qd,Gd,En,Hd,Jd,kn,Yd,Xd,Tn,Kd,Qd,$n,Zd,ef,Cn,tf,rf,wn,af,nf,yn,of,sf,An,lf,cf,Ln,df,ff,Dn,mf,hf,xn,pf,gf,No,ge,Rt,uf,ue,bf,ca,vf,_f,Bt,Ef,kf,Po,be,Vt,Tf,Ut,$f,da,Cf,wf,Fo,ve,qt,yf,Gt,Af,Ht,Lf,Df,Wo,te,Jt,xf,_e,Mf,fa,Of,Sf,Yt,If,Nf,Pf,I,Ff,Mn,Wf,jf,On,zf,Rf,Sn,Bf,Vf,In,Uf,qf,Nn,Gf,Hf,Pn,Jf,Yf,jo,Ee,Pe,Fn,Xt,Xf,Wn,Kf,zo,k,Kt,Qf,jn,Zf,em,Qt,tm,zn,rm,am,nm,P,om,Rn,sm,lm,Bn,im,cm,Vn,dm,fm,Un,mm,hm,qn,pm,gm,um,Fe,bm,We,Zt,vm,Gn,_m,Em,je,er,km,Hn,Tm,$m,ze,tr,Cm,Jn,wm,ym,Re,rr,Am,ar,Lm,ma,Dm,xm,Mm,Be,nr,Om,Yn,Sm,Im,Ve,or,Nm,Xn,Pm,Fm,Ue,sr,Wm,Kn,jm,zm,qe,lr,Rm,Qn,Bm,Vm,Ge,ir,Um,Zn,qm,Gm,He,cr,Hm,eo,Jm,Ym,Je,dr,Xm,to,Km,Qm,Ye,fr,Zm,ro,eh,th,Xe,mr,rh,ao,ah,Ro,Ke,nh,ha,oh,sh,Bo,hr,Vo,Qe,lh,no,ih,ch,Uo,pr,qo,ke,Ze,oo,gr,dh,so,fh,Go,F,ur,mh,Te,hh,pa,ph,gh,ga,uh,bh,vh,et,_h,tt,br,Eh,vr,kh,lo,Th,$h,Ch,rt,_r,wh,Er,yh,io,Ah,Lh,Ho,$e,at,co,kr,Dh,fo,xh,Jo,Ce,Tr,Mh,we,Oh,ua,Sh,Ih,ba,Nh,Ph,Yo;return y=new Eo({}),ut=new Eo({}),bt=new w({props:{name:"class transformers.integrations.CometCallback",anchor:"transformers.integrations.CometCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/integrations.py#L771"}}),_t=new w({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.25.1/src/transformers/integrations.py#L782"}}),Tt=new w({props:{name:"class transformers.DefaultFlowCallback",anchor:"transformers.DefaultFlowCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/trainer_callback.py#L415"}}),Ct=new w({props:{name:"class transformers.PrinterCallback",anchor:"transformers.PrinterCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/trainer_callback.py#L513"}}),yt=new w({props:{name:"class transformers.ProgressCallback",anchor:"transformers.ProgressCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/trainer_callback.py#L465"}}),Lt=new w({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.25.1/src/transformers/trainer_callback.py#L524"}}),xt=new w({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.25.1/src/transformers/integrations.py#L556"}}),Ot=new w({props:{name:"class transformers.integrations.WandbCallback",anchor:"transformers.integrations.WandbCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/integrations.py#L645"}}),It=new w({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.25.1/src/transformers/integrations.py#L662"}}),Wt=new w({props:{name:"class transformers.integrations.MLflowCallback",anchor:"transformers.integrations.MLflowCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/integrations.py#L871"}}),zt=new w({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.25.1/src/transformers/integrations.py#L890"}}),Rt=new w({props:{name:"class transformers.integrations.AzureMLCallback",anchor:"transformers.integrations.AzureMLCallback",parameters:[{name:"azureml_run",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/integrations.py#L848"}}),Vt=new w({props:{name:"class transformers.integrations.CodeCarbonCallback",anchor:"transformers.integrations.CodeCarbonCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/integrations.py#L1279"}}),qt=new w({props:{name:"class transformers.integrations.NeptuneCallback",anchor:"transformers.integrations.NeptuneCallback",parameters:[{name:"api_token",val:": typing.Optional[str] = None"},{name:"project",val:": typing.Optional[str] = None"},{name:"name",val:": typing.Optional[str] = None"},{name:"base_namespace",val:": str = 'finetuning'"},{name:"run",val:": typing.Optional[ForwardRef('Run')] = None"},{name:"log_parameters",val:": bool = True"},{name:"log_checkpoints",val:": typing.Optional[str] = None"},{name:"**neptune_run_kwargs",val:""}],parametersDescription:[{anchor:"transformers.integrations.NeptuneCallback.api_token",description:`<strong>api_token</strong> (<code>str</code>, optional) &#x2014;
Neptune API token obtained upon registration. You can leave this argument out if you have saved your token
to the <code>NEPTUNE_API_TOKEN</code> environment variable (strongly recommended). See full setup instructions in the
<a href="https://docs.neptune.ai/getting-started/installation" rel="nofollow">docs</a>.`,name:"api_token"},{anchor:"transformers.integrations.NeptuneCallback.project",description:`<strong>project</strong> (<code>str</code>, optional) &#x2014;
Name of an existing Neptune project, in the form: &#x201C;workspace-name/project-name&#x201D;. You can find and copy the
name from the project Settings -&gt; Properties in Neptune. If None (default), the value of the
<code>NEPTUNE_PROJECT</code> environment variable will be used.`,name:"project"},{anchor:"transformers.integrations.NeptuneCallback.name",description:"<strong>name</strong> (<code>str</code>, optional) &#x2014; Custom name for the run.",name:"name"},{anchor:"transformers.integrations.NeptuneCallback.base_namespace",description:`<strong>base_namespace</strong> (<code>str</code>, optional, defaults to &#x201C;finetuning&#x201D;) &#x2014; In the Neptune run, the root namespace
that will contain all of the logged metadata.`,name:"base_namespace"},{anchor:"transformers.integrations.NeptuneCallback.log_parameters",description:`<strong>log_parameters</strong> (<code>bool</code>, optional, defaults to True) &#x2014;
If True, logs all Trainer arguments and model parameters provided by the Trainer.`,name:"log_parameters"},{anchor:"transformers.integrations.NeptuneCallback.log_checkpoints",description:`<strong>log_checkpoints</strong> (<code>str</code>, optional, defaults to None) &#x2014;
If &#x201C;same&#x201D;, uploads checkpoints whenever they are saved by the Trainer. If &#x201C;last&#x201D;, uploads only the most
recently saved checkpoint. If &#x201C;best&#x201D;, uploads the best checkpoint (among the ones saved by the Trainer). If
None, does not upload checkpoints.`,name:"log_checkpoints"},{anchor:"transformers.integrations.NeptuneCallback.run",description:`<strong>run</strong> (<code>Run</code>, optional) &#x2014;
Pass a Neptune run object if you want to continue logging to an existing run. Read more about resuming runs
in the <a href="https://docs.neptune.ai/how-to-guides/neptune-api/resume-run" rel="nofollow">docs</a>.`,name:"run"},{anchor:"transformers.integrations.NeptuneCallback.*neptune_run_kwargs",description:`*<strong>*neptune_run_kwargs</strong> (optional) &#x2014;
Additional keyword arguments to be passed directly to the
<a href="https://docs.neptune.ai/api-reference/neptune#.init_run" rel="nofollow">neptune.init_run()</a> function when a new run is
created.`,name:"*neptune_run_kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/integrations.py#L1018"}}),Jt=new w({props:{name:"class transformers.integrations.ClearMLCallback",anchor:"transformers.integrations.ClearMLCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/integrations.py#L1308"}}),Xt=new Eo({}),Kt=new w({props:{name:"class transformers.TrainerCallback",anchor:"transformers.TrainerCallback",parameters:[],parametersDescription:[{anchor:"transformers.TrainerCallback.args",description:`<strong>args</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>) &#x2014;
The training arguments used to instantiate the <a href="/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.Trainer">Trainer</a>.`,name:"args"},{anchor:"transformers.TrainerCallback.state",description:`<strong>state</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerState">TrainerState</a>) &#x2014;
The current state of the <a href="/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.Trainer">Trainer</a>.`,name:"state"},{anchor:"transformers.TrainerCallback.control",description:`<strong>control</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerControl">TrainerControl</a>) &#x2014;
The object that is returned to the <a href="/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.Trainer">Trainer</a> and can be used to make some decisions.`,name:"control"},{anchor:"transformers.TrainerCallback.model",description:`<strong>model</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a> or <code>torch.nn.Module</code>) &#x2014;
The model being trained.`,name:"model"},{anchor:"transformers.TrainerCallback.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.25.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer used for encoding the data.`,name:"tokenizer"},{anchor:"transformers.TrainerCallback.optimizer",description:`<strong>optimizer</strong> (<code>torch.optim.Optimizer</code>) &#x2014;
The optimizer used for the training steps.`,name:"optimizer"},{anchor:"transformers.TrainerCallback.lr_scheduler",description:`<strong>lr_scheduler</strong> (<code>torch.optim.lr_scheduler.LambdaLR</code>) &#x2014;
The scheduler used for setting the learning rate.`,name:"lr_scheduler"},{anchor:"transformers.TrainerCallback.train_dataloader",description:`<strong>train_dataloader</strong> (<code>torch.utils.data.DataLoader</code>, <em>optional</em>) &#x2014;
The current dataloader used for training.`,name:"train_dataloader"},{anchor:"transformers.TrainerCallback.eval_dataloader",description:`<strong>eval_dataloader</strong> (<code>torch.utils.data.DataLoader</code>, <em>optional</em>) &#x2014;
The current dataloader used for training.`,name:"eval_dataloader"},{anchor:"transformers.TrainerCallback.metrics",description:`<strong>metrics</strong> (<code>Dict[str, float]</code>) &#x2014;
The metrics computed by the last evaluation phase.</p>
<p>Those are only accessible in the event <code>on_evaluate</code>.`,name:"metrics"},{anchor:"transformers.TrainerCallback.logs",description:`<strong>logs</strong>  (<code>Dict[str, float]</code>) &#x2014;
The values to log.</p>
<p>Those are only accessible in the event <code>on_log</code>.`,name:"logs"}],source:"https://github.com/huggingface/transformers/blob/v4.25.1/src/transformers/trainer_callback.py#L159"}}),Fe=new Fu({props:{anchor:"transformers.TrainerCallback.example",$$slots:{default:[Wu]},$$scope:{ctx:wr}}}),Zt=new w({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.25.1/src/transformers/trainer_callback.py#L227"}}),er=new w({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.25.1/src/transformers/trainer_callback.py#L233"}}),tr=new w({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.25.1/src/transformers/trainer_callback.py#L259"}}),rr=new w({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.25.1/src/transformers/trainer_callback.py#L209"}}),nr=new w({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.25.1/src/transformers/trainer_callback.py#L277"}}),or=new w({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.25.1/src/transformers/trainer_callback.py#L265"}}),sr=new w({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.25.1/src/transformers/trainer_callback.py#L283"}}),lr=new w({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.25.1/src/transformers/trainer_callback.py#L271"}}),ir=new w({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.25.1/src/transformers/trainer_callback.py#L239"}}),cr=new w({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.25.1/src/transformers/trainer_callback.py#L252"}}),dr=new w({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.25.1/src/transformers/trainer_callback.py#L246"}}),fr=new w({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.25.1/src/transformers/trainer_callback.py#L215"}}),mr=new w({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.25.1/src/transformers/trainer_callback.py#L221"}}),hr=new jh({props:{code:`class MyCallback(TrainerCallback):
    "A callback that prints a message at the beginning of training"

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


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

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


trainer = Trainer(
    model,
    args,
    train_dataset=train_dataset,
    eval_dataset=eval_dataset,
    callbacks=[MyCallback],  <span class="hljs-comment"># We can either pass the callback class this way or an instance of it (MyCallback())</span>
)`}}),pr=new jh({props:{code:`trainer = Trainer(...)
trainer.add_callback(MyCallback)
# Alternatively, we can pass an instance of the callback class
trainer.add_callback(MyCallback())`,highlighted:`trainer = Trainer(...)
trainer.add_callback(MyCallback)
<span class="hljs-comment"># Alternatively, we can pass an instance of the callback class</span>
trainer.add_callback(MyCallback())`}}),gr=new Eo({}),ur=new w({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.25.1/src/transformers/trainer_callback.py#L35"}}),et=new Pu({props:{$$slots:{default:[ju]},$$scope:{ctx:wr}}}),br=new w({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.25.1/src/transformers/trainer_callback.py#L101"}}),_r=new w({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.25.1/src/transformers/trainer_callback.py#L95"}}),kr=new Eo({}),Tr=new w({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.25.1/src/transformers/trainer_callback.py#L110"}}),{c(){A=o("meta"),B=c(),x=o("h1"),M=o("a"),W=o("span"),g(y.$$.fragment),j=c(),oe=o("span"),se=t("Callbacks"),R=c(),J=o("p"),yr=t(`Callbacks are objects that can customize the behavior of the training loop in the PyTorch
`),Ar=o("a"),Rs=t("Trainer"),Bs=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).`),ko=c(),V=o("p"),Vs=t("Callbacks are \u201Cread only\u201D pieces of code, apart from the "),Lr=o("a"),Us=t("TrainerControl"),qs=t(` object they return, they
cannot change anything in the training loop. For customizations that require changes in the training loop, you should
subclass `),Dr=o("a"),Gs=t("Trainer"),Hs=t(" and override the methods you need (see "),xr=o("a"),Js=t("trainer"),Ys=t(" for examples)."),To=c(),ye=o("p"),Xs=t("By default a "),Mr=o("a"),Ks=t("Trainer"),Qs=t(" will use the following callbacks:"),$o=c(),L=o("ul"),Or=o("li"),Sr=o("a"),Zs=t("DefaultFlowCallback"),el=t(" which handles the default behavior for logging, saving and evaluation."),tl=c(),re=o("li"),Ir=o("a"),rl=t("PrinterCallback"),al=t(" or "),Nr=o("a"),nl=t("ProgressCallback"),ol=t(` to display progress and print the
logs (the first one is used if you deactivate tqdm through the `),Pr=o("a"),sl=t("TrainingArguments"),ll=t(`, otherwise
it\u2019s the second one).`),il=c(),Fr=o("li"),Wr=o("a"),cl=t("TensorBoardCallback"),dl=t(` if tensorboard is accessible (either through PyTorch >= 1.4
or tensorboardX).`),fl=c(),Ae=o("li"),jr=o("a"),ml=t("WandbCallback"),hl=t(" if "),ct=o("a"),pl=t("wandb"),gl=t(" is installed."),ul=c(),Le=o("li"),zr=o("a"),bl=t("CometCallback"),vl=t(" if "),dt=o("a"),_l=t("comet_ml"),El=t(" is installed."),kl=c(),De=o("li"),Rr=o("a"),Tl=t("MLflowCallback"),$l=t(" if "),ft=o("a"),Cl=t("mlflow"),wl=t(" is installed."),yl=c(),xe=o("li"),Br=o("a"),Al=t("NeptuneCallback"),Ll=t(" if "),mt=o("a"),Dl=t("neptune"),xl=t(" is installed."),Ml=c(),Me=o("li"),Vr=o("a"),Ol=t("AzureMLCallback"),Sl=t(" if "),ht=o("a"),Il=t("azureml-sdk"),Nl=t(` is
installed.`),Pl=c(),Oe=o("li"),Ur=o("a"),Fl=t("CodeCarbonCallback"),Wl=t(" if "),pt=o("a"),jl=t("codecarbon"),zl=t(` is
installed.`),Rl=c(),Se=o("li"),qr=o("a"),Bl=t("ClearMLCallback"),Vl=t(" if "),gt=o("a"),Ul=t("clearml"),ql=t(" is installed."),Co=c(),N=o("p"),Gl=t("The main class that implements callbacks is "),Gr=o("a"),Hl=t("TrainerCallback"),Jl=t(`. It gets the
`),Hr=o("a"),Yl=t("TrainingArguments"),Xl=t(" used to instantiate the "),Jr=o("a"),Kl=t("Trainer"),Ql=t(`, can access that
Trainer\u2019s internal state via `),Yr=o("a"),Zl=t("TrainerState"),ei=t(`, and can take some actions on the training loop via
`),Xr=o("a"),ti=t("TrainerControl"),ri=t("."),wo=c(),le=o("h2"),Ie=o("a"),Ma=o("span"),g(ut.$$.fragment),ai=c(),Oa=o("span"),ni=t("Available Callbacks"),yo=c(),Ne=o("p"),oi=t("Here is the list of the available "),Kr=o("a"),si=t("TrainerCallback"),li=t(" in the library:"),Ao=c(),Y=o("div"),g(bt.$$.fragment),ii=c(),ie=o("p"),ci=t("A "),Qr=o("a"),di=t("TrainerCallback"),fi=t(" that sends the logs to "),vt=o("a"),mi=t("Comet ML"),hi=t("."),pi=c(),U=o("div"),g(_t.$$.fragment),gi=c(),Sa=o("p"),ui=t("Setup the optional Comet.ml integration."),bi=c(),D=o("p"),vi=t(`Environment:
COMET_MODE (`),Ia=o("code"),_i=t("str"),Ei=t(", "),Na=o("em"),ki=t("optional"),Ti=t(`):
Whether to create an online, offline experiment or disable Comet logging. Can be \u201COFFLINE\u201D, \u201CONLINE\u201D,
or \u201CDISABLED\u201D. Defaults to \u201CONLINE\u201D.
COMET_PROJECT_NAME (`),Pa=o("code"),$i=t("str"),Ci=t(", "),Fa=o("em"),wi=t("optional"),yi=t(`):
Comet project name for experiments
COMET_OFFLINE_DIRECTORY (`),Wa=o("code"),Ai=t("str"),Li=t(", "),ja=o("em"),Di=t("optional"),xi=t(`):
Folder to use for saving offline experiments when `),za=o("code"),Mi=t("COMET_MODE"),Oi=t(` is \u201COFFLINE\u201D
COMET_LOG_ASSETS (`),Ra=o("code"),Si=t("str"),Ii=t(", "),Ba=o("em"),Ni=t("optional"),Pi=t(`):
Whether or not to log training assets (tf event logs, checkpoints, etc), to Comet. Can be \u201CTRUE\u201D, or
\u201CFALSE\u201D. Defaults to \u201CTRUE\u201D.`),Fi=c(),Et=o("p"),Wi=t(`For a number of configurable items in the environment, see
`),kt=o("a"),ji=t("here"),zi=t("."),Lo=c(),ce=o("div"),g(Tt.$$.fragment),Ri=c(),$t=o("p"),Bi=t("A "),Zr=o("a"),Vi=t("TrainerCallback"),Ui=t(" that handles the default flow of the training loop for logs, evaluation and checkpoints."),Do=c(),de=o("div"),g(Ct.$$.fragment),qi=c(),wt=o("p"),Gi=t("A bare "),ea=o("a"),Hi=t("TrainerCallback"),Ji=t(" that just prints the logs."),xo=c(),fe=o("div"),g(yt.$$.fragment),Yi=c(),At=o("p"),Xi=t("A "),ta=o("a"),Ki=t("TrainerCallback"),Qi=t(" that displays the progress of training or evaluation."),Mo=c(),X=o("div"),g(Lt.$$.fragment),Zi=c(),Dt=o("p"),ec=t("A "),ra=o("a"),tc=t("TrainerCallback"),rc=t(" that handles early stopping."),ac=c(),K=o("p"),nc=t("This callback depends on "),aa=o("a"),oc=t("TrainingArguments"),sc=t(" argument "),Va=o("em"),lc=t("load_best_model_at_end"),ic=t(` functionality to set best_metric
in `),na=o("a"),cc=t("TrainerState"),dc=t("."),Oo=c(),me=o("div"),g(xt.$$.fragment),fc=c(),he=o("p"),mc=t("A "),oa=o("a"),hc=t("TrainerCallback"),pc=t(" that sends the logs to "),Mt=o("a"),gc=t("TensorBoard"),uc=t("."),So=c(),Q=o("div"),g(Ot.$$.fragment),bc=c(),pe=o("p"),vc=t("A "),sa=o("a"),_c=t("TrainerCallback"),Ec=t(" that sends the logs to "),St=o("a"),kc=t("Weight and Biases"),Tc=t("."),$c=c(),q=o("div"),g(It.$$.fragment),Cc=c(),Nt=o("p"),wc=t("Setup the optional Weights & Biases ("),Ua=o("em"),yc=t("wandb"),Ac=t(") integration."),Lc=c(),Pt=o("p"),Dc=t(`One can subclass and override this method to customize the setup if needed. Find more information
`),Ft=o("a"),xc=t("here"),Mc=t(`. You can also override the following environment
variables:`),Oc=c(),h=o("p"),Sc=t(`Environment:
WANDB_LOG_MODEL (`),qa=o("code"),Ic=t("bool"),Nc=t(", "),Ga=o("em"),Pc=t("optional"),Fc=t(", defaults to "),Ha=o("code"),Wc=t("False"),jc=t(`):
Whether or not to log model as artifact at the end of training. Use along with
`),Ja=o("em"),zc=t("TrainingArguments.load_best_model_at_end"),Rc=t(` to upload best model.
WANDB_WATCH (`),Ya=o("code"),Bc=t("str"),Vc=t(", "),Xa=o("em"),Uc=t("optional"),qc=t(" defaults to "),Ka=o("code"),Gc=t('"gradients"'),Hc=t(`):
Can be `),Qa=o("code"),Jc=t('"gradients"'),Yc=t(", "),Za=o("code"),Xc=t('"all"'),Kc=t(" or "),en=o("code"),Qc=t('"false"'),Zc=t(". Set to "),tn=o("code"),ed=t('"false"'),td=t(" to disable gradient logging or "),rn=o("code"),rd=t('"all"'),ad=t(` to
log gradients and parameters.
WANDB_PROJECT (`),an=o("code"),nd=t("str"),od=t(", "),nn=o("em"),sd=t("optional"),ld=t(", defaults to "),on=o("code"),id=t('"huggingface"'),cd=t(`):
Set this to a custom string to store results in a different project.
WANDB_DISABLED (`),sn=o("code"),dd=t("bool"),fd=t(", "),ln=o("em"),md=t("optional"),hd=t(", defaults to "),cn=o("code"),pd=t("False"),gd=t(`):
Whether or not to disable wandb entirely. Set `),dn=o("em"),ud=t("WANDB_DISABLED=true"),bd=t(" to disable."),Io=c(),Z=o("div"),g(Wt.$$.fragment),vd=c(),ee=o("p"),_d=t("A "),la=o("a"),Ed=t("TrainerCallback"),kd=t(" that sends the logs to "),jt=o("a"),Td=t("MLflow"),$d=t(`. Can be disabled by setting
environment variable `),fn=o("code"),Cd=t("DISABLE_MLFLOW_INTEGRATION = TRUE"),wd=t("."),yd=c(),ae=o("div"),g(zt.$$.fragment),Ad=c(),mn=o("p"),Ld=t("Setup the optional MLflow integration."),Dd=c(),p=o("p"),xd=t(`Environment:
HF_MLFLOW_LOG_ARTIFACTS (`),hn=o("code"),Md=t("str"),Od=t(", "),pn=o("em"),Sd=t("optional"),Id=t(`):
Whether to use MLflow .log_artifact() facility to log artifacts. This only makes sense if logging to a
remote server, e.g. s3 or GCS. If set to `),gn=o("code"),Nd=t("True"),Pd=t(" or "),un=o("em"),Fd=t("1"),Wd=t(`, will copy each saved checkpoint on each save in
`),ia=o("a"),jd=t("TrainingArguments"),zd=t("\u2019s "),bn=o("code"),Rd=t("output_dir"),Bd=t(` to the local or remote artifact storage. Using it without a remote
storage will just copy the files to your artifact location.
MLFLOW_EXPERIMENT_NAME (`),vn=o("code"),Vd=t("str"),Ud=t(", "),_n=o("em"),qd=t("optional"),Gd=t(`):
Whether to use an MLflow experiment_name under which to launch the run. Default to \u201CNone\u201D which will
point to the \u201CDefault\u201D 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.
MLFLOW_TAGS (`),En=o("code"),Hd=t("str"),Jd=t(", "),kn=o("em"),Yd=t("optional"),Xd=t(`):
A string dump of a dictionary of key/value pair to be added to the MLflow run as tags. Example:
os.environ[\u2018MLFLOW_TAGS\u2019]=\u2019{\u201Crelease.candidate\u201D: \u201CRC1\u201D, \u201Crelease.version\u201D: \u201C2.2.0\u201D}\u2019
MLFLOW_NESTED_RUN (`),Tn=o("code"),Kd=t("str"),Qd=t(", "),$n=o("em"),Zd=t("optional"),ef=t(`):
Whether to use MLflow nested runs. If set to `),Cn=o("code"),tf=t("True"),rf=t(" or "),wn=o("em"),af=t("1"),nf=t(`, will create a nested run inside the current
run.
MLFLOW_RUN_ID (`),yn=o("code"),of=t("str"),sf=t(", "),An=o("em"),lf=t("optional"),cf=t(`):
Allow to reattach to an existing run which can be usefull when resuming training from a checkpoint.
When MLFLOW_RUN_ID environment variable is set, start_run attempts to resume a run with the specified
run ID and other parameters are ignored.
MLFLOW_FLATTEN_PARAMS (`),Ln=o("code"),df=t("str"),ff=t(", "),Dn=o("em"),mf=t("optional"),hf=t(`):
Whether to flatten the parameters dictionary before logging. Default to `),xn=o("code"),pf=t("False"),gf=t("."),No=c(),ge=o("div"),g(Rt.$$.fragment),uf=c(),ue=o("p"),bf=t("A "),ca=o("a"),vf=t("TrainerCallback"),_f=t(" that sends the logs to "),Bt=o("a"),Ef=t("AzureML"),kf=t("."),Po=c(),be=o("div"),g(Vt.$$.fragment),Tf=c(),Ut=o("p"),$f=t("A "),da=o("a"),Cf=t("TrainerCallback"),wf=t(" that tracks the CO2 emission of training."),Fo=c(),ve=o("div"),g(qt.$$.fragment),yf=c(),Gt=o("p"),Af=t("TrainerCallback that sends the logs to "),Ht=o("a"),Lf=t("Neptune"),Df=t("."),Wo=c(),te=o("div"),g(Jt.$$.fragment),xf=c(),_e=o("p"),Mf=t("A "),fa=o("a"),Of=t("TrainerCallback"),Sf=t(" that sends the logs to "),Yt=o("a"),If=t("ClearML"),Nf=t("."),Pf=c(),I=o("p"),Ff=t(`Environment:
CLEARML_PROJECT (`),Mn=o("code"),Wf=t("str"),jf=t(", "),On=o("em"),zf=t("optional"),Rf=t(", defaults to "),Sn=o("code"),Bf=t('"HuggingFace Transformers"'),Vf=t(`):
ClearML project name.
CLEARML_TASK (`),In=o("code"),Uf=t("str"),qf=t(", "),Nn=o("em"),Gf=t("optional"),Hf=t(" defaults to "),Pn=o("code"),Jf=t('"Trainer"'),Yf=t(`):
ClearML task name.`),jo=c(),Ee=o("h2"),Pe=o("a"),Fn=o("span"),g(Xt.$$.fragment),Xf=c(),Wn=o("span"),Kf=t("TrainerCallback"),zo=c(),k=o("div"),g(Kt.$$.fragment),Qf=c(),jn=o("p"),Zf=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:`),em=c(),Qt=o("p"),tm=t("The "),zn=o("code"),rm=t("control"),am=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.`),nm=c(),P=o("p"),om=t("The argument "),Rn=o("code"),sm=t("args"),lm=t(", "),Bn=o("code"),im=t("state"),cm=t(" and "),Vn=o("code"),dm=t("control"),fm=t(" are positionals for all events, all the others are grouped in "),Un=o("code"),mm=t("kwargs"),hm=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 `),qn=o("code"),pm=t("~transformer.PrinterCallback"),gm=t("."),um=c(),g(Fe.$$.fragment),bm=c(),We=o("div"),g(Zt.$$.fragment),vm=c(),Gn=o("p"),_m=t("Event called at the beginning of an epoch."),Em=c(),je=o("div"),g(er.$$.fragment),km=c(),Hn=o("p"),Tm=t("Event called at the end of an epoch."),$m=c(),ze=o("div"),g(tr.$$.fragment),Cm=c(),Jn=o("p"),wm=t("Event called after an evaluation phase."),ym=c(),Re=o("div"),g(rr.$$.fragment),Am=c(),ar=o("p"),Lm=t("Event called at the end of the initialization of the "),ma=o("a"),Dm=t("Trainer"),xm=t("."),Mm=c(),Be=o("div"),g(nr.$$.fragment),Om=c(),Yn=o("p"),Sm=t("Event called after logging the last logs."),Im=c(),Ve=o("div"),g(or.$$.fragment),Nm=c(),Xn=o("p"),Pm=t("Event called after a successful prediction."),Fm=c(),Ue=o("div"),g(sr.$$.fragment),Wm=c(),Kn=o("p"),jm=t("Event called after a prediction step."),zm=c(),qe=o("div"),g(lr.$$.fragment),Rm=c(),Qn=o("p"),Bm=t("Event called after a checkpoint save."),Vm=c(),Ge=o("div"),g(ir.$$.fragment),Um=c(),Zn=o("p"),qm=t(`Event called at the beginning of a training step. If using gradient accumulation, one training step might take
several inputs.`),Gm=c(),He=o("div"),g(cr.$$.fragment),Hm=c(),eo=o("p"),Jm=t(`Event called at the end of a training step. If using gradient accumulation, one training step might take
several inputs.`),Ym=c(),Je=o("div"),g(dr.$$.fragment),Xm=c(),to=o("p"),Km=t("Event called at the end of an substep during gradient accumulation."),Qm=c(),Ye=o("div"),g(fr.$$.fragment),Zm=c(),ro=o("p"),eh=t("Event called at the beginning of training."),th=c(),Xe=o("div"),g(mr.$$.fragment),rh=c(),ao=o("p"),ah=t("Event called at the end of training."),Ro=c(),Ke=o("p"),nh=t("Here is an example of how to register a custom callback with the PyTorch "),ha=o("a"),oh=t("Trainer"),sh=t(":"),Bo=c(),g(hr.$$.fragment),Vo=c(),Qe=o("p"),lh=t("Another way to register a callback is to call "),no=o("code"),ih=t("trainer.add_callback()"),ch=t(" as follows:"),Uo=c(),g(pr.$$.fragment),qo=c(),ke=o("h2"),Ze=o("a"),oo=o("span"),g(gr.$$.fragment),dh=c(),so=o("span"),fh=t("TrainerState"),Go=c(),F=o("div"),g(ur.$$.fragment),mh=c(),Te=o("p"),hh=t("A class containing the "),pa=o("a"),ph=t("Trainer"),gh=t(` inner state that will be saved along the model and optimizer when checkpointing
and passed to the `),ga=o("a"),uh=t("TrainerCallback"),bh=t("."),vh=c(),g(et.$$.fragment),_h=c(),tt=o("div"),g(br.$$.fragment),Eh=c(),vr=o("p"),kh=t("Create an instance from the content of "),lo=o("code"),Th=t("json_path"),$h=t("."),Ch=c(),rt=o("div"),g(_r.$$.fragment),wh=c(),Er=o("p"),yh=t("Save the content of this instance in JSON format inside "),io=o("code"),Ah=t("json_path"),Lh=t("."),Ho=c(),$e=o("h2"),at=o("a"),co=o("span"),g(kr.$$.fragment),Dh=c(),fo=o("span"),xh=t("TrainerControl"),Jo=c(),Ce=o("div"),g(Tr.$$.fragment),Mh=c(),we=o("p"),Oh=t("A class that handles the "),ua=o("a"),Sh=t("Trainer"),Ih=t(" control flow. This class is used by the "),ba=o("a"),Nh=t("TrainerCallback"),Ph=t(` to activate some
switches in the training loop.`),this.h()},l(n){const f=Su('[data-svelte="svelte-1phssyn"]',document.head);A=s(f,"META",{name:!0,content:!0}),f.forEach(a),B=d(n),x=s(n,"H1",{class:!0});var $r=l(x);M=s($r,"A",{id:!0,class:!0,href:!0});var mo=l(M);W=s(mo,"SPAN",{});var zh=l(W);u(y.$$.fragment,zh),zh.forEach(a),mo.forEach(a),j=d($r),oe=s($r,"SPAN",{});var Rh=l(oe);se=r(Rh,"Callbacks"),Rh.forEach(a),$r.forEach(a),R=d(n),J=s(n,"P",{});var Xo=l(J);yr=r(Xo,`Callbacks are objects that can customize the behavior of the training loop in the PyTorch
`),Ar=s(Xo,"A",{href:!0});var Bh=l(Ar);Rs=r(Bh,"Trainer"),Bh.forEach(a),Bs=r(Xo,` (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).`),Xo.forEach(a),ko=d(n),V=s(n,"P",{});var nt=l(V);Vs=r(nt,"Callbacks are \u201Cread only\u201D pieces of code, apart from the "),Lr=s(nt,"A",{href:!0});var Vh=l(Lr);Us=r(Vh,"TrainerControl"),Vh.forEach(a),qs=r(nt,` object they return, they
cannot change anything in the training loop. For customizations that require changes in the training loop, you should
subclass `),Dr=s(nt,"A",{href:!0});var Uh=l(Dr);Gs=r(Uh,"Trainer"),Uh.forEach(a),Hs=r(nt," and override the methods you need (see "),xr=s(nt,"A",{href:!0});var qh=l(xr);Js=r(qh,"trainer"),qh.forEach(a),Ys=r(nt," for examples)."),nt.forEach(a),To=d(n),ye=s(n,"P",{});var Ko=l(ye);Xs=r(Ko,"By default a "),Mr=s(Ko,"A",{href:!0});var Gh=l(Mr);Ks=r(Gh,"Trainer"),Gh.forEach(a),Qs=r(Ko," will use the following callbacks:"),Ko.forEach(a),$o=d(n),L=s(n,"UL",{});var O=l(L);Or=s(O,"LI",{});var Fh=l(Or);Sr=s(Fh,"A",{href:!0});var Hh=l(Sr);Zs=r(Hh,"DefaultFlowCallback"),Hh.forEach(a),el=r(Fh," which handles the default behavior for logging, saving and evaluation."),Fh.forEach(a),tl=d(O),re=s(O,"LI",{});var Cr=l(re);Ir=s(Cr,"A",{href:!0});var Jh=l(Ir);rl=r(Jh,"PrinterCallback"),Jh.forEach(a),al=r(Cr," or "),Nr=s(Cr,"A",{href:!0});var Yh=l(Nr);nl=r(Yh,"ProgressCallback"),Yh.forEach(a),ol=r(Cr,` to display progress and print the
logs (the first one is used if you deactivate tqdm through the `),Pr=s(Cr,"A",{href:!0});var Xh=l(Pr);sl=r(Xh,"TrainingArguments"),Xh.forEach(a),ll=r(Cr,`, otherwise
it\u2019s the second one).`),Cr.forEach(a),il=d(O),Fr=s(O,"LI",{});var Wh=l(Fr);Wr=s(Wh,"A",{href:!0});var Kh=l(Wr);cl=r(Kh,"TensorBoardCallback"),Kh.forEach(a),dl=r(Wh,` if tensorboard is accessible (either through PyTorch >= 1.4
or tensorboardX).`),Wh.forEach(a),fl=d(O),Ae=s(O,"LI",{});var ho=l(Ae);jr=s(ho,"A",{href:!0});var Qh=l(jr);ml=r(Qh,"WandbCallback"),Qh.forEach(a),hl=r(ho," if "),ct=s(ho,"A",{href:!0,rel:!0});var Zh=l(ct);pl=r(Zh,"wandb"),Zh.forEach(a),gl=r(ho," is installed."),ho.forEach(a),ul=d(O),Le=s(O,"LI",{});var po=l(Le);zr=s(po,"A",{href:!0});var ep=l(zr);bl=r(ep,"CometCallback"),ep.forEach(a),vl=r(po," if "),dt=s(po,"A",{href:!0,rel:!0});var tp=l(dt);_l=r(tp,"comet_ml"),tp.forEach(a),El=r(po," is installed."),po.forEach(a),kl=d(O),De=s(O,"LI",{});var go=l(De);Rr=s(go,"A",{href:!0});var rp=l(Rr);Tl=r(rp,"MLflowCallback"),rp.forEach(a),$l=r(go," if "),ft=s(go,"A",{href:!0,rel:!0});var ap=l(ft);Cl=r(ap,"mlflow"),ap.forEach(a),wl=r(go," is installed."),go.forEach(a),yl=d(O),xe=s(O,"LI",{});var uo=l(xe);Br=s(uo,"A",{href:!0});var np=l(Br);Al=r(np,"NeptuneCallback"),np.forEach(a),Ll=r(uo," if "),mt=s(uo,"A",{href:!0,rel:!0});var op=l(mt);Dl=r(op,"neptune"),op.forEach(a),xl=r(uo," is installed."),uo.forEach(a),Ml=d(O),Me=s(O,"LI",{});var bo=l(Me);Vr=s(bo,"A",{href:!0});var sp=l(Vr);Ol=r(sp,"AzureMLCallback"),sp.forEach(a),Sl=r(bo," if "),ht=s(bo,"A",{href:!0,rel:!0});var lp=l(ht);Il=r(lp,"azureml-sdk"),lp.forEach(a),Nl=r(bo,` is
installed.`),bo.forEach(a),Pl=d(O),Oe=s(O,"LI",{});var vo=l(Oe);Ur=s(vo,"A",{href:!0});var ip=l(Ur);Fl=r(ip,"CodeCarbonCallback"),ip.forEach(a),Wl=r(vo," if "),pt=s(vo,"A",{href:!0,rel:!0});var cp=l(pt);jl=r(cp,"codecarbon"),cp.forEach(a),zl=r(vo,` is
installed.`),vo.forEach(a),Rl=d(O),Se=s(O,"LI",{});var _o=l(Se);qr=s(_o,"A",{href:!0});var dp=l(qr);Bl=r(dp,"ClearMLCallback"),dp.forEach(a),Vl=r(_o," if "),gt=s(_o,"A",{href:!0,rel:!0});var fp=l(gt);Ul=r(fp,"clearml"),fp.forEach(a),ql=r(_o," is installed."),_o.forEach(a),O.forEach(a),Co=d(n),N=s(n,"P",{});var G=l(N);Gl=r(G,"The main class that implements callbacks is "),Gr=s(G,"A",{href:!0});var mp=l(Gr);Hl=r(mp,"TrainerCallback"),mp.forEach(a),Jl=r(G,`. It gets the
`),Hr=s(G,"A",{href:!0});var hp=l(Hr);Yl=r(hp,"TrainingArguments"),hp.forEach(a),Xl=r(G," used to instantiate the "),Jr=s(G,"A",{href:!0});var pp=l(Jr);Kl=r(pp,"Trainer"),pp.forEach(a),Ql=r(G,`, can access that
Trainer\u2019s internal state via `),Yr=s(G,"A",{href:!0});var gp=l(Yr);Zl=r(gp,"TrainerState"),gp.forEach(a),ei=r(G,`, and can take some actions on the training loop via
`),Xr=s(G,"A",{href:!0});var up=l(Xr);ti=r(up,"TrainerControl"),up.forEach(a),ri=r(G,"."),G.forEach(a),wo=d(n),le=s(n,"H2",{class:!0});var Qo=l(le);Ie=s(Qo,"A",{id:!0,class:!0,href:!0});var bp=l(Ie);Ma=s(bp,"SPAN",{});var vp=l(Ma);u(ut.$$.fragment,vp),vp.forEach(a),bp.forEach(a),ai=d(Qo),Oa=s(Qo,"SPAN",{});var _p=l(Oa);ni=r(_p,"Available Callbacks"),_p.forEach(a),Qo.forEach(a),yo=d(n),Ne=s(n,"P",{});var Zo=l(Ne);oi=r(Zo,"Here is the list of the available "),Kr=s(Zo,"A",{href:!0});var Ep=l(Kr);si=r(Ep,"TrainerCallback"),Ep.forEach(a),li=r(Zo," in the library:"),Zo.forEach(a),Ao=d(n),Y=s(n,"DIV",{class:!0});var va=l(Y);u(bt.$$.fragment,va),ii=d(va),ie=s(va,"P",{});var _a=l(ie);ci=r(_a,"A "),Qr=s(_a,"A",{href:!0});var kp=l(Qr);di=r(kp,"TrainerCallback"),kp.forEach(a),fi=r(_a," that sends the logs to "),vt=s(_a,"A",{href:!0,rel:!0});var Tp=l(vt);mi=r(Tp,"Comet ML"),Tp.forEach(a),hi=r(_a,"."),_a.forEach(a),pi=d(va),U=s(va,"DIV",{class:!0});var ot=l(U);u(_t.$$.fragment,ot),gi=d(ot),Sa=s(ot,"P",{});var $p=l(Sa);ui=r($p,"Setup the optional Comet.ml integration."),$p.forEach(a),bi=d(ot),D=s(ot,"P",{});var S=l(D);vi=r(S,`Environment:
COMET_MODE (`),Ia=s(S,"CODE",{});var Cp=l(Ia);_i=r(Cp,"str"),Cp.forEach(a),Ei=r(S,", "),Na=s(S,"EM",{});var wp=l(Na);ki=r(wp,"optional"),wp.forEach(a),Ti=r(S,`):
Whether to create an online, offline experiment or disable Comet logging. Can be \u201COFFLINE\u201D, \u201CONLINE\u201D,
or \u201CDISABLED\u201D. Defaults to \u201CONLINE\u201D.
COMET_PROJECT_NAME (`),Pa=s(S,"CODE",{});var yp=l(Pa);$i=r(yp,"str"),yp.forEach(a),Ci=r(S,", "),Fa=s(S,"EM",{});var Ap=l(Fa);wi=r(Ap,"optional"),Ap.forEach(a),yi=r(S,`):
Comet project name for experiments
COMET_OFFLINE_DIRECTORY (`),Wa=s(S,"CODE",{});var Lp=l(Wa);Ai=r(Lp,"str"),Lp.forEach(a),Li=r(S,", "),ja=s(S,"EM",{});var Dp=l(ja);Di=r(Dp,"optional"),Dp.forEach(a),xi=r(S,`):
Folder to use for saving offline experiments when `),za=s(S,"CODE",{});var xp=l(za);Mi=r(xp,"COMET_MODE"),xp.forEach(a),Oi=r(S,` is \u201COFFLINE\u201D
COMET_LOG_ASSETS (`),Ra=s(S,"CODE",{});var Mp=l(Ra);Si=r(Mp,"str"),Mp.forEach(a),Ii=r(S,", "),Ba=s(S,"EM",{});var Op=l(Ba);Ni=r(Op,"optional"),Op.forEach(a),Pi=r(S,`):
Whether or not to log training assets (tf event logs, checkpoints, etc), to Comet. Can be \u201CTRUE\u201D, or
\u201CFALSE\u201D. Defaults to \u201CTRUE\u201D.`),S.forEach(a),Fi=d(ot),Et=s(ot,"P",{});var es=l(Et);Wi=r(es,`For a number of configurable items in the environment, see
`),kt=s(es,"A",{href:!0,rel:!0});var Sp=l(kt);ji=r(Sp,"here"),Sp.forEach(a),zi=r(es,"."),es.forEach(a),ot.forEach(a),va.forEach(a),Lo=d(n),ce=s(n,"DIV",{class:!0});var ts=l(ce);u(Tt.$$.fragment,ts),Ri=d(ts),$t=s(ts,"P",{});var rs=l($t);Bi=r(rs,"A "),Zr=s(rs,"A",{href:!0});var Ip=l(Zr);Vi=r(Ip,"TrainerCallback"),Ip.forEach(a),Ui=r(rs," that handles the default flow of the training loop for logs, evaluation and checkpoints."),rs.forEach(a),ts.forEach(a),Do=d(n),de=s(n,"DIV",{class:!0});var as=l(de);u(Ct.$$.fragment,as),qi=d(as),wt=s(as,"P",{});var ns=l(wt);Gi=r(ns,"A bare "),ea=s(ns,"A",{href:!0});var Np=l(ea);Hi=r(Np,"TrainerCallback"),Np.forEach(a),Ji=r(ns," that just prints the logs."),ns.forEach(a),as.forEach(a),xo=d(n),fe=s(n,"DIV",{class:!0});var os=l(fe);u(yt.$$.fragment,os),Yi=d(os),At=s(os,"P",{});var ss=l(At);Xi=r(ss,"A "),ta=s(ss,"A",{href:!0});var Pp=l(ta);Ki=r(Pp,"TrainerCallback"),Pp.forEach(a),Qi=r(ss," that displays the progress of training or evaluation."),ss.forEach(a),os.forEach(a),Mo=d(n),X=s(n,"DIV",{class:!0});var Ea=l(X);u(Lt.$$.fragment,Ea),Zi=d(Ea),Dt=s(Ea,"P",{});var ls=l(Dt);ec=r(ls,"A "),ra=s(ls,"A",{href:!0});var Fp=l(ra);tc=r(Fp,"TrainerCallback"),Fp.forEach(a),rc=r(ls," that handles early stopping."),ls.forEach(a),ac=d(Ea),K=s(Ea,"P",{});var st=l(K);nc=r(st,"This callback depends on "),aa=s(st,"A",{href:!0});var Wp=l(aa);oc=r(Wp,"TrainingArguments"),Wp.forEach(a),sc=r(st," argument "),Va=s(st,"EM",{});var jp=l(Va);lc=r(jp,"load_best_model_at_end"),jp.forEach(a),ic=r(st,` functionality to set best_metric
in `),na=s(st,"A",{href:!0});var zp=l(na);cc=r(zp,"TrainerState"),zp.forEach(a),dc=r(st,"."),st.forEach(a),Ea.forEach(a),Oo=d(n),me=s(n,"DIV",{class:!0});var is=l(me);u(xt.$$.fragment,is),fc=d(is),he=s(is,"P",{});var ka=l(he);mc=r(ka,"A "),oa=s(ka,"A",{href:!0});var Rp=l(oa);hc=r(Rp,"TrainerCallback"),Rp.forEach(a),pc=r(ka," that sends the logs to "),Mt=s(ka,"A",{href:!0,rel:!0});var Bp=l(Mt);gc=r(Bp,"TensorBoard"),Bp.forEach(a),uc=r(ka,"."),ka.forEach(a),is.forEach(a),So=d(n),Q=s(n,"DIV",{class:!0});var Ta=l(Q);u(Ot.$$.fragment,Ta),bc=d(Ta),pe=s(Ta,"P",{});var $a=l(pe);vc=r($a,"A "),sa=s($a,"A",{href:!0});var Vp=l(sa);_c=r(Vp,"TrainerCallback"),Vp.forEach(a),Ec=r($a," that sends the logs to "),St=s($a,"A",{href:!0,rel:!0});var Up=l(St);kc=r(Up,"Weight and Biases"),Up.forEach(a),Tc=r($a,"."),$a.forEach(a),$c=d(Ta),q=s(Ta,"DIV",{class:!0});var lt=l(q);u(It.$$.fragment,lt),Cc=d(lt),Nt=s(lt,"P",{});var cs=l(Nt);wc=r(cs,"Setup the optional Weights & Biases ("),Ua=s(cs,"EM",{});var qp=l(Ua);yc=r(qp,"wandb"),qp.forEach(a),Ac=r(cs,") integration."),cs.forEach(a),Lc=d(lt),Pt=s(lt,"P",{});var ds=l(Pt);Dc=r(ds,`One can subclass and override this method to customize the setup if needed. Find more information
`),Ft=s(ds,"A",{href:!0,rel:!0});var Gp=l(Ft);xc=r(Gp,"here"),Gp.forEach(a),Mc=r(ds,`. You can also override the following environment
variables:`),ds.forEach(a),Oc=d(lt),h=s(lt,"P",{});var T=l(h);Sc=r(T,`Environment:
WANDB_LOG_MODEL (`),qa=s(T,"CODE",{});var Hp=l(qa);Ic=r(Hp,"bool"),Hp.forEach(a),Nc=r(T,", "),Ga=s(T,"EM",{});var Jp=l(Ga);Pc=r(Jp,"optional"),Jp.forEach(a),Fc=r(T,", defaults to "),Ha=s(T,"CODE",{});var Yp=l(Ha);Wc=r(Yp,"False"),Yp.forEach(a),jc=r(T,`):
Whether or not to log model as artifact at the end of training. Use along with
`),Ja=s(T,"EM",{});var Xp=l(Ja);zc=r(Xp,"TrainingArguments.load_best_model_at_end"),Xp.forEach(a),Rc=r(T,` to upload best model.
WANDB_WATCH (`),Ya=s(T,"CODE",{});var Kp=l(Ya);Bc=r(Kp,"str"),Kp.forEach(a),Vc=r(T,", "),Xa=s(T,"EM",{});var Qp=l(Xa);Uc=r(Qp,"optional"),Qp.forEach(a),qc=r(T," defaults to "),Ka=s(T,"CODE",{});var Zp=l(Ka);Gc=r(Zp,'"gradients"'),Zp.forEach(a),Hc=r(T,`):
Can be `),Qa=s(T,"CODE",{});var eg=l(Qa);Jc=r(eg,'"gradients"'),eg.forEach(a),Yc=r(T,", "),Za=s(T,"CODE",{});var tg=l(Za);Xc=r(tg,'"all"'),tg.forEach(a),Kc=r(T," or "),en=s(T,"CODE",{});var rg=l(en);Qc=r(rg,'"false"'),rg.forEach(a),Zc=r(T,". Set to "),tn=s(T,"CODE",{});var ag=l(tn);ed=r(ag,'"false"'),ag.forEach(a),td=r(T," to disable gradient logging or "),rn=s(T,"CODE",{});var ng=l(rn);rd=r(ng,'"all"'),ng.forEach(a),ad=r(T,` to
log gradients and parameters.
WANDB_PROJECT (`),an=s(T,"CODE",{});var og=l(an);nd=r(og,"str"),og.forEach(a),od=r(T,", "),nn=s(T,"EM",{});var sg=l(nn);sd=r(sg,"optional"),sg.forEach(a),ld=r(T,", defaults to "),on=s(T,"CODE",{});var lg=l(on);id=r(lg,'"huggingface"'),lg.forEach(a),cd=r(T,`):
Set this to a custom string to store results in a different project.
WANDB_DISABLED (`),sn=s(T,"CODE",{});var ig=l(sn);dd=r(ig,"bool"),ig.forEach(a),fd=r(T,", "),ln=s(T,"EM",{});var cg=l(ln);md=r(cg,"optional"),cg.forEach(a),hd=r(T,", defaults to "),cn=s(T,"CODE",{});var dg=l(cn);pd=r(dg,"False"),dg.forEach(a),gd=r(T,`):
Whether or not to disable wandb entirely. Set `),dn=s(T,"EM",{});var fg=l(dn);ud=r(fg,"WANDB_DISABLED=true"),fg.forEach(a),bd=r(T," to disable."),T.forEach(a),lt.forEach(a),Ta.forEach(a),Io=d(n),Z=s(n,"DIV",{class:!0});var Ca=l(Z);u(Wt.$$.fragment,Ca),vd=d(Ca),ee=s(Ca,"P",{});var it=l(ee);_d=r(it,"A "),la=s(it,"A",{href:!0});var mg=l(la);Ed=r(mg,"TrainerCallback"),mg.forEach(a),kd=r(it," that sends the logs to "),jt=s(it,"A",{href:!0,rel:!0});var hg=l(jt);Td=r(hg,"MLflow"),hg.forEach(a),$d=r(it,`. Can be disabled by setting
environment variable `),fn=s(it,"CODE",{});var pg=l(fn);Cd=r(pg,"DISABLE_MLFLOW_INTEGRATION = TRUE"),pg.forEach(a),wd=r(it,"."),it.forEach(a),yd=d(Ca),ae=s(Ca,"DIV",{class:!0});var wa=l(ae);u(zt.$$.fragment,wa),Ad=d(wa),mn=s(wa,"P",{});var gg=l(mn);Ld=r(gg,"Setup the optional MLflow integration."),gg.forEach(a),Dd=d(wa),p=s(wa,"P",{});var $=l(p);xd=r($,`Environment:
HF_MLFLOW_LOG_ARTIFACTS (`),hn=s($,"CODE",{});var ug=l(hn);Md=r(ug,"str"),ug.forEach(a),Od=r($,", "),pn=s($,"EM",{});var bg=l(pn);Sd=r(bg,"optional"),bg.forEach(a),Id=r($,`):
Whether to use MLflow .log_artifact() facility to log artifacts. This only makes sense if logging to a
remote server, e.g. s3 or GCS. If set to `),gn=s($,"CODE",{});var vg=l(gn);Nd=r(vg,"True"),vg.forEach(a),Pd=r($," or "),un=s($,"EM",{});var _g=l(un);Fd=r(_g,"1"),_g.forEach(a),Wd=r($,`, will copy each saved checkpoint on each save in
`),ia=s($,"A",{href:!0});var Eg=l(ia);jd=r(Eg,"TrainingArguments"),Eg.forEach(a),zd=r($,"\u2019s "),bn=s($,"CODE",{});var kg=l(bn);Rd=r(kg,"output_dir"),kg.forEach(a),Bd=r($,` to the local or remote artifact storage. Using it without a remote
storage will just copy the files to your artifact location.
MLFLOW_EXPERIMENT_NAME (`),vn=s($,"CODE",{});var Tg=l(vn);Vd=r(Tg,"str"),Tg.forEach(a),Ud=r($,", "),_n=s($,"EM",{});var $g=l(_n);qd=r($g,"optional"),$g.forEach(a),Gd=r($,`):
Whether to use an MLflow experiment_name under which to launch the run. Default to \u201CNone\u201D which will
point to the \u201CDefault\u201D 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.
MLFLOW_TAGS (`),En=s($,"CODE",{});var Cg=l(En);Hd=r(Cg,"str"),Cg.forEach(a),Jd=r($,", "),kn=s($,"EM",{});var wg=l(kn);Yd=r(wg,"optional"),wg.forEach(a),Xd=r($,`):
A string dump of a dictionary of key/value pair to be added to the MLflow run as tags. Example:
os.environ[\u2018MLFLOW_TAGS\u2019]=\u2019{\u201Crelease.candidate\u201D: \u201CRC1\u201D, \u201Crelease.version\u201D: \u201C2.2.0\u201D}\u2019
MLFLOW_NESTED_RUN (`),Tn=s($,"CODE",{});var yg=l(Tn);Kd=r(yg,"str"),yg.forEach(a),Qd=r($,", "),$n=s($,"EM",{});var Ag=l($n);Zd=r(Ag,"optional"),Ag.forEach(a),ef=r($,`):
Whether to use MLflow nested runs. If set to `),Cn=s($,"CODE",{});var Lg=l(Cn);tf=r(Lg,"True"),Lg.forEach(a),rf=r($," or "),wn=s($,"EM",{});var Dg=l(wn);af=r(Dg,"1"),Dg.forEach(a),nf=r($,`, will create a nested run inside the current
run.
MLFLOW_RUN_ID (`),yn=s($,"CODE",{});var xg=l(yn);of=r(xg,"str"),xg.forEach(a),sf=r($,", "),An=s($,"EM",{});var Mg=l(An);lf=r(Mg,"optional"),Mg.forEach(a),cf=r($,`):
Allow to reattach to an existing run which can be usefull when resuming training from a checkpoint.
When MLFLOW_RUN_ID environment variable is set, start_run attempts to resume a run with the specified
run ID and other parameters are ignored.
MLFLOW_FLATTEN_PARAMS (`),Ln=s($,"CODE",{});var Og=l(Ln);df=r(Og,"str"),Og.forEach(a),ff=r($,", "),Dn=s($,"EM",{});var Sg=l(Dn);mf=r(Sg,"optional"),Sg.forEach(a),hf=r($,`):
Whether to flatten the parameters dictionary before logging. Default to `),xn=s($,"CODE",{});var Ig=l(xn);pf=r(Ig,"False"),Ig.forEach(a),gf=r($,"."),$.forEach(a),wa.forEach(a),Ca.forEach(a),No=d(n),ge=s(n,"DIV",{class:!0});var fs=l(ge);u(Rt.$$.fragment,fs),uf=d(fs),ue=s(fs,"P",{});var ya=l(ue);bf=r(ya,"A "),ca=s(ya,"A",{href:!0});var Ng=l(ca);vf=r(Ng,"TrainerCallback"),Ng.forEach(a),_f=r(ya," that sends the logs to "),Bt=s(ya,"A",{href:!0,rel:!0});var Pg=l(Bt);Ef=r(Pg,"AzureML"),Pg.forEach(a),kf=r(ya,"."),ya.forEach(a),fs.forEach(a),Po=d(n),be=s(n,"DIV",{class:!0});var ms=l(be);u(Vt.$$.fragment,ms),Tf=d(ms),Ut=s(ms,"P",{});var hs=l(Ut);$f=r(hs,"A "),da=s(hs,"A",{href:!0});var Fg=l(da);Cf=r(Fg,"TrainerCallback"),Fg.forEach(a),wf=r(hs," that tracks the CO2 emission of training."),hs.forEach(a),ms.forEach(a),Fo=d(n),ve=s(n,"DIV",{class:!0});var ps=l(ve);u(qt.$$.fragment,ps),yf=d(ps),Gt=s(ps,"P",{});var gs=l(Gt);Af=r(gs,"TrainerCallback that sends the logs to "),Ht=s(gs,"A",{href:!0,rel:!0});var Wg=l(Ht);Lf=r(Wg,"Neptune"),Wg.forEach(a),Df=r(gs,"."),gs.forEach(a),ps.forEach(a),Wo=d(n),te=s(n,"DIV",{class:!0});var Aa=l(te);u(Jt.$$.fragment,Aa),xf=d(Aa),_e=s(Aa,"P",{});var La=l(_e);Mf=r(La,"A "),fa=s(La,"A",{href:!0});var jg=l(fa);Of=r(jg,"TrainerCallback"),jg.forEach(a),Sf=r(La," that sends the logs to "),Yt=s(La,"A",{href:!0,rel:!0});var zg=l(Yt);If=r(zg,"ClearML"),zg.forEach(a),Nf=r(La,"."),La.forEach(a),Pf=d(Aa),I=s(Aa,"P",{});var z=l(I);Ff=r(z,`Environment:
CLEARML_PROJECT (`),Mn=s(z,"CODE",{});var Rg=l(Mn);Wf=r(Rg,"str"),Rg.forEach(a),jf=r(z,", "),On=s(z,"EM",{});var Bg=l(On);zf=r(Bg,"optional"),Bg.forEach(a),Rf=r(z,", defaults to "),Sn=s(z,"CODE",{});var Vg=l(Sn);Bf=r(Vg,'"HuggingFace Transformers"'),Vg.forEach(a),Vf=r(z,`):
ClearML project name.
CLEARML_TASK (`),In=s(z,"CODE",{});var Ug=l(In);Uf=r(Ug,"str"),Ug.forEach(a),qf=r(z,", "),Nn=s(z,"EM",{});var qg=l(Nn);Gf=r(qg,"optional"),qg.forEach(a),Hf=r(z," defaults to "),Pn=s(z,"CODE",{});var Gg=l(Pn);Jf=r(Gg,'"Trainer"'),Gg.forEach(a),Yf=r(z,`):
ClearML task name.`),z.forEach(a),Aa.forEach(a),jo=d(n),Ee=s(n,"H2",{class:!0});var us=l(Ee);Pe=s(us,"A",{id:!0,class:!0,href:!0});var Hg=l(Pe);Fn=s(Hg,"SPAN",{});var Jg=l(Fn);u(Xt.$$.fragment,Jg),Jg.forEach(a),Hg.forEach(a),Xf=d(us),Wn=s(us,"SPAN",{});var Yg=l(Wn);Kf=r(Yg,"TrainerCallback"),Yg.forEach(a),us.forEach(a),zo=d(n),k=s(n,"DIV",{class:!0});var C=l(k);u(Kt.$$.fragment,C),Qf=d(C),jn=s(C,"P",{});var Xg=l(jn);Zf=r(Xg,`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:`),Xg.forEach(a),em=d(C),Qt=s(C,"P",{});var bs=l(Qt);tm=r(bs,"The "),zn=s(bs,"CODE",{});var Kg=l(zn);rm=r(Kg,"control"),Kg.forEach(a),am=r(bs,` 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.`),bs.forEach(a),nm=d(C),P=s(C,"P",{});var H=l(P);om=r(H,"The argument "),Rn=s(H,"CODE",{});var Qg=l(Rn);sm=r(Qg,"args"),Qg.forEach(a),lm=r(H,", "),Bn=s(H,"CODE",{});var Zg=l(Bn);im=r(Zg,"state"),Zg.forEach(a),cm=r(H," and "),Vn=s(H,"CODE",{});var eu=l(Vn);dm=r(eu,"control"),eu.forEach(a),fm=r(H," are positionals for all events, all the others are grouped in "),Un=s(H,"CODE",{});var tu=l(Un);mm=r(tu,"kwargs"),tu.forEach(a),hm=r(H,`.
You can unpack the ones you need in the signature of the event using them. As an example, see the code of the
simple `),qn=s(H,"CODE",{});var ru=l(qn);pm=r(ru,"~transformer.PrinterCallback"),ru.forEach(a),gm=r(H,"."),H.forEach(a),um=d(C),u(Fe.$$.fragment,C),bm=d(C),We=s(C,"DIV",{class:!0});var vs=l(We);u(Zt.$$.fragment,vs),vm=d(vs),Gn=s(vs,"P",{});var au=l(Gn);_m=r(au,"Event called at the beginning of an epoch."),au.forEach(a),vs.forEach(a),Em=d(C),je=s(C,"DIV",{class:!0});var _s=l(je);u(er.$$.fragment,_s),km=d(_s),Hn=s(_s,"P",{});var nu=l(Hn);Tm=r(nu,"Event called at the end of an epoch."),nu.forEach(a),_s.forEach(a),$m=d(C),ze=s(C,"DIV",{class:!0});var Es=l(ze);u(tr.$$.fragment,Es),Cm=d(Es),Jn=s(Es,"P",{});var ou=l(Jn);wm=r(ou,"Event called after an evaluation phase."),ou.forEach(a),Es.forEach(a),ym=d(C),Re=s(C,"DIV",{class:!0});var ks=l(Re);u(rr.$$.fragment,ks),Am=d(ks),ar=s(ks,"P",{});var Ts=l(ar);Lm=r(Ts,"Event called at the end of the initialization of the "),ma=s(Ts,"A",{href:!0});var su=l(ma);Dm=r(su,"Trainer"),su.forEach(a),xm=r(Ts,"."),Ts.forEach(a),ks.forEach(a),Mm=d(C),Be=s(C,"DIV",{class:!0});var $s=l(Be);u(nr.$$.fragment,$s),Om=d($s),Yn=s($s,"P",{});var lu=l(Yn);Sm=r(lu,"Event called after logging the last logs."),lu.forEach(a),$s.forEach(a),Im=d(C),Ve=s(C,"DIV",{class:!0});var Cs=l(Ve);u(or.$$.fragment,Cs),Nm=d(Cs),Xn=s(Cs,"P",{});var iu=l(Xn);Pm=r(iu,"Event called after a successful prediction."),iu.forEach(a),Cs.forEach(a),Fm=d(C),Ue=s(C,"DIV",{class:!0});var ws=l(Ue);u(sr.$$.fragment,ws),Wm=d(ws),Kn=s(ws,"P",{});var cu=l(Kn);jm=r(cu,"Event called after a prediction step."),cu.forEach(a),ws.forEach(a),zm=d(C),qe=s(C,"DIV",{class:!0});var ys=l(qe);u(lr.$$.fragment,ys),Rm=d(ys),Qn=s(ys,"P",{});var du=l(Qn);Bm=r(du,"Event called after a checkpoint save."),du.forEach(a),ys.forEach(a),Vm=d(C),Ge=s(C,"DIV",{class:!0});var As=l(Ge);u(ir.$$.fragment,As),Um=d(As),Zn=s(As,"P",{});var fu=l(Zn);qm=r(fu,`Event called at the beginning of a training step. If using gradient accumulation, one training step might take
several inputs.`),fu.forEach(a),As.forEach(a),Gm=d(C),He=s(C,"DIV",{class:!0});var Ls=l(He);u(cr.$$.fragment,Ls),Hm=d(Ls),eo=s(Ls,"P",{});var mu=l(eo);Jm=r(mu,`Event called at the end of a training step. If using gradient accumulation, one training step might take
several inputs.`),mu.forEach(a),Ls.forEach(a),Ym=d(C),Je=s(C,"DIV",{class:!0});var Ds=l(Je);u(dr.$$.fragment,Ds),Xm=d(Ds),to=s(Ds,"P",{});var hu=l(to);Km=r(hu,"Event called at the end of an substep during gradient accumulation."),hu.forEach(a),Ds.forEach(a),Qm=d(C),Ye=s(C,"DIV",{class:!0});var xs=l(Ye);u(fr.$$.fragment,xs),Zm=d(xs),ro=s(xs,"P",{});var pu=l(ro);eh=r(pu,"Event called at the beginning of training."),pu.forEach(a),xs.forEach(a),th=d(C),Xe=s(C,"DIV",{class:!0});var Ms=l(Xe);u(mr.$$.fragment,Ms),rh=d(Ms),ao=s(Ms,"P",{});var gu=l(ao);ah=r(gu,"Event called at the end of training."),gu.forEach(a),Ms.forEach(a),C.forEach(a),Ro=d(n),Ke=s(n,"P",{});var Os=l(Ke);nh=r(Os,"Here is an example of how to register a custom callback with the PyTorch "),ha=s(Os,"A",{href:!0});var uu=l(ha);oh=r(uu,"Trainer"),uu.forEach(a),sh=r(Os,":"),Os.forEach(a),Bo=d(n),u(hr.$$.fragment,n),Vo=d(n),Qe=s(n,"P",{});var Ss=l(Qe);lh=r(Ss,"Another way to register a callback is to call "),no=s(Ss,"CODE",{});var bu=l(no);ih=r(bu,"trainer.add_callback()"),bu.forEach(a),ch=r(Ss," as follows:"),Ss.forEach(a),Uo=d(n),u(pr.$$.fragment,n),qo=d(n),ke=s(n,"H2",{class:!0});var Is=l(ke);Ze=s(Is,"A",{id:!0,class:!0,href:!0});var vu=l(Ze);oo=s(vu,"SPAN",{});var _u=l(oo);u(gr.$$.fragment,_u),_u.forEach(a),vu.forEach(a),dh=d(Is),so=s(Is,"SPAN",{});var Eu=l(so);fh=r(Eu,"TrainerState"),Eu.forEach(a),Is.forEach(a),Go=d(n),F=s(n,"DIV",{class:!0});var ne=l(F);u(ur.$$.fragment,ne),mh=d(ne),Te=s(ne,"P",{});var Da=l(Te);hh=r(Da,"A class containing the "),pa=s(Da,"A",{href:!0});var ku=l(pa);ph=r(ku,"Trainer"),ku.forEach(a),gh=r(Da,` inner state that will be saved along the model and optimizer when checkpointing
and passed to the `),ga=s(Da,"A",{href:!0});var Tu=l(ga);uh=r(Tu,"TrainerCallback"),Tu.forEach(a),bh=r(Da,"."),Da.forEach(a),vh=d(ne),u(et.$$.fragment,ne),_h=d(ne),tt=s(ne,"DIV",{class:!0});var Ns=l(tt);u(br.$$.fragment,Ns),Eh=d(Ns),vr=s(Ns,"P",{});var Ps=l(vr);kh=r(Ps,"Create an instance from the content of "),lo=s(Ps,"CODE",{});var $u=l(lo);Th=r($u,"json_path"),$u.forEach(a),$h=r(Ps,"."),Ps.forEach(a),Ns.forEach(a),Ch=d(ne),rt=s(ne,"DIV",{class:!0});var Fs=l(rt);u(_r.$$.fragment,Fs),wh=d(Fs),Er=s(Fs,"P",{});var Ws=l(Er);yh=r(Ws,"Save the content of this instance in JSON format inside "),io=s(Ws,"CODE",{});var Cu=l(io);Ah=r(Cu,"json_path"),Cu.forEach(a),Lh=r(Ws,"."),Ws.forEach(a),Fs.forEach(a),ne.forEach(a),Ho=d(n),$e=s(n,"H2",{class:!0});var js=l($e);at=s(js,"A",{id:!0,class:!0,href:!0});var wu=l(at);co=s(wu,"SPAN",{});var yu=l(co);u(kr.$$.fragment,yu),yu.forEach(a),wu.forEach(a),Dh=d(js),fo=s(js,"SPAN",{});var Au=l(fo);xh=r(Au,"TrainerControl"),Au.forEach(a),js.forEach(a),Jo=d(n),Ce=s(n,"DIV",{class:!0});var zs=l(Ce);u(Tr.$$.fragment,zs),Mh=d(zs),we=s(zs,"P",{});var xa=l(we);Oh=r(xa,"A class that handles the "),ua=s(xa,"A",{href:!0});var Lu=l(ua);Sh=r(Lu,"Trainer"),Lu.forEach(a),Ih=r(xa," control flow. This class is used by the "),ba=s(xa,"A",{href:!0});var Du=l(ba);Nh=r(Du,"TrainerCallback"),Du.forEach(a),Ph=r(xa,` to activate some
switches in the training loop.`),xa.forEach(a),zs.forEach(a),this.h()},h(){i(A,"name","hf:doc:metadata"),i(A,"content",JSON.stringify(Ru)),i(M,"id","callbacks"),i(M,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(M,"href","#callbacks"),i(x,"class","relative group"),i(Ar,"href","/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.Trainer"),i(Lr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerControl"),i(Dr,"href","/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.Trainer"),i(xr,"href","trainer"),i(Mr,"href","/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.Trainer"),i(Sr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.DefaultFlowCallback"),i(Ir,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.PrinterCallback"),i(Nr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.ProgressCallback"),i(Pr,"href","/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.TrainingArguments"),i(Wr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.integrations.TensorBoardCallback"),i(jr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.integrations.WandbCallback"),i(ct,"href","https://www.wandb.com/"),i(ct,"rel","nofollow"),i(zr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.integrations.CometCallback"),i(dt,"href","https://www.comet.ml/site/"),i(dt,"rel","nofollow"),i(Rr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.integrations.MLflowCallback"),i(ft,"href","https://www.mlflow.org/"),i(ft,"rel","nofollow"),i(Br,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.integrations.NeptuneCallback"),i(mt,"href","https://neptune.ai/"),i(mt,"rel","nofollow"),i(Vr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.integrations.AzureMLCallback"),i(ht,"href","https://pypi.org/project/azureml-sdk/"),i(ht,"rel","nofollow"),i(Ur,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.integrations.CodeCarbonCallback"),i(pt,"href","https://pypi.org/project/codecarbon/"),i(pt,"rel","nofollow"),i(qr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.integrations.ClearMLCallback"),i(gt,"href","https://github.com/allegroai/clearml"),i(gt,"rel","nofollow"),i(Gr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(Hr,"href","/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.TrainingArguments"),i(Jr,"href","/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.Trainer"),i(Yr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerState"),i(Xr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerControl"),i(Ie,"id","transformers.integrations.CometCallback"),i(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(Ie,"href","#transformers.integrations.CometCallback"),i(le,"class","relative group"),i(Kr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(Qr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(vt,"href","https://www.comet.ml/site/"),i(vt,"rel","nofollow"),i(kt,"href","https://www.comet.ml/docs/python-sdk/advanced/#comet-configuration-variables"),i(kt,"rel","nofollow"),i(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Zr,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),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(ea,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ta,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ra,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(aa,"href","/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.TrainingArguments"),i(na,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerState"),i(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(oa,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(Mt,"href","https://www.tensorflow.org/tensorboard"),i(Mt,"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(sa,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(St,"href","https://www.wandb.com/"),i(St,"rel","nofollow"),i(Ft,"href","https://docs.wandb.ai/integrations/huggingface"),i(Ft,"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(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(la,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(jt,"href","https://www.mlflow.org/"),i(jt,"rel","nofollow"),i(ia,"href","/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.TrainingArguments"),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(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ca,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(Bt,"href","https://pypi.org/project/azureml-sdk/"),i(Bt,"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(da,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Ht,"href","https://neptune.ai"),i(Ht,"rel","nofollow"),i(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(fa,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(Yt,"href","https://clear.ml/"),i(Yt,"rel","nofollow"),i(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Pe,"id","transformers.TrainerCallback"),i(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),i(Pe,"href","#transformers.TrainerCallback"),i(Ee,"class","relative group"),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(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(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(ma,"href","/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.Trainer"),i(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(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(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(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(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(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(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(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(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),i(ha,"href","/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.Trainer"),i(Ze,"id","transformers.TrainerState"),i(Ze,"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(Ze,"href","#transformers.TrainerState"),i(ke,"class","relative group"),i(pa,"href","/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.Trainer"),i(ga,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),i(tt,"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(F,"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.TrainerControl"),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.TrainerControl"),i($e,"class","relative group"),i(ua,"href","/docs/transformers/v4.25.1/en/main_classes/trainer#transformers.Trainer"),i(ba,"href","/docs/transformers/v4.25.1/en/main_classes/callback#transformers.TrainerCallback"),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")},m(n,f){e(document.head,A),m(n,B,f),m(n,x,f),e(x,M),e(M,W),b(y,W,null),e(x,j),e(x,oe),e(oe,se),m(n,R,f),m(n,J,f),e(J,yr),e(J,Ar),e(Ar,Rs),e(J,Bs),m(n,ko,f),m(n,V,f),e(V,Vs),e(V,Lr),e(Lr,Us),e(V,qs),e(V,Dr),e(Dr,Gs),e(V,Hs),e(V,xr),e(xr,Js),e(V,Ys),m(n,To,f),m(n,ye,f),e(ye,Xs),e(ye,Mr),e(Mr,Ks),e(ye,Qs),m(n,$o,f),m(n,L,f),e(L,Or),e(Or,Sr),e(Sr,Zs),e(Or,el),e(L,tl),e(L,re),e(re,Ir),e(Ir,rl),e(re,al),e(re,Nr),e(Nr,nl),e(re,ol),e(re,Pr),e(Pr,sl),e(re,ll),e(L,il),e(L,Fr),e(Fr,Wr),e(Wr,cl),e(Fr,dl),e(L,fl),e(L,Ae),e(Ae,jr),e(jr,ml),e(Ae,hl),e(Ae,ct),e(ct,pl),e(Ae,gl),e(L,ul),e(L,Le),e(Le,zr),e(zr,bl),e(Le,vl),e(Le,dt),e(dt,_l),e(Le,El),e(L,kl),e(L,De),e(De,Rr),e(Rr,Tl),e(De,$l),e(De,ft),e(ft,Cl),e(De,wl),e(L,yl),e(L,xe),e(xe,Br),e(Br,Al),e(xe,Ll),e(xe,mt),e(mt,Dl),e(xe,xl),e(L,Ml),e(L,Me),e(Me,Vr),e(Vr,Ol),e(Me,Sl),e(Me,ht),e(ht,Il),e(Me,Nl),e(L,Pl),e(L,Oe),e(Oe,Ur),e(Ur,Fl),e(Oe,Wl),e(Oe,pt),e(pt,jl),e(Oe,zl),e(L,Rl),e(L,Se),e(Se,qr),e(qr,Bl),e(Se,Vl),e(Se,gt),e(gt,Ul),e(Se,ql),m(n,Co,f),m(n,N,f),e(N,Gl),e(N,Gr),e(Gr,Hl),e(N,Jl),e(N,Hr),e(Hr,Yl),e(N,Xl),e(N,Jr),e(Jr,Kl),e(N,Ql),e(N,Yr),e(Yr,Zl),e(N,ei),e(N,Xr),e(Xr,ti),e(N,ri),m(n,wo,f),m(n,le,f),e(le,Ie),e(Ie,Ma),b(ut,Ma,null),e(le,ai),e(le,Oa),e(Oa,ni),m(n,yo,f),m(n,Ne,f),e(Ne,oi),e(Ne,Kr),e(Kr,si),e(Ne,li),m(n,Ao,f),m(n,Y,f),b(bt,Y,null),e(Y,ii),e(Y,ie),e(ie,ci),e(ie,Qr),e(Qr,di),e(ie,fi),e(ie,vt),e(vt,mi),e(ie,hi),e(Y,pi),e(Y,U),b(_t,U,null),e(U,gi),e(U,Sa),e(Sa,ui),e(U,bi),e(U,D),e(D,vi),e(D,Ia),e(Ia,_i),e(D,Ei),e(D,Na),e(Na,ki),e(D,Ti),e(D,Pa),e(Pa,$i),e(D,Ci),e(D,Fa),e(Fa,wi),e(D,yi),e(D,Wa),e(Wa,Ai),e(D,Li),e(D,ja),e(ja,Di),e(D,xi),e(D,za),e(za,Mi),e(D,Oi),e(D,Ra),e(Ra,Si),e(D,Ii),e(D,Ba),e(Ba,Ni),e(D,Pi),e(U,Fi),e(U,Et),e(Et,Wi),e(Et,kt),e(kt,ji),e(Et,zi),m(n,Lo,f),m(n,ce,f),b(Tt,ce,null),e(ce,Ri),e(ce,$t),e($t,Bi),e($t,Zr),e(Zr,Vi),e($t,Ui),m(n,Do,f),m(n,de,f),b(Ct,de,null),e(de,qi),e(de,wt),e(wt,Gi),e(wt,ea),e(ea,Hi),e(wt,Ji),m(n,xo,f),m(n,fe,f),b(yt,fe,null),e(fe,Yi),e(fe,At),e(At,Xi),e(At,ta),e(ta,Ki),e(At,Qi),m(n,Mo,f),m(n,X,f),b(Lt,X,null),e(X,Zi),e(X,Dt),e(Dt,ec),e(Dt,ra),e(ra,tc),e(Dt,rc),e(X,ac),e(X,K),e(K,nc),e(K,aa),e(aa,oc),e(K,sc),e(K,Va),e(Va,lc),e(K,ic),e(K,na),e(na,cc),e(K,dc),m(n,Oo,f),m(n,me,f),b(xt,me,null),e(me,fc),e(me,he),e(he,mc),e(he,oa),e(oa,hc),e(he,pc),e(he,Mt),e(Mt,gc),e(he,uc),m(n,So,f),m(n,Q,f),b(Ot,Q,null),e(Q,bc),e(Q,pe),e(pe,vc),e(pe,sa),e(sa,_c),e(pe,Ec),e(pe,St),e(St,kc),e(pe,Tc),e(Q,$c),e(Q,q),b(It,q,null),e(q,Cc),e(q,Nt),e(Nt,wc),e(Nt,Ua),e(Ua,yc),e(Nt,Ac),e(q,Lc),e(q,Pt),e(Pt,Dc),e(Pt,Ft),e(Ft,xc),e(Pt,Mc),e(q,Oc),e(q,h),e(h,Sc),e(h,qa),e(qa,Ic),e(h,Nc),e(h,Ga),e(Ga,Pc),e(h,Fc),e(h,Ha),e(Ha,Wc),e(h,jc),e(h,Ja),e(Ja,zc),e(h,Rc),e(h,Ya),e(Ya,Bc),e(h,Vc),e(h,Xa),e(Xa,Uc),e(h,qc),e(h,Ka),e(Ka,Gc),e(h,Hc),e(h,Qa),e(Qa,Jc),e(h,Yc),e(h,Za),e(Za,Xc),e(h,Kc),e(h,en),e(en,Qc),e(h,Zc),e(h,tn),e(tn,ed),e(h,td),e(h,rn),e(rn,rd),e(h,ad),e(h,an),e(an,nd),e(h,od),e(h,nn),e(nn,sd),e(h,ld),e(h,on),e(on,id),e(h,cd),e(h,sn),e(sn,dd),e(h,fd),e(h,ln),e(ln,md),e(h,hd),e(h,cn),e(cn,pd),e(h,gd),e(h,dn),e(dn,ud),e(h,bd),m(n,Io,f),m(n,Z,f),b(Wt,Z,null),e(Z,vd),e(Z,ee),e(ee,_d),e(ee,la),e(la,Ed),e(ee,kd),e(ee,jt),e(jt,Td),e(ee,$d),e(ee,fn),e(fn,Cd),e(ee,wd),e(Z,yd),e(Z,ae),b(zt,ae,null),e(ae,Ad),e(ae,mn),e(mn,Ld),e(ae,Dd),e(ae,p),e(p,xd),e(p,hn),e(hn,Md),e(p,Od),e(p,pn),e(pn,Sd),e(p,Id),e(p,gn),e(gn,Nd),e(p,Pd),e(p,un),e(un,Fd),e(p,Wd),e(p,ia),e(ia,jd),e(p,zd),e(p,bn),e(bn,Rd),e(p,Bd),e(p,vn),e(vn,Vd),e(p,Ud),e(p,_n),e(_n,qd),e(p,Gd),e(p,En),e(En,Hd),e(p,Jd),e(p,kn),e(kn,Yd),e(p,Xd),e(p,Tn),e(Tn,Kd),e(p,Qd),e(p,$n),e($n,Zd),e(p,ef),e(p,Cn),e(Cn,tf),e(p,rf),e(p,wn),e(wn,af),e(p,nf),e(p,yn),e(yn,of),e(p,sf),e(p,An),e(An,lf),e(p,cf),e(p,Ln),e(Ln,df),e(p,ff),e(p,Dn),e(Dn,mf),e(p,hf),e(p,xn),e(xn,pf),e(p,gf),m(n,No,f),m(n,ge,f),b(Rt,ge,null),e(ge,uf),e(ge,ue),e(ue,bf),e(ue,ca),e(ca,vf),e(ue,_f),e(ue,Bt),e(Bt,Ef),e(ue,kf),m(n,Po,f),m(n,be,f),b(Vt,be,null),e(be,Tf),e(be,Ut),e(Ut,$f),e(Ut,da),e(da,Cf),e(Ut,wf),m(n,Fo,f),m(n,ve,f),b(qt,ve,null),e(ve,yf),e(ve,Gt),e(Gt,Af),e(Gt,Ht),e(Ht,Lf),e(Gt,Df),m(n,Wo,f),m(n,te,f),b(Jt,te,null),e(te,xf),e(te,_e),e(_e,Mf),e(_e,fa),e(fa,Of),e(_e,Sf),e(_e,Yt),e(Yt,If),e(_e,Nf),e(te,Pf),e(te,I),e(I,Ff),e(I,Mn),e(Mn,Wf),e(I,jf),e(I,On),e(On,zf),e(I,Rf),e(I,Sn),e(Sn,Bf),e(I,Vf),e(I,In),e(In,Uf),e(I,qf),e(I,Nn),e(Nn,Gf),e(I,Hf),e(I,Pn),e(Pn,Jf),e(I,Yf),m(n,jo,f),m(n,Ee,f),e(Ee,Pe),e(Pe,Fn),b(Xt,Fn,null),e(Ee,Xf),e(Ee,Wn),e(Wn,Kf),m(n,zo,f),m(n,k,f),b(Kt,k,null),e(k,Qf),e(k,jn),e(jn,Zf),e(k,em),e(k,Qt),e(Qt,tm),e(Qt,zn),e(zn,rm),e(Qt,am),e(k,nm),e(k,P),e(P,om),e(P,Rn),e(Rn,sm),e(P,lm),e(P,Bn),e(Bn,im),e(P,cm),e(P,Vn),e(Vn,dm),e(P,fm),e(P,Un),e(Un,mm),e(P,hm),e(P,qn),e(qn,pm),e(P,gm),e(k,um),b(Fe,k,null),e(k,bm),e(k,We),b(Zt,We,null),e(We,vm),e(We,Gn),e(Gn,_m),e(k,Em),e(k,je),b(er,je,null),e(je,km),e(je,Hn),e(Hn,Tm),e(k,$m),e(k,ze),b(tr,ze,null),e(ze,Cm),e(ze,Jn),e(Jn,wm),e(k,ym),e(k,Re),b(rr,Re,null),e(Re,Am),e(Re,ar),e(ar,Lm),e(ar,ma),e(ma,Dm),e(ar,xm),e(k,Mm),e(k,Be),b(nr,Be,null),e(Be,Om),e(Be,Yn),e(Yn,Sm),e(k,Im),e(k,Ve),b(or,Ve,null),e(Ve,Nm),e(Ve,Xn),e(Xn,Pm),e(k,Fm),e(k,Ue),b(sr,Ue,null),e(Ue,Wm),e(Ue,Kn),e(Kn,jm),e(k,zm),e(k,qe),b(lr,qe,null),e(qe,Rm),e(qe,Qn),e(Qn,Bm),e(k,Vm),e(k,Ge),b(ir,Ge,null),e(Ge,Um),e(Ge,Zn),e(Zn,qm),e(k,Gm),e(k,He),b(cr,He,null),e(He,Hm),e(He,eo),e(eo,Jm),e(k,Ym),e(k,Je),b(dr,Je,null),e(Je,Xm),e(Je,to),e(to,Km),e(k,Qm),e(k,Ye),b(fr,Ye,null),e(Ye,Zm),e(Ye,ro),e(ro,eh),e(k,th),e(k,Xe),b(mr,Xe,null),e(Xe,rh),e(Xe,ao),e(ao,ah),m(n,Ro,f),m(n,Ke,f),e(Ke,nh),e(Ke,ha),e(ha,oh),e(Ke,sh),m(n,Bo,f),b(hr,n,f),m(n,Vo,f),m(n,Qe,f),e(Qe,lh),e(Qe,no),e(no,ih),e(Qe,ch),m(n,Uo,f),b(pr,n,f),m(n,qo,f),m(n,ke,f),e(ke,Ze),e(Ze,oo),b(gr,oo,null),e(ke,dh),e(ke,so),e(so,fh),m(n,Go,f),m(n,F,f),b(ur,F,null),e(F,mh),e(F,Te),e(Te,hh),e(Te,pa),e(pa,ph),e(Te,gh),e(Te,ga),e(ga,uh),e(Te,bh),e(F,vh),b(et,F,null),e(F,_h),e(F,tt),b(br,tt,null),e(tt,Eh),e(tt,vr),e(vr,kh),e(vr,lo),e(lo,Th),e(vr,$h),e(F,Ch),e(F,rt),b(_r,rt,null),e(rt,wh),e(rt,Er),e(Er,yh),e(Er,io),e(io,Ah),e(Er,Lh),m(n,Ho,f),m(n,$e,f),e($e,at),e(at,co),b(kr,co,null),e($e,Dh),e($e,fo),e(fo,xh),m(n,Jo,f),m(n,Ce,f),b(Tr,Ce,null),e(Ce,Mh),e(Ce,we),e(we,Oh),e(we,ua),e(ua,Sh),e(we,Ih),e(we,ba),e(ba,Nh),e(we,Ph),Yo=!0},p(n,[f]){const $r={};f&2&&($r.$$scope={dirty:f,ctx:n}),Fe.$set($r);const mo={};f&2&&(mo.$$scope={dirty:f,ctx:n}),et.$set(mo)},i(n){Yo||(v(y.$$.fragment,n),v(ut.$$.fragment,n),v(bt.$$.fragment,n),v(_t.$$.fragment,n),v(Tt.$$.fragment,n),v(Ct.$$.fragment,n),v(yt.$$.fragment,n),v(Lt.$$.fragment,n),v(xt.$$.fragment,n),v(Ot.$$.fragment,n),v(It.$$.fragment,n),v(Wt.$$.fragment,n),v(zt.$$.fragment,n),v(Rt.$$.fragment,n),v(Vt.$$.fragment,n),v(qt.$$.fragment,n),v(Jt.$$.fragment,n),v(Xt.$$.fragment,n),v(Kt.$$.fragment,n),v(Fe.$$.fragment,n),v(Zt.$$.fragment,n),v(er.$$.fragment,n),v(tr.$$.fragment,n),v(rr.$$.fragment,n),v(nr.$$.fragment,n),v(or.$$.fragment,n),v(sr.$$.fragment,n),v(lr.$$.fragment,n),v(ir.$$.fragment,n),v(cr.$$.fragment,n),v(dr.$$.fragment,n),v(fr.$$.fragment,n),v(mr.$$.fragment,n),v(hr.$$.fragment,n),v(pr.$$.fragment,n),v(gr.$$.fragment,n),v(ur.$$.fragment,n),v(et.$$.fragment,n),v(br.$$.fragment,n),v(_r.$$.fragment,n),v(kr.$$.fragment,n),v(Tr.$$.fragment,n),Yo=!0)},o(n){_(y.$$.fragment,n),_(ut.$$.fragment,n),_(bt.$$.fragment,n),_(_t.$$.fragment,n),_(Tt.$$.fragment,n),_(Ct.$$.fragment,n),_(yt.$$.fragment,n),_(Lt.$$.fragment,n),_(xt.$$.fragment,n),_(Ot.$$.fragment,n),_(It.$$.fragment,n),_(Wt.$$.fragment,n),_(zt.$$.fragment,n),_(Rt.$$.fragment,n),_(Vt.$$.fragment,n),_(qt.$$.fragment,n),_(Jt.$$.fragment,n),_(Xt.$$.fragment,n),_(Kt.$$.fragment,n),_(Fe.$$.fragment,n),_(Zt.$$.fragment,n),_(er.$$.fragment,n),_(tr.$$.fragment,n),_(rr.$$.fragment,n),_(nr.$$.fragment,n),_(or.$$.fragment,n),_(sr.$$.fragment,n),_(lr.$$.fragment,n),_(ir.$$.fragment,n),_(cr.$$.fragment,n),_(dr.$$.fragment,n),_(fr.$$.fragment,n),_(mr.$$.fragment,n),_(hr.$$.fragment,n),_(pr.$$.fragment,n),_(gr.$$.fragment,n),_(ur.$$.fragment,n),_(et.$$.fragment,n),_(br.$$.fragment,n),_(_r.$$.fragment,n),_(kr.$$.fragment,n),_(Tr.$$.fragment,n),Yo=!1},d(n){a(A),n&&a(B),n&&a(x),E(y),n&&a(R),n&&a(J),n&&a(ko),n&&a(V),n&&a(To),n&&a(ye),n&&a($o),n&&a(L),n&&a(Co),n&&a(N),n&&a(wo),n&&a(le),E(ut),n&&a(yo),n&&a(Ne),n&&a(Ao),n&&a(Y),E(bt),E(_t),n&&a(Lo),n&&a(ce),E(Tt),n&&a(Do),n&&a(de),E(Ct),n&&a(xo),n&&a(fe),E(yt),n&&a(Mo),n&&a(X),E(Lt),n&&a(Oo),n&&a(me),E(xt),n&&a(So),n&&a(Q),E(Ot),E(It),n&&a(Io),n&&a(Z),E(Wt),E(zt),n&&a(No),n&&a(ge),E(Rt),n&&a(Po),n&&a(be),E(Vt),n&&a(Fo),n&&a(ve),E(qt),n&&a(Wo),n&&a(te),E(Jt),n&&a(jo),n&&a(Ee),E(Xt),n&&a(zo),n&&a(k),E(Kt),E(Fe),E(Zt),E(er),E(tr),E(rr),E(nr),E(or),E(sr),E(lr),E(ir),E(cr),E(dr),E(fr),E(mr),n&&a(Ro),n&&a(Ke),n&&a(Bo),E(hr,n),n&&a(Vo),n&&a(Qe),n&&a(Uo),E(pr,n),n&&a(qo),n&&a(ke),E(gr),n&&a(Go),n&&a(F),E(ur),E(et),E(br),E(_r),n&&a(Ho),n&&a($e),E(kr),n&&a(Jo),n&&a(Ce),E(Tr)}}}const Ru={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 Bu(wr){return Iu(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yu extends xu{constructor(A){super();Mu(this,A,Bu,zu,Ou,{})}}export{Yu as default,Ru as metadata};
