import{S as np,i as sp,s as op,e as s,k as c,w as _,t as r,M as lp,c as o,d as t,m as f,a as l,x as u,h as n,b as i,F as e,g as m,y as v,q as b,o as E,B as k}from"../../chunks/vendor-4833417e.js";import{T as ip}from"../../chunks/Tip-fffd6df1.js";import{D as T}from"../../chunks/Docstring-4f315ed9.js";import{C as Wh}from"../../chunks/CodeBlock-6a3d1b46.js";import{I as Pn}from"../../chunks/IconCopyLink-4b81c553.js";import"../../chunks/CopyButton-dacfbfaf.js";function cp(hr){let w,Y,D,P,Z,M,et,ee;return{c(){w=s("p"),Y=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 `),D=s("code"),P=r("gradient_accumulation_steps=n"),Z=r(`, then one update
step requires going through `),M=s("em"),et=r("n"),ee=r(" batches.")},l(te){w=o(te,"P",{});var x=l(w);Y=n(x,`In all this class, one step is to be understood as one update step. When using gradient accumulation, one update
step may require several forward and backward passes: if you use `),D=o(x,"CODE",{});var q=l(D);P=n(q,"gradient_accumulation_steps=n"),q.forEach(t),Z=n(x,`, then one update
step requires going through `),M=o(x,"EM",{});var fa=l(M);et=n(fa,"n"),fa.forEach(t),ee=n(x," batches."),x.forEach(t)},m(te,x){m(te,w,x),e(w,Y),e(w,D),e(D,P),e(w,Z),e(w,M),e(M,et),e(w,ee)},d(te){te&&t(w)}}}function fp(hr){let w,Y,D,P,Z,M,et,ee,te,x,q,fa,ha,Gs,Js,On,j,Ys,ma,Xs,Ks,da,Qs,Zs,pa,eo,to,In,ke,ao,ga,ro,no,Mn,y,_a,ua,so,oo,lo,X,va,io,co,ba,fo,ho,Ea,mo,po,go,ka,$a,_o,uo,vo,$e,Ta,bo,Eo,tt,ko,$o,To,Te,Ca,Co,wo,at,yo,Ao,Do,Ce,wa,Lo,So,rt,Po,Oo,Io,we,ya,Mo,xo,nt,Fo,jo,No,ye,Aa,Wo,zo,st,Bo,Vo,xn,L,qo,Da,Ro,Ho,La,Uo,Go,Sa,Jo,Yo,Pa,Xo,Ko,Oa,Qo,Zo,Fn,ae,Ae,mr,ot,el,dr,tl,jn,De,al,Ia,rl,nl,Nn,R,lt,sl,re,ol,Ma,ll,il,it,cl,fl,hl,N,ct,ml,pr,dl,pl,C,gl,gr,_l,ul,_r,vl,bl,ur,El,kl,vr,$l,Tl,br,Cl,wl,Er,yl,Al,kr,Dl,Ll,$r,Sl,Pl,Tr,Ol,Il,Ml,ft,xl,ht,Fl,jl,Wn,ne,mt,Nl,dt,Wl,xa,zl,Bl,zn,se,pt,Vl,gt,ql,Fa,Rl,Hl,Bn,oe,_t,Ul,ut,Gl,ja,Jl,Yl,Vn,H,vt,Xl,bt,Kl,Na,Ql,Zl,ei,U,ti,Wa,ai,ri,Cr,ni,si,za,oi,li,qn,le,Et,ii,ie,ci,Ba,fi,hi,kt,mi,di,Rn,G,$t,pi,ce,gi,Va,_i,ui,Tt,vi,bi,Ei,W,Ct,ki,wt,$i,wr,Ti,Ci,wi,yt,yi,At,Ai,Di,Li,d,Si,yr,Pi,Oi,Ar,Ii,Mi,Dr,xi,Fi,Lr,ji,Ni,Sr,Wi,zi,Pr,Bi,Vi,Or,qi,Ri,Ir,Hi,Ui,Mr,Gi,Ji,xr,Yi,Xi,Fr,Ki,Qi,jr,Zi,ec,Nr,tc,ac,Wr,rc,nc,zr,sc,oc,Br,lc,ic,Vr,cc,fc,qr,hc,mc,Rr,dc,pc,Hn,J,Dt,gc,fe,_c,qa,uc,vc,Lt,bc,Ec,kc,z,St,$c,Hr,Tc,Cc,he,wc,Ur,yc,Ac,Gr,Dc,Lc,Sc,F,Pc,Jr,Oc,Ic,Yr,Mc,xc,Ra,Fc,jc,Xr,Nc,Wc,Un,me,Pt,zc,de,Bc,Ha,Vc,qc,Ot,Rc,Hc,Gn,pe,It,Uc,Mt,Gc,Ua,Jc,Yc,Jn,ge,Le,Kr,xt,Xc,Qr,Kc,Yn,p,Ft,Qc,Zr,Zc,ef,jt,tf,en,af,rf,nf,O,sf,tn,of,lf,an,cf,ff,rn,hf,mf,nn,df,pf,sn,gf,_f,uf,on,vf,bf,Nt,Ef,Se,Wt,kf,ln,$f,Tf,Pe,zt,Cf,cn,wf,yf,Oe,Bt,Af,fn,Df,Lf,Ie,Vt,Sf,qt,Pf,Ga,Of,If,Mf,Me,Rt,xf,hn,Ff,jf,xe,Ht,Nf,mn,Wf,zf,Fe,Ut,Bf,dn,Vf,qf,je,Gt,Rf,pn,Hf,Uf,Ne,Jt,Gf,gn,Jf,Yf,We,Yt,Xf,_n,Kf,Qf,ze,Xt,Zf,un,eh,th,Be,Kt,ah,vn,rh,Xn,Ve,nh,Ja,sh,oh,Kn,Qt,Qn,qe,lh,bn,ih,ch,Zn,Zt,es,_e,Re,En,ea,fh,kn,hh,ts,I,ta,mh,ue,dh,Ya,ph,gh,Xa,_h,uh,vh,He,bh,Ue,aa,Eh,ra,kh,$n,$h,Th,Ch,Ge,na,wh,sa,yh,Tn,Ah,Dh,as,ve,Je,Cn,oa,Lh,wn,Sh,rs,be,la,Ph,Ee,Oh,Ka,Ih,Mh,Qa,xh,Fh,ns;return M=new Pn({}),ot=new Pn({}),lt=new T({props:{name:"class transformers.integrations.CometCallback",anchor:"transformers.integrations.CometCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/integrations.py#L660"}}),ct=new T({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/pr_15839/src/transformers/integrations.py#L671"}}),mt=new T({props:{name:"class transformers.DefaultFlowCallback",anchor:"transformers.DefaultFlowCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/trainer_callback.py#L406"}}),pt=new T({props:{name:"class transformers.PrinterCallback",anchor:"transformers.PrinterCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/trainer_callback.py#L494"}}),_t=new T({props:{name:"class transformers.ProgressCallback",anchor:"transformers.ProgressCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/trainer_callback.py#L452"}}),vt=new T({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/trainer_callback.py#L505",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,"}]}}),Et=new T({props:{name:"class transformers.integrations.TensorBoardCallback",anchor:"transformers.integrations.TensorBoardCallback",parameters:[{name:"tb_writer",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/integrations.py#L446",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"}]}}),$t=new T({props:{name:"class transformers.integrations.WandbCallback",anchor:"transformers.integrations.WandbCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/integrations.py#L534"}}),Ct=new T({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/pr_15839/src/transformers/integrations.py#L551"}}),Dt=new T({props:{name:"class transformers.integrations.MLflowCallback",anchor:"transformers.integrations.MLflowCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/integrations.py#L759"}}),St=new T({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/pr_15839/src/transformers/integrations.py#L776"}}),Pt=new T({props:{name:"class transformers.integrations.AzureMLCallback",anchor:"transformers.integrations.AzureMLCallback",parameters:[{name:"azureml_run",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/integrations.py#L736"}}),It=new T({props:{name:"class transformers.integrations.CodeCarbonCallback",anchor:"transformers.integrations.CodeCarbonCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/integrations.py#L919"}}),xt=new Pn({}),Ft=new T({props:{name:"class transformers.TrainerCallback",anchor:"transformers.TrainerCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/trainer_callback.py#L159",parametersDescription:[{anchor:"transformers.TrainerCallback.args",description:`<strong>args</strong> (<a href="/docs/transformers/pr_15839/en/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>) &#x2014;
The training arguments used to instantiate the <a href="/docs/transformers/pr_15839/en/main_classes/trainer#transformers.Trainer">Trainer</a>.`,name:"args"},{anchor:"transformers.TrainerCallback.state",description:`<strong>state</strong> (<a href="/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerState">TrainerState</a>) &#x2014;
The current state of the <a href="/docs/transformers/pr_15839/en/main_classes/trainer#transformers.Trainer">Trainer</a>.`,name:"state"},{anchor:"transformers.TrainerCallback.control",description:`<strong>control</strong> (<a href="/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerControl">TrainerControl</a>) &#x2014;
The object that is returned to the <a href="/docs/transformers/pr_15839/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/pr_15839/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/pr_15839/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"}]}}),Nt=new Wh({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)`}}),Wt=new T({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/pr_15839/src/transformers/trainer_callback.py#L227"}}),zt=new T({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/pr_15839/src/transformers/trainer_callback.py#L233"}}),Bt=new T({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/pr_15839/src/transformers/trainer_callback.py#L259"}}),Vt=new T({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/pr_15839/src/transformers/trainer_callback.py#L209"}}),Rt=new T({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/pr_15839/src/transformers/trainer_callback.py#L271"}}),Ht=new T({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/pr_15839/src/transformers/trainer_callback.py#L277"}}),Ut=new T({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/pr_15839/src/transformers/trainer_callback.py#L265"}}),Gt=new T({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/pr_15839/src/transformers/trainer_callback.py#L239"}}),Jt=new T({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/pr_15839/src/transformers/trainer_callback.py#L252"}}),Yt=new T({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/pr_15839/src/transformers/trainer_callback.py#L246"}}),Xt=new T({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/pr_15839/src/transformers/trainer_callback.py#L215"}}),Kt=new T({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/pr_15839/src/transformers/trainer_callback.py#L221"}}),Qt=new Wh({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>
)`}}),Zt=new Wh({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())`}}),ea=new Pn({}),ta=new T({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/trainer_callback.py#L35",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"}]}}),He=new ip({props:{$$slots:{default:[cp]},$$scope:{ctx:hr}}}),aa=new T({props:{name:"load_from_json",anchor:"transformers.TrainerState.load_from_json",parameters:[{name:"json_path",val:": str"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/trainer_callback.py#L101"}}),na=new T({props:{name:"save_to_json",anchor:"transformers.TrainerState.save_to_json",parameters:[{name:"json_path",val:": str"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/trainer_callback.py#L95"}}),oa=new Pn({}),la=new T({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/trainer_callback.py#L110",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"}]}}),{c(){w=s("meta"),Y=c(),D=s("h1"),P=s("a"),Z=s("span"),_(M.$$.fragment),et=c(),ee=s("span"),te=r("Callbacks"),x=c(),q=s("p"),fa=r(`Callbacks are objects that can customize the behavior of the training loop in the PyTorch
`),ha=s("a"),Gs=r("Trainer"),Js=r(` (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).`),On=c(),j=s("p"),Ys=r("Callbacks are \u201Cread only\u201D pieces of code, apart from the "),ma=s("a"),Xs=r("TrainerControl"),Ks=r(` object they return, they
cannot change anything in the training loop. For customizations that require changes in the training loop, you should
subclass `),da=s("a"),Qs=r("Trainer"),Zs=r(" and override the methods you need (see "),pa=s("a"),eo=r("trainer"),to=r(" for examples)."),In=c(),ke=s("p"),ao=r("By default a "),ga=s("a"),ro=r("Trainer"),no=r(" will use the following callbacks:"),Mn=c(),y=s("ul"),_a=s("li"),ua=s("a"),so=r("DefaultFlowCallback"),oo=r(" which handles the default behavior for logging, saving and evaluation."),lo=c(),X=s("li"),va=s("a"),io=r("PrinterCallback"),co=r(" or "),ba=s("a"),fo=r("ProgressCallback"),ho=r(` to display progress and print the
logs (the first one is used if you deactivate tqdm through the `),Ea=s("a"),mo=r("TrainingArguments"),po=r(`, otherwise
it\u2019s the second one).`),go=c(),ka=s("li"),$a=s("a"),_o=r("TensorBoardCallback"),uo=r(` if tensorboard is accessible (either through PyTorch >= 1.4
or tensorboardX).`),vo=c(),$e=s("li"),Ta=s("a"),bo=r("WandbCallback"),Eo=r(" if "),tt=s("a"),ko=r("wandb"),$o=r(" is installed."),To=c(),Te=s("li"),Ca=s("a"),Co=r("CometCallback"),wo=r(" if "),at=s("a"),yo=r("comet_ml"),Ao=r(" is installed."),Do=c(),Ce=s("li"),wa=s("a"),Lo=r("MLflowCallback"),So=r(" if "),rt=s("a"),Po=r("mlflow"),Oo=r(" is installed."),Io=c(),we=s("li"),ya=s("a"),Mo=r("AzureMLCallback"),xo=r(" if "),nt=s("a"),Fo=r("azureml-sdk"),jo=r(` is
installed.`),No=c(),ye=s("li"),Aa=s("a"),Wo=r("CodeCarbonCallback"),zo=r(" if "),st=s("a"),Bo=r("codecarbon"),Vo=r(` is
installed.`),xn=c(),L=s("p"),qo=r("The main class that implements callbacks is "),Da=s("a"),Ro=r("TrainerCallback"),Ho=r(`. It gets the
`),La=s("a"),Uo=r("TrainingArguments"),Go=r(" used to instantiate the "),Sa=s("a"),Jo=r("Trainer"),Yo=r(`, can access that
Trainer\u2019s internal state via `),Pa=s("a"),Xo=r("TrainerState"),Ko=r(`, and can take some actions on the training loop via
`),Oa=s("a"),Qo=r("TrainerControl"),Zo=r("."),Fn=c(),ae=s("h2"),Ae=s("a"),mr=s("span"),_(ot.$$.fragment),el=c(),dr=s("span"),tl=r("Available Callbacks"),jn=c(),De=s("p"),al=r("Here is the list of the available "),Ia=s("a"),rl=r("TrainerCallback"),nl=r(" in the library:"),Nn=c(),R=s("div"),_(lt.$$.fragment),sl=c(),re=s("p"),ol=r("A "),Ma=s("a"),ll=r("TrainerCallback"),il=r(" that sends the logs to "),it=s("a"),cl=r("Comet ML"),fl=r("."),hl=c(),N=s("div"),_(ct.$$.fragment),ml=c(),pr=s("p"),dl=r("Setup the optional Comet.ml integration."),pl=c(),C=s("p"),gl=r(`Environment:
COMET_MODE (`),gr=s("code"),_l=r("str"),ul=r(", "),_r=s("em"),vl=r("optional"),bl=r(`):
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 (`),ur=s("code"),El=r("str"),kl=r(", "),vr=s("em"),$l=r("optional"),Tl=r(`):
Comet project name for experiments
COMET_OFFLINE_DIRECTORY (`),br=s("code"),Cl=r("str"),wl=r(", "),Er=s("em"),yl=r("optional"),Al=r(`):
Folder to use for saving offline experiments when `),kr=s("code"),Dl=r("COMET_MODE"),Ll=r(` is \u201COFFLINE\u201D
COMET_LOG_ASSETS (`),$r=s("code"),Sl=r("str"),Pl=r(", "),Tr=s("em"),Ol=r("optional"),Il=r(`):
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.`),Ml=c(),ft=s("p"),xl=r(`For a number of configurable items in the environment, see
`),ht=s("a"),Fl=r("here"),jl=r("."),Wn=c(),ne=s("div"),_(mt.$$.fragment),Nl=c(),dt=s("p"),Wl=r("A "),xa=s("a"),zl=r("TrainerCallback"),Bl=r(" that handles the default flow of the training loop for logs, evaluation and checkpoints."),zn=c(),se=s("div"),_(pt.$$.fragment),Vl=c(),gt=s("p"),ql=r("A bare "),Fa=s("a"),Rl=r("TrainerCallback"),Hl=r(" that just prints the logs."),Bn=c(),oe=s("div"),_(_t.$$.fragment),Ul=c(),ut=s("p"),Gl=r("A "),ja=s("a"),Jl=r("TrainerCallback"),Yl=r(" that displays the progress of training or evaluation."),Vn=c(),H=s("div"),_(vt.$$.fragment),Xl=c(),bt=s("p"),Kl=r("A "),Na=s("a"),Ql=r("TrainerCallback"),Zl=r(" that handles early stopping."),ei=c(),U=s("p"),ti=r("This callback depends on "),Wa=s("a"),ai=r("TrainingArguments"),ri=r(" argument "),Cr=s("em"),ni=r("load_best_model_at_end"),si=r(` functionality to set best_metric
in `),za=s("a"),oi=r("TrainerState"),li=r("."),qn=c(),le=s("div"),_(Et.$$.fragment),ii=c(),ie=s("p"),ci=r("A "),Ba=s("a"),fi=r("TrainerCallback"),hi=r(" that sends the logs to "),kt=s("a"),mi=r("TensorBoard"),di=r("."),Rn=c(),G=s("div"),_($t.$$.fragment),pi=c(),ce=s("p"),gi=r("A "),Va=s("a"),_i=r("TrainerCallback"),ui=r(" that sends the logs to "),Tt=s("a"),vi=r("Weight and Biases"),bi=r("."),Ei=c(),W=s("div"),_(Ct.$$.fragment),ki=c(),wt=s("p"),$i=r("Setup the optional Weights & Biases ("),wr=s("em"),Ti=r("wandb"),Ci=r(") integration."),wi=c(),yt=s("p"),yi=r(`One can subclass and override this method to customize the setup if needed. Find more information
`),At=s("a"),Ai=r("here"),Di=r(`. You can also override the following environment
variables:`),Li=c(),d=s("p"),Si=r(`Environment:
WANDB_LOG_MODEL (`),yr=s("code"),Pi=r("bool"),Oi=r(", "),Ar=s("em"),Ii=r("optional"),Mi=r(", defaults to "),Dr=s("code"),xi=r("False"),Fi=r(`):
Whether or not to log model as artifact at the end of training. Use along with
`),Lr=s("em"),ji=r("TrainingArguments.load_best_model_at_end"),Ni=r(` to upload best model.
WANDB_WATCH (`),Sr=s("code"),Wi=r("str"),zi=r(", "),Pr=s("em"),Bi=r("optional"),Vi=r(" defaults to "),Or=s("code"),qi=r('"gradients"'),Ri=r(`):
Can be `),Ir=s("code"),Hi=r('"gradients"'),Ui=r(", "),Mr=s("code"),Gi=r('"all"'),Ji=r(" or "),xr=s("code"),Yi=r('"false"'),Xi=r(". Set to "),Fr=s("code"),Ki=r('"false"'),Qi=r(" to disable gradient logging or "),jr=s("code"),Zi=r('"all"'),ec=r(` to
log gradients and parameters.
WANDB_PROJECT (`),Nr=s("code"),tc=r("str"),ac=r(", "),Wr=s("em"),rc=r("optional"),nc=r(", defaults to "),zr=s("code"),sc=r('"huggingface"'),oc=r(`):
Set this to a custom string to store results in a different project.
WANDB_DISABLED (`),Br=s("code"),lc=r("bool"),ic=r(", "),Vr=s("em"),cc=r("optional"),fc=r(", defaults to "),qr=s("code"),hc=r("False"),mc=r(`):
Whether or not to disable wandb entirely. Set `),Rr=s("em"),dc=r("WANDB_DISABLED=true"),pc=r(" to disable."),Hn=c(),J=s("div"),_(Dt.$$.fragment),gc=c(),fe=s("p"),_c=r("A "),qa=s("a"),uc=r("TrainerCallback"),vc=r(" that sends the logs to "),Lt=s("a"),bc=r("MLflow"),Ec=r("."),kc=c(),z=s("div"),_(St.$$.fragment),$c=c(),Hr=s("p"),Tc=r("Setup the optional MLflow integration."),Cc=c(),he=s("p"),wc=r(`Environment:
HF_MLFLOW_LOG_ARTIFACTS (`),Ur=s("code"),yc=r("str"),Ac=r(", "),Gr=s("em"),Dc=r("optional"),Lc=r(`):
Whether to use MLflow .log_artifact() facility to log artifacts.`),Sc=c(),F=s("p"),Pc=r("This only makes sense if logging to a remote server, e.g. s3 or GCS. If set to "),Jr=s("code"),Oc=r("True"),Ic=r(" or "),Yr=s("em"),Mc=r("1"),xc=r(`, will copy
whatever is in `),Ra=s("a"),Fc=r("TrainingArguments"),jc=r("\u2019s "),Xr=s("code"),Nc=r("output_dir"),Wc=r(` to the local or remote artifact storage. Using it
without a remote storage will just copy the files to your artifact location.`),Un=c(),me=s("div"),_(Pt.$$.fragment),zc=c(),de=s("p"),Bc=r("A "),Ha=s("a"),Vc=r("TrainerCallback"),qc=r(" that sends the logs to "),Ot=s("a"),Rc=r("AzureML"),Hc=r("."),Gn=c(),pe=s("div"),_(It.$$.fragment),Uc=c(),Mt=s("p"),Gc=r("A "),Ua=s("a"),Jc=r("TrainerCallback"),Yc=r(" that tracks the CO2 emission of training."),Jn=c(),ge=s("h2"),Le=s("a"),Kr=s("span"),_(xt.$$.fragment),Xc=c(),Qr=s("span"),Kc=r("TrainerCallback"),Yn=c(),p=s("div"),_(Ft.$$.fragment),Qc=c(),Zr=s("p"),Zc=r(`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:`),ef=c(),jt=s("p"),tf=r("The "),en=s("code"),af=r("control"),rf=r(` 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.`),nf=c(),O=s("p"),sf=r("The argument "),tn=s("code"),of=r("args"),lf=r(", "),an=s("code"),cf=r("state"),ff=r(" and "),rn=s("code"),hf=r("control"),mf=r(" are positionals for all events, all the others are grouped in "),nn=s("code"),df=r("kwargs"),pf=r(`.
You can unpack the ones you need in the signature of the event using them. As an example, see the code of the
simple `),sn=s("code"),gf=r("PrinterCallback"),_f=r("."),uf=c(),on=s("p"),vf=r("Example:"),bf=c(),_(Nt.$$.fragment),Ef=c(),Se=s("div"),_(Wt.$$.fragment),kf=c(),ln=s("p"),$f=r("Event called at the beginning of an epoch."),Tf=c(),Pe=s("div"),_(zt.$$.fragment),Cf=c(),cn=s("p"),wf=r("Event called at the end of an epoch."),yf=c(),Oe=s("div"),_(Bt.$$.fragment),Af=c(),fn=s("p"),Df=r("Event called after an evaluation phase."),Lf=c(),Ie=s("div"),_(Vt.$$.fragment),Sf=c(),qt=s("p"),Pf=r("Event called at the end of the initialization of the "),Ga=s("a"),Of=r("Trainer"),If=r("."),Mf=c(),Me=s("div"),_(Rt.$$.fragment),xf=c(),hn=s("p"),Ff=r("Event called after logging the last logs."),jf=c(),xe=s("div"),_(Ht.$$.fragment),Nf=c(),mn=s("p"),Wf=r("Event called after a prediction step."),zf=c(),Fe=s("div"),_(Ut.$$.fragment),Bf=c(),dn=s("p"),Vf=r("Event called after a checkpoint save."),qf=c(),je=s("div"),_(Gt.$$.fragment),Rf=c(),pn=s("p"),Hf=r(`Event called at the beginning of a training step. If using gradient accumulation, one training step might take
several inputs.`),Uf=c(),Ne=s("div"),_(Jt.$$.fragment),Gf=c(),gn=s("p"),Jf=r(`Event called at the end of a training step. If using gradient accumulation, one training step might take
several inputs.`),Yf=c(),We=s("div"),_(Yt.$$.fragment),Xf=c(),_n=s("p"),Kf=r("Event called at the end of an substep during gradient accumulation."),Qf=c(),ze=s("div"),_(Xt.$$.fragment),Zf=c(),un=s("p"),eh=r("Event called at the beginning of training."),th=c(),Be=s("div"),_(Kt.$$.fragment),ah=c(),vn=s("p"),rh=r("Event called at the end of training."),Xn=c(),Ve=s("p"),nh=r("Here is an example of how to register a custom callback with the PyTorch "),Ja=s("a"),sh=r("Trainer"),oh=r(":"),Kn=c(),_(Qt.$$.fragment),Qn=c(),qe=s("p"),lh=r("Another way to register a callback is to call "),bn=s("code"),ih=r("trainer.add_callback()"),ch=r(" as follows:"),Zn=c(),_(Zt.$$.fragment),es=c(),_e=s("h2"),Re=s("a"),En=s("span"),_(ea.$$.fragment),fh=c(),kn=s("span"),hh=r("TrainerState"),ts=c(),I=s("div"),_(ta.$$.fragment),mh=c(),ue=s("p"),dh=r("A class containing the "),Ya=s("a"),ph=r("Trainer"),gh=r(` inner state that will be saved along the model and optimizer when checkpointing
and passed to the `),Xa=s("a"),_h=r("TrainerCallback"),uh=r("."),vh=c(),_(He.$$.fragment),bh=c(),Ue=s("div"),_(aa.$$.fragment),Eh=c(),ra=s("p"),kh=r("Create an instance from the content of "),$n=s("code"),$h=r("json_path"),Th=r("."),Ch=c(),Ge=s("div"),_(na.$$.fragment),wh=c(),sa=s("p"),yh=r("Save the content of this instance in JSON format inside "),Tn=s("code"),Ah=r("json_path"),Dh=r("."),as=c(),ve=s("h2"),Je=s("a"),Cn=s("span"),_(oa.$$.fragment),Lh=c(),wn=s("span"),Sh=r("TrainerControl"),rs=c(),be=s("div"),_(la.$$.fragment),Ph=c(),Ee=s("p"),Oh=r("A class that handles the "),Ka=s("a"),Ih=r("Trainer"),Mh=r(" control flow. This class is used by the "),Qa=s("a"),xh=r("TrainerCallback"),Fh=r(` to activate some
switches in the training loop.`),this.h()},l(a){const h=lp('[data-svelte="svelte-1phssyn"]',document.head);w=o(h,"META",{name:!0,content:!0}),h.forEach(t),Y=f(a),D=o(a,"H1",{class:!0});var ia=l(D);P=o(ia,"A",{id:!0,class:!0,href:!0});var zh=l(P);Z=o(zh,"SPAN",{});var Bh=l(Z);u(M.$$.fragment,Bh),Bh.forEach(t),zh.forEach(t),et=f(ia),ee=o(ia,"SPAN",{});var Vh=l(ee);te=n(Vh,"Callbacks"),Vh.forEach(t),ia.forEach(t),x=f(a),q=o(a,"P",{});var ss=l(q);fa=n(ss,`Callbacks are objects that can customize the behavior of the training loop in the PyTorch
`),ha=o(ss,"A",{href:!0});var qh=l(ha);Gs=n(qh,"Trainer"),qh.forEach(t),Js=n(ss,` (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).`),ss.forEach(t),On=f(a),j=o(a,"P",{});var Ye=l(j);Ys=n(Ye,"Callbacks are \u201Cread only\u201D pieces of code, apart from the "),ma=o(Ye,"A",{href:!0});var Rh=l(ma);Xs=n(Rh,"TrainerControl"),Rh.forEach(t),Ks=n(Ye,` object they return, they
cannot change anything in the training loop. For customizations that require changes in the training loop, you should
subclass `),da=o(Ye,"A",{href:!0});var Hh=l(da);Qs=n(Hh,"Trainer"),Hh.forEach(t),Zs=n(Ye," and override the methods you need (see "),pa=o(Ye,"A",{href:!0});var Uh=l(pa);eo=n(Uh,"trainer"),Uh.forEach(t),to=n(Ye," for examples)."),Ye.forEach(t),In=f(a),ke=o(a,"P",{});var os=l(ke);ao=n(os,"By default a "),ga=o(os,"A",{href:!0});var Gh=l(ga);ro=n(Gh,"Trainer"),Gh.forEach(t),no=n(os," will use the following callbacks:"),os.forEach(t),Mn=f(a),y=o(a,"UL",{});var S=l(y);_a=o(S,"LI",{});var jh=l(_a);ua=o(jh,"A",{href:!0});var Jh=l(ua);so=n(Jh,"DefaultFlowCallback"),Jh.forEach(t),oo=n(jh," which handles the default behavior for logging, saving and evaluation."),jh.forEach(t),lo=f(S),X=o(S,"LI",{});var ca=l(X);va=o(ca,"A",{href:!0});var Yh=l(va);io=n(Yh,"PrinterCallback"),Yh.forEach(t),co=n(ca," or "),ba=o(ca,"A",{href:!0});var Xh=l(ba);fo=n(Xh,"ProgressCallback"),Xh.forEach(t),ho=n(ca,` to display progress and print the
logs (the first one is used if you deactivate tqdm through the `),Ea=o(ca,"A",{href:!0});var Kh=l(Ea);mo=n(Kh,"TrainingArguments"),Kh.forEach(t),po=n(ca,`, otherwise
it\u2019s the second one).`),ca.forEach(t),go=f(S),ka=o(S,"LI",{});var Nh=l(ka);$a=o(Nh,"A",{href:!0});var Qh=l($a);_o=n(Qh,"TensorBoardCallback"),Qh.forEach(t),uo=n(Nh,` if tensorboard is accessible (either through PyTorch >= 1.4
or tensorboardX).`),Nh.forEach(t),vo=f(S),$e=o(S,"LI",{});var yn=l($e);Ta=o(yn,"A",{href:!0});var Zh=l(Ta);bo=n(Zh,"WandbCallback"),Zh.forEach(t),Eo=n(yn," if "),tt=o(yn,"A",{href:!0,rel:!0});var em=l(tt);ko=n(em,"wandb"),em.forEach(t),$o=n(yn," is installed."),yn.forEach(t),To=f(S),Te=o(S,"LI",{});var An=l(Te);Ca=o(An,"A",{href:!0});var tm=l(Ca);Co=n(tm,"CometCallback"),tm.forEach(t),wo=n(An," if "),at=o(An,"A",{href:!0,rel:!0});var am=l(at);yo=n(am,"comet_ml"),am.forEach(t),Ao=n(An," is installed."),An.forEach(t),Do=f(S),Ce=o(S,"LI",{});var Dn=l(Ce);wa=o(Dn,"A",{href:!0});var rm=l(wa);Lo=n(rm,"MLflowCallback"),rm.forEach(t),So=n(Dn," if "),rt=o(Dn,"A",{href:!0,rel:!0});var nm=l(rt);Po=n(nm,"mlflow"),nm.forEach(t),Oo=n(Dn," is installed."),Dn.forEach(t),Io=f(S),we=o(S,"LI",{});var Ln=l(we);ya=o(Ln,"A",{href:!0});var sm=l(ya);Mo=n(sm,"AzureMLCallback"),sm.forEach(t),xo=n(Ln," if "),nt=o(Ln,"A",{href:!0,rel:!0});var om=l(nt);Fo=n(om,"azureml-sdk"),om.forEach(t),jo=n(Ln,` is
installed.`),Ln.forEach(t),No=f(S),ye=o(S,"LI",{});var Sn=l(ye);Aa=o(Sn,"A",{href:!0});var lm=l(Aa);Wo=n(lm,"CodeCarbonCallback"),lm.forEach(t),zo=n(Sn," if "),st=o(Sn,"A",{href:!0,rel:!0});var im=l(st);Bo=n(im,"codecarbon"),im.forEach(t),Vo=n(Sn,` is
installed.`),Sn.forEach(t),S.forEach(t),xn=f(a),L=o(a,"P",{});var B=l(L);qo=n(B,"The main class that implements callbacks is "),Da=o(B,"A",{href:!0});var cm=l(Da);Ro=n(cm,"TrainerCallback"),cm.forEach(t),Ho=n(B,`. It gets the
`),La=o(B,"A",{href:!0});var fm=l(La);Uo=n(fm,"TrainingArguments"),fm.forEach(t),Go=n(B," used to instantiate the "),Sa=o(B,"A",{href:!0});var hm=l(Sa);Jo=n(hm,"Trainer"),hm.forEach(t),Yo=n(B,`, can access that
Trainer\u2019s internal state via `),Pa=o(B,"A",{href:!0});var mm=l(Pa);Xo=n(mm,"TrainerState"),mm.forEach(t),Ko=n(B,`, and can take some actions on the training loop via
`),Oa=o(B,"A",{href:!0});var dm=l(Oa);Qo=n(dm,"TrainerControl"),dm.forEach(t),Zo=n(B,"."),B.forEach(t),Fn=f(a),ae=o(a,"H2",{class:!0});var ls=l(ae);Ae=o(ls,"A",{id:!0,class:!0,href:!0});var pm=l(Ae);mr=o(pm,"SPAN",{});var gm=l(mr);u(ot.$$.fragment,gm),gm.forEach(t),pm.forEach(t),el=f(ls),dr=o(ls,"SPAN",{});var _m=l(dr);tl=n(_m,"Available Callbacks"),_m.forEach(t),ls.forEach(t),jn=f(a),De=o(a,"P",{});var is=l(De);al=n(is,"Here is the list of the available "),Ia=o(is,"A",{href:!0});var um=l(Ia);rl=n(um,"TrainerCallback"),um.forEach(t),nl=n(is," in the library:"),is.forEach(t),Nn=f(a),R=o(a,"DIV",{class:!0});var Za=l(R);u(lt.$$.fragment,Za),sl=f(Za),re=o(Za,"P",{});var er=l(re);ol=n(er,"A "),Ma=o(er,"A",{href:!0});var vm=l(Ma);ll=n(vm,"TrainerCallback"),vm.forEach(t),il=n(er," that sends the logs to "),it=o(er,"A",{href:!0,rel:!0});var bm=l(it);cl=n(bm,"Comet ML"),bm.forEach(t),fl=n(er,"."),er.forEach(t),hl=f(Za),N=o(Za,"DIV",{class:!0});var Xe=l(N);u(ct.$$.fragment,Xe),ml=f(Xe),pr=o(Xe,"P",{});var Em=l(pr);dl=n(Em,"Setup the optional Comet.ml integration."),Em.forEach(t),pl=f(Xe),C=o(Xe,"P",{});var A=l(C);gl=n(A,`Environment:
COMET_MODE (`),gr=o(A,"CODE",{});var km=l(gr);_l=n(km,"str"),km.forEach(t),ul=n(A,", "),_r=o(A,"EM",{});var $m=l(_r);vl=n($m,"optional"),$m.forEach(t),bl=n(A,`):
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 (`),ur=o(A,"CODE",{});var Tm=l(ur);El=n(Tm,"str"),Tm.forEach(t),kl=n(A,", "),vr=o(A,"EM",{});var Cm=l(vr);$l=n(Cm,"optional"),Cm.forEach(t),Tl=n(A,`):
Comet project name for experiments
COMET_OFFLINE_DIRECTORY (`),br=o(A,"CODE",{});var wm=l(br);Cl=n(wm,"str"),wm.forEach(t),wl=n(A,", "),Er=o(A,"EM",{});var ym=l(Er);yl=n(ym,"optional"),ym.forEach(t),Al=n(A,`):
Folder to use for saving offline experiments when `),kr=o(A,"CODE",{});var Am=l(kr);Dl=n(Am,"COMET_MODE"),Am.forEach(t),Ll=n(A,` is \u201COFFLINE\u201D
COMET_LOG_ASSETS (`),$r=o(A,"CODE",{});var Dm=l($r);Sl=n(Dm,"str"),Dm.forEach(t),Pl=n(A,", "),Tr=o(A,"EM",{});var Lm=l(Tr);Ol=n(Lm,"optional"),Lm.forEach(t),Il=n(A,`):
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.`),A.forEach(t),Ml=f(Xe),ft=o(Xe,"P",{});var cs=l(ft);xl=n(cs,`For a number of configurable items in the environment, see
`),ht=o(cs,"A",{href:!0,rel:!0});var Sm=l(ht);Fl=n(Sm,"here"),Sm.forEach(t),jl=n(cs,"."),cs.forEach(t),Xe.forEach(t),Za.forEach(t),Wn=f(a),ne=o(a,"DIV",{class:!0});var fs=l(ne);u(mt.$$.fragment,fs),Nl=f(fs),dt=o(fs,"P",{});var hs=l(dt);Wl=n(hs,"A "),xa=o(hs,"A",{href:!0});var Pm=l(xa);zl=n(Pm,"TrainerCallback"),Pm.forEach(t),Bl=n(hs," that handles the default flow of the training loop for logs, evaluation and checkpoints."),hs.forEach(t),fs.forEach(t),zn=f(a),se=o(a,"DIV",{class:!0});var ms=l(se);u(pt.$$.fragment,ms),Vl=f(ms),gt=o(ms,"P",{});var ds=l(gt);ql=n(ds,"A bare "),Fa=o(ds,"A",{href:!0});var Om=l(Fa);Rl=n(Om,"TrainerCallback"),Om.forEach(t),Hl=n(ds," that just prints the logs."),ds.forEach(t),ms.forEach(t),Bn=f(a),oe=o(a,"DIV",{class:!0});var ps=l(oe);u(_t.$$.fragment,ps),Ul=f(ps),ut=o(ps,"P",{});var gs=l(ut);Gl=n(gs,"A "),ja=o(gs,"A",{href:!0});var Im=l(ja);Jl=n(Im,"TrainerCallback"),Im.forEach(t),Yl=n(gs," that displays the progress of training or evaluation."),gs.forEach(t),ps.forEach(t),Vn=f(a),H=o(a,"DIV",{class:!0});var tr=l(H);u(vt.$$.fragment,tr),Xl=f(tr),bt=o(tr,"P",{});var _s=l(bt);Kl=n(_s,"A "),Na=o(_s,"A",{href:!0});var Mm=l(Na);Ql=n(Mm,"TrainerCallback"),Mm.forEach(t),Zl=n(_s," that handles early stopping."),_s.forEach(t),ei=f(tr),U=o(tr,"P",{});var Ke=l(U);ti=n(Ke,"This callback depends on "),Wa=o(Ke,"A",{href:!0});var xm=l(Wa);ai=n(xm,"TrainingArguments"),xm.forEach(t),ri=n(Ke," argument "),Cr=o(Ke,"EM",{});var Fm=l(Cr);ni=n(Fm,"load_best_model_at_end"),Fm.forEach(t),si=n(Ke,` functionality to set best_metric
in `),za=o(Ke,"A",{href:!0});var jm=l(za);oi=n(jm,"TrainerState"),jm.forEach(t),li=n(Ke,"."),Ke.forEach(t),tr.forEach(t),qn=f(a),le=o(a,"DIV",{class:!0});var us=l(le);u(Et.$$.fragment,us),ii=f(us),ie=o(us,"P",{});var ar=l(ie);ci=n(ar,"A "),Ba=o(ar,"A",{href:!0});var Nm=l(Ba);fi=n(Nm,"TrainerCallback"),Nm.forEach(t),hi=n(ar," that sends the logs to "),kt=o(ar,"A",{href:!0,rel:!0});var Wm=l(kt);mi=n(Wm,"TensorBoard"),Wm.forEach(t),di=n(ar,"."),ar.forEach(t),us.forEach(t),Rn=f(a),G=o(a,"DIV",{class:!0});var rr=l(G);u($t.$$.fragment,rr),pi=f(rr),ce=o(rr,"P",{});var nr=l(ce);gi=n(nr,"A "),Va=o(nr,"A",{href:!0});var zm=l(Va);_i=n(zm,"TrainerCallback"),zm.forEach(t),ui=n(nr," that sends the logs to "),Tt=o(nr,"A",{href:!0,rel:!0});var Bm=l(Tt);vi=n(Bm,"Weight and Biases"),Bm.forEach(t),bi=n(nr,"."),nr.forEach(t),Ei=f(rr),W=o(rr,"DIV",{class:!0});var Qe=l(W);u(Ct.$$.fragment,Qe),ki=f(Qe),wt=o(Qe,"P",{});var vs=l(wt);$i=n(vs,"Setup the optional Weights & Biases ("),wr=o(vs,"EM",{});var Vm=l(wr);Ti=n(Vm,"wandb"),Vm.forEach(t),Ci=n(vs,") integration."),vs.forEach(t),wi=f(Qe),yt=o(Qe,"P",{});var bs=l(yt);yi=n(bs,`One can subclass and override this method to customize the setup if needed. Find more information
`),At=o(bs,"A",{href:!0,rel:!0});var qm=l(At);Ai=n(qm,"here"),qm.forEach(t),Di=n(bs,`. You can also override the following environment
variables:`),bs.forEach(t),Li=f(Qe),d=o(Qe,"P",{});var g=l(d);Si=n(g,`Environment:
WANDB_LOG_MODEL (`),yr=o(g,"CODE",{});var Rm=l(yr);Pi=n(Rm,"bool"),Rm.forEach(t),Oi=n(g,", "),Ar=o(g,"EM",{});var Hm=l(Ar);Ii=n(Hm,"optional"),Hm.forEach(t),Mi=n(g,", defaults to "),Dr=o(g,"CODE",{});var Um=l(Dr);xi=n(Um,"False"),Um.forEach(t),Fi=n(g,`):
Whether or not to log model as artifact at the end of training. Use along with
`),Lr=o(g,"EM",{});var Gm=l(Lr);ji=n(Gm,"TrainingArguments.load_best_model_at_end"),Gm.forEach(t),Ni=n(g,` to upload best model.
WANDB_WATCH (`),Sr=o(g,"CODE",{});var Jm=l(Sr);Wi=n(Jm,"str"),Jm.forEach(t),zi=n(g,", "),Pr=o(g,"EM",{});var Ym=l(Pr);Bi=n(Ym,"optional"),Ym.forEach(t),Vi=n(g," defaults to "),Or=o(g,"CODE",{});var Xm=l(Or);qi=n(Xm,'"gradients"'),Xm.forEach(t),Ri=n(g,`):
Can be `),Ir=o(g,"CODE",{});var Km=l(Ir);Hi=n(Km,'"gradients"'),Km.forEach(t),Ui=n(g,", "),Mr=o(g,"CODE",{});var Qm=l(Mr);Gi=n(Qm,'"all"'),Qm.forEach(t),Ji=n(g," or "),xr=o(g,"CODE",{});var Zm=l(xr);Yi=n(Zm,'"false"'),Zm.forEach(t),Xi=n(g,". Set to "),Fr=o(g,"CODE",{});var ed=l(Fr);Ki=n(ed,'"false"'),ed.forEach(t),Qi=n(g," to disable gradient logging or "),jr=o(g,"CODE",{});var td=l(jr);Zi=n(td,'"all"'),td.forEach(t),ec=n(g,` to
log gradients and parameters.
WANDB_PROJECT (`),Nr=o(g,"CODE",{});var ad=l(Nr);tc=n(ad,"str"),ad.forEach(t),ac=n(g,", "),Wr=o(g,"EM",{});var rd=l(Wr);rc=n(rd,"optional"),rd.forEach(t),nc=n(g,", defaults to "),zr=o(g,"CODE",{});var nd=l(zr);sc=n(nd,'"huggingface"'),nd.forEach(t),oc=n(g,`):
Set this to a custom string to store results in a different project.
WANDB_DISABLED (`),Br=o(g,"CODE",{});var sd=l(Br);lc=n(sd,"bool"),sd.forEach(t),ic=n(g,", "),Vr=o(g,"EM",{});var od=l(Vr);cc=n(od,"optional"),od.forEach(t),fc=n(g,", defaults to "),qr=o(g,"CODE",{});var ld=l(qr);hc=n(ld,"False"),ld.forEach(t),mc=n(g,`):
Whether or not to disable wandb entirely. Set `),Rr=o(g,"EM",{});var id=l(Rr);dc=n(id,"WANDB_DISABLED=true"),id.forEach(t),pc=n(g," to disable."),g.forEach(t),Qe.forEach(t),rr.forEach(t),Hn=f(a),J=o(a,"DIV",{class:!0});var sr=l(J);u(Dt.$$.fragment,sr),gc=f(sr),fe=o(sr,"P",{});var or=l(fe);_c=n(or,"A "),qa=o(or,"A",{href:!0});var cd=l(qa);uc=n(cd,"TrainerCallback"),cd.forEach(t),vc=n(or," that sends the logs to "),Lt=o(or,"A",{href:!0,rel:!0});var fd=l(Lt);bc=n(fd,"MLflow"),fd.forEach(t),Ec=n(or,"."),or.forEach(t),kc=f(sr),z=o(sr,"DIV",{class:!0});var Ze=l(z);u(St.$$.fragment,Ze),$c=f(Ze),Hr=o(Ze,"P",{});var hd=l(Hr);Tc=n(hd,"Setup the optional MLflow integration."),hd.forEach(t),Cc=f(Ze),he=o(Ze,"P",{});var lr=l(he);wc=n(lr,`Environment:
HF_MLFLOW_LOG_ARTIFACTS (`),Ur=o(lr,"CODE",{});var md=l(Ur);yc=n(md,"str"),md.forEach(t),Ac=n(lr,", "),Gr=o(lr,"EM",{});var dd=l(Gr);Dc=n(dd,"optional"),dd.forEach(t),Lc=n(lr,`):
Whether to use MLflow .log_artifact() facility to log artifacts.`),lr.forEach(t),Sc=f(Ze),F=o(Ze,"P",{});var K=l(F);Pc=n(K,"This only makes sense if logging to a remote server, e.g. s3 or GCS. If set to "),Jr=o(K,"CODE",{});var pd=l(Jr);Oc=n(pd,"True"),pd.forEach(t),Ic=n(K," or "),Yr=o(K,"EM",{});var gd=l(Yr);Mc=n(gd,"1"),gd.forEach(t),xc=n(K,`, will copy
whatever is in `),Ra=o(K,"A",{href:!0});var _d=l(Ra);Fc=n(_d,"TrainingArguments"),_d.forEach(t),jc=n(K,"\u2019s "),Xr=o(K,"CODE",{});var ud=l(Xr);Nc=n(ud,"output_dir"),ud.forEach(t),Wc=n(K,` to the local or remote artifact storage. Using it
without a remote storage will just copy the files to your artifact location.`),K.forEach(t),Ze.forEach(t),sr.forEach(t),Un=f(a),me=o(a,"DIV",{class:!0});var Es=l(me);u(Pt.$$.fragment,Es),zc=f(Es),de=o(Es,"P",{});var ir=l(de);Bc=n(ir,"A "),Ha=o(ir,"A",{href:!0});var vd=l(Ha);Vc=n(vd,"TrainerCallback"),vd.forEach(t),qc=n(ir," that sends the logs to "),Ot=o(ir,"A",{href:!0,rel:!0});var bd=l(Ot);Rc=n(bd,"AzureML"),bd.forEach(t),Hc=n(ir,"."),ir.forEach(t),Es.forEach(t),Gn=f(a),pe=o(a,"DIV",{class:!0});var ks=l(pe);u(It.$$.fragment,ks),Uc=f(ks),Mt=o(ks,"P",{});var $s=l(Mt);Gc=n($s,"A "),Ua=o($s,"A",{href:!0});var Ed=l(Ua);Jc=n(Ed,"TrainerCallback"),Ed.forEach(t),Yc=n($s," that tracks the CO2 emission of training."),$s.forEach(t),ks.forEach(t),Jn=f(a),ge=o(a,"H2",{class:!0});var Ts=l(ge);Le=o(Ts,"A",{id:!0,class:!0,href:!0});var kd=l(Le);Kr=o(kd,"SPAN",{});var $d=l(Kr);u(xt.$$.fragment,$d),$d.forEach(t),kd.forEach(t),Xc=f(Ts),Qr=o(Ts,"SPAN",{});var Td=l(Qr);Kc=n(Td,"TrainerCallback"),Td.forEach(t),Ts.forEach(t),Yn=f(a),p=o(a,"DIV",{class:!0});var $=l(p);u(Ft.$$.fragment,$),Qc=f($),Zr=o($,"P",{});var Cd=l(Zr);Zc=n(Cd,`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:`),Cd.forEach(t),ef=f($),jt=o($,"P",{});var Cs=l(jt);tf=n(Cs,"The "),en=o(Cs,"CODE",{});var wd=l(en);af=n(wd,"control"),wd.forEach(t),rf=n(Cs,` 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.`),Cs.forEach(t),nf=f($),O=o($,"P",{});var V=l(O);sf=n(V,"The argument "),tn=o(V,"CODE",{});var yd=l(tn);of=n(yd,"args"),yd.forEach(t),lf=n(V,", "),an=o(V,"CODE",{});var Ad=l(an);cf=n(Ad,"state"),Ad.forEach(t),ff=n(V," and "),rn=o(V,"CODE",{});var Dd=l(rn);hf=n(Dd,"control"),Dd.forEach(t),mf=n(V," are positionals for all events, all the others are grouped in "),nn=o(V,"CODE",{});var Ld=l(nn);df=n(Ld,"kwargs"),Ld.forEach(t),pf=n(V,`.
You can unpack the ones you need in the signature of the event using them. As an example, see the code of the
simple `),sn=o(V,"CODE",{});var Sd=l(sn);gf=n(Sd,"PrinterCallback"),Sd.forEach(t),_f=n(V,"."),V.forEach(t),uf=f($),on=o($,"P",{});var Pd=l(on);vf=n(Pd,"Example:"),Pd.forEach(t),bf=f($),u(Nt.$$.fragment,$),Ef=f($),Se=o($,"DIV",{class:!0});var ws=l(Se);u(Wt.$$.fragment,ws),kf=f(ws),ln=o(ws,"P",{});var Od=l(ln);$f=n(Od,"Event called at the beginning of an epoch."),Od.forEach(t),ws.forEach(t),Tf=f($),Pe=o($,"DIV",{class:!0});var ys=l(Pe);u(zt.$$.fragment,ys),Cf=f(ys),cn=o(ys,"P",{});var Id=l(cn);wf=n(Id,"Event called at the end of an epoch."),Id.forEach(t),ys.forEach(t),yf=f($),Oe=o($,"DIV",{class:!0});var As=l(Oe);u(Bt.$$.fragment,As),Af=f(As),fn=o(As,"P",{});var Md=l(fn);Df=n(Md,"Event called after an evaluation phase."),Md.forEach(t),As.forEach(t),Lf=f($),Ie=o($,"DIV",{class:!0});var Ds=l(Ie);u(Vt.$$.fragment,Ds),Sf=f(Ds),qt=o(Ds,"P",{});var Ls=l(qt);Pf=n(Ls,"Event called at the end of the initialization of the "),Ga=o(Ls,"A",{href:!0});var xd=l(Ga);Of=n(xd,"Trainer"),xd.forEach(t),If=n(Ls,"."),Ls.forEach(t),Ds.forEach(t),Mf=f($),Me=o($,"DIV",{class:!0});var Ss=l(Me);u(Rt.$$.fragment,Ss),xf=f(Ss),hn=o(Ss,"P",{});var Fd=l(hn);Ff=n(Fd,"Event called after logging the last logs."),Fd.forEach(t),Ss.forEach(t),jf=f($),xe=o($,"DIV",{class:!0});var Ps=l(xe);u(Ht.$$.fragment,Ps),Nf=f(Ps),mn=o(Ps,"P",{});var jd=l(mn);Wf=n(jd,"Event called after a prediction step."),jd.forEach(t),Ps.forEach(t),zf=f($),Fe=o($,"DIV",{class:!0});var Os=l(Fe);u(Ut.$$.fragment,Os),Bf=f(Os),dn=o(Os,"P",{});var Nd=l(dn);Vf=n(Nd,"Event called after a checkpoint save."),Nd.forEach(t),Os.forEach(t),qf=f($),je=o($,"DIV",{class:!0});var Is=l(je);u(Gt.$$.fragment,Is),Rf=f(Is),pn=o(Is,"P",{});var Wd=l(pn);Hf=n(Wd,`Event called at the beginning of a training step. If using gradient accumulation, one training step might take
several inputs.`),Wd.forEach(t),Is.forEach(t),Uf=f($),Ne=o($,"DIV",{class:!0});var Ms=l(Ne);u(Jt.$$.fragment,Ms),Gf=f(Ms),gn=o(Ms,"P",{});var zd=l(gn);Jf=n(zd,`Event called at the end of a training step. If using gradient accumulation, one training step might take
several inputs.`),zd.forEach(t),Ms.forEach(t),Yf=f($),We=o($,"DIV",{class:!0});var xs=l(We);u(Yt.$$.fragment,xs),Xf=f(xs),_n=o(xs,"P",{});var Bd=l(_n);Kf=n(Bd,"Event called at the end of an substep during gradient accumulation."),Bd.forEach(t),xs.forEach(t),Qf=f($),ze=o($,"DIV",{class:!0});var Fs=l(ze);u(Xt.$$.fragment,Fs),Zf=f(Fs),un=o(Fs,"P",{});var Vd=l(un);eh=n(Vd,"Event called at the beginning of training."),Vd.forEach(t),Fs.forEach(t),th=f($),Be=o($,"DIV",{class:!0});var js=l(Be);u(Kt.$$.fragment,js),ah=f(js),vn=o(js,"P",{});var qd=l(vn);rh=n(qd,"Event called at the end of training."),qd.forEach(t),js.forEach(t),$.forEach(t),Xn=f(a),Ve=o(a,"P",{});var Ns=l(Ve);nh=n(Ns,"Here is an example of how to register a custom callback with the PyTorch "),Ja=o(Ns,"A",{href:!0});var Rd=l(Ja);sh=n(Rd,"Trainer"),Rd.forEach(t),oh=n(Ns,":"),Ns.forEach(t),Kn=f(a),u(Qt.$$.fragment,a),Qn=f(a),qe=o(a,"P",{});var Ws=l(qe);lh=n(Ws,"Another way to register a callback is to call "),bn=o(Ws,"CODE",{});var Hd=l(bn);ih=n(Hd,"trainer.add_callback()"),Hd.forEach(t),ch=n(Ws," as follows:"),Ws.forEach(t),Zn=f(a),u(Zt.$$.fragment,a),es=f(a),_e=o(a,"H2",{class:!0});var zs=l(_e);Re=o(zs,"A",{id:!0,class:!0,href:!0});var Ud=l(Re);En=o(Ud,"SPAN",{});var Gd=l(En);u(ea.$$.fragment,Gd),Gd.forEach(t),Ud.forEach(t),fh=f(zs),kn=o(zs,"SPAN",{});var Jd=l(kn);hh=n(Jd,"TrainerState"),Jd.forEach(t),zs.forEach(t),ts=f(a),I=o(a,"DIV",{class:!0});var Q=l(I);u(ta.$$.fragment,Q),mh=f(Q),ue=o(Q,"P",{});var cr=l(ue);dh=n(cr,"A class containing the "),Ya=o(cr,"A",{href:!0});var Yd=l(Ya);ph=n(Yd,"Trainer"),Yd.forEach(t),gh=n(cr,` inner state that will be saved along the model and optimizer when checkpointing
and passed to the `),Xa=o(cr,"A",{href:!0});var Xd=l(Xa);_h=n(Xd,"TrainerCallback"),Xd.forEach(t),uh=n(cr,"."),cr.forEach(t),vh=f(Q),u(He.$$.fragment,Q),bh=f(Q),Ue=o(Q,"DIV",{class:!0});var Bs=l(Ue);u(aa.$$.fragment,Bs),Eh=f(Bs),ra=o(Bs,"P",{});var Vs=l(ra);kh=n(Vs,"Create an instance from the content of "),$n=o(Vs,"CODE",{});var Kd=l($n);$h=n(Kd,"json_path"),Kd.forEach(t),Th=n(Vs,"."),Vs.forEach(t),Bs.forEach(t),Ch=f(Q),Ge=o(Q,"DIV",{class:!0});var qs=l(Ge);u(na.$$.fragment,qs),wh=f(qs),sa=o(qs,"P",{});var Rs=l(sa);yh=n(Rs,"Save the content of this instance in JSON format inside "),Tn=o(Rs,"CODE",{});var Qd=l(Tn);Ah=n(Qd,"json_path"),Qd.forEach(t),Dh=n(Rs,"."),Rs.forEach(t),qs.forEach(t),Q.forEach(t),as=f(a),ve=o(a,"H2",{class:!0});var Hs=l(ve);Je=o(Hs,"A",{id:!0,class:!0,href:!0});var Zd=l(Je);Cn=o(Zd,"SPAN",{});var ep=l(Cn);u(oa.$$.fragment,ep),ep.forEach(t),Zd.forEach(t),Lh=f(Hs),wn=o(Hs,"SPAN",{});var tp=l(wn);Sh=n(tp,"TrainerControl"),tp.forEach(t),Hs.forEach(t),rs=f(a),be=o(a,"DIV",{class:!0});var Us=l(be);u(la.$$.fragment,Us),Ph=f(Us),Ee=o(Us,"P",{});var fr=l(Ee);Oh=n(fr,"A class that handles the "),Ka=o(fr,"A",{href:!0});var ap=l(Ka);Ih=n(ap,"Trainer"),ap.forEach(t),Mh=n(fr," control flow. This class is used by the "),Qa=o(fr,"A",{href:!0});var rp=l(Qa);xh=n(rp,"TrainerCallback"),rp.forEach(t),Fh=n(fr,` to activate some
switches in the training loop.`),fr.forEach(t),Us.forEach(t),this.h()},h(){i(w,"name","hf:doc:metadata"),i(w,"content",JSON.stringify(hp)),i(P,"id","callbacks"),i(P,"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(P,"href","#callbacks"),i(D,"class","relative group"),i(ha,"href","/docs/transformers/pr_15839/en/main_classes/trainer#transformers.Trainer"),i(ma,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerControl"),i(da,"href","/docs/transformers/pr_15839/en/main_classes/trainer#transformers.Trainer"),i(pa,"href","trainer"),i(ga,"href","/docs/transformers/pr_15839/en/main_classes/trainer#transformers.Trainer"),i(ua,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.DefaultFlowCallback"),i(va,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.PrinterCallback"),i(ba,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.ProgressCallback"),i(Ea,"href","/docs/transformers/pr_15839/en/main_classes/trainer#transformers.TrainingArguments"),i($a,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.integrations.TensorBoardCallback"),i(Ta,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.integrations.WandbCallback"),i(tt,"href","https://www.wandb.com/"),i(tt,"rel","nofollow"),i(Ca,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.integrations.CometCallback"),i(at,"href","https://www.comet.ml/site/"),i(at,"rel","nofollow"),i(wa,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.integrations.MLflowCallback"),i(rt,"href","https://www.mlflow.org/"),i(rt,"rel","nofollow"),i(ya,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.integrations.AzureMLCallback"),i(nt,"href","https://pypi.org/project/azureml-sdk/"),i(nt,"rel","nofollow"),i(Aa,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.integrations.CodeCarbonCallback"),i(st,"href","https://pypi.org/project/codecarbon/"),i(st,"rel","nofollow"),i(Da,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(La,"href","/docs/transformers/pr_15839/en/main_classes/trainer#transformers.TrainingArguments"),i(Sa,"href","/docs/transformers/pr_15839/en/main_classes/trainer#transformers.Trainer"),i(Pa,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerState"),i(Oa,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerControl"),i(Ae,"id","transformers.integrations.CometCallback"),i(Ae,"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(Ae,"href","#transformers.integrations.CometCallback"),i(ae,"class","relative group"),i(Ia,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(Ma,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(it,"href","https://www.comet.ml/site/"),i(it,"rel","nofollow"),i(ht,"href","https://www.comet.ml/docs/python-sdk/advanced/#comet-configuration-variables"),i(ht,"rel","nofollow"),i(N,"class","docstring"),i(R,"class","docstring"),i(xa,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(ne,"class","docstring"),i(Fa,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(se,"class","docstring"),i(ja,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(oe,"class","docstring"),i(Na,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(Wa,"href","/docs/transformers/pr_15839/en/main_classes/trainer#transformers.TrainingArguments"),i(za,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerState"),i(H,"class","docstring"),i(Ba,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(kt,"href","https://www.tensorflow.org/tensorboard"),i(kt,"rel","nofollow"),i(le,"class","docstring"),i(Va,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(Tt,"href","https://www.wandb.com/"),i(Tt,"rel","nofollow"),i(At,"href","https://docs.wandb.ai/integrations/huggingface"),i(At,"rel","nofollow"),i(W,"class","docstring"),i(G,"class","docstring"),i(qa,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(Lt,"href","https://www.mlflow.org/"),i(Lt,"rel","nofollow"),i(Ra,"href","/docs/transformers/pr_15839/en/main_classes/trainer#transformers.TrainingArguments"),i(z,"class","docstring"),i(J,"class","docstring"),i(Ha,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(Ot,"href","https://pypi.org/project/azureml-sdk/"),i(Ot,"rel","nofollow"),i(me,"class","docstring"),i(Ua,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(pe,"class","docstring"),i(Le,"id","transformers.TrainerCallback"),i(Le,"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(Le,"href","#transformers.TrainerCallback"),i(ge,"class","relative group"),i(Se,"class","docstring"),i(Pe,"class","docstring"),i(Oe,"class","docstring"),i(Ga,"href","/docs/transformers/pr_15839/en/main_classes/trainer#transformers.Trainer"),i(Ie,"class","docstring"),i(Me,"class","docstring"),i(xe,"class","docstring"),i(Fe,"class","docstring"),i(je,"class","docstring"),i(Ne,"class","docstring"),i(We,"class","docstring"),i(ze,"class","docstring"),i(Be,"class","docstring"),i(p,"class","docstring"),i(Ja,"href","/docs/transformers/pr_15839/en/main_classes/trainer#transformers.Trainer"),i(Re,"id","transformers.TrainerState"),i(Re,"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(Re,"href","#transformers.TrainerState"),i(_e,"class","relative group"),i(Ya,"href","/docs/transformers/pr_15839/en/main_classes/trainer#transformers.Trainer"),i(Xa,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(Ue,"class","docstring"),i(Ge,"class","docstring"),i(I,"class","docstring"),i(Je,"id","transformers.TrainerControl"),i(Je,"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(Je,"href","#transformers.TrainerControl"),i(ve,"class","relative group"),i(Ka,"href","/docs/transformers/pr_15839/en/main_classes/trainer#transformers.Trainer"),i(Qa,"href","/docs/transformers/pr_15839/en/main_classes/callback#transformers.TrainerCallback"),i(be,"class","docstring")},m(a,h){e(document.head,w),m(a,Y,h),m(a,D,h),e(D,P),e(P,Z),v(M,Z,null),e(D,et),e(D,ee),e(ee,te),m(a,x,h),m(a,q,h),e(q,fa),e(q,ha),e(ha,Gs),e(q,Js),m(a,On,h),m(a,j,h),e(j,Ys),e(j,ma),e(ma,Xs),e(j,Ks),e(j,da),e(da,Qs),e(j,Zs),e(j,pa),e(pa,eo),e(j,to),m(a,In,h),m(a,ke,h),e(ke,ao),e(ke,ga),e(ga,ro),e(ke,no),m(a,Mn,h),m(a,y,h),e(y,_a),e(_a,ua),e(ua,so),e(_a,oo),e(y,lo),e(y,X),e(X,va),e(va,io),e(X,co),e(X,ba),e(ba,fo),e(X,ho),e(X,Ea),e(Ea,mo),e(X,po),e(y,go),e(y,ka),e(ka,$a),e($a,_o),e(ka,uo),e(y,vo),e(y,$e),e($e,Ta),e(Ta,bo),e($e,Eo),e($e,tt),e(tt,ko),e($e,$o),e(y,To),e(y,Te),e(Te,Ca),e(Ca,Co),e(Te,wo),e(Te,at),e(at,yo),e(Te,Ao),e(y,Do),e(y,Ce),e(Ce,wa),e(wa,Lo),e(Ce,So),e(Ce,rt),e(rt,Po),e(Ce,Oo),e(y,Io),e(y,we),e(we,ya),e(ya,Mo),e(we,xo),e(we,nt),e(nt,Fo),e(we,jo),e(y,No),e(y,ye),e(ye,Aa),e(Aa,Wo),e(ye,zo),e(ye,st),e(st,Bo),e(ye,Vo),m(a,xn,h),m(a,L,h),e(L,qo),e(L,Da),e(Da,Ro),e(L,Ho),e(L,La),e(La,Uo),e(L,Go),e(L,Sa),e(Sa,Jo),e(L,Yo),e(L,Pa),e(Pa,Xo),e(L,Ko),e(L,Oa),e(Oa,Qo),e(L,Zo),m(a,Fn,h),m(a,ae,h),e(ae,Ae),e(Ae,mr),v(ot,mr,null),e(ae,el),e(ae,dr),e(dr,tl),m(a,jn,h),m(a,De,h),e(De,al),e(De,Ia),e(Ia,rl),e(De,nl),m(a,Nn,h),m(a,R,h),v(lt,R,null),e(R,sl),e(R,re),e(re,ol),e(re,Ma),e(Ma,ll),e(re,il),e(re,it),e(it,cl),e(re,fl),e(R,hl),e(R,N),v(ct,N,null),e(N,ml),e(N,pr),e(pr,dl),e(N,pl),e(N,C),e(C,gl),e(C,gr),e(gr,_l),e(C,ul),e(C,_r),e(_r,vl),e(C,bl),e(C,ur),e(ur,El),e(C,kl),e(C,vr),e(vr,$l),e(C,Tl),e(C,br),e(br,Cl),e(C,wl),e(C,Er),e(Er,yl),e(C,Al),e(C,kr),e(kr,Dl),e(C,Ll),e(C,$r),e($r,Sl),e(C,Pl),e(C,Tr),e(Tr,Ol),e(C,Il),e(N,Ml),e(N,ft),e(ft,xl),e(ft,ht),e(ht,Fl),e(ft,jl),m(a,Wn,h),m(a,ne,h),v(mt,ne,null),e(ne,Nl),e(ne,dt),e(dt,Wl),e(dt,xa),e(xa,zl),e(dt,Bl),m(a,zn,h),m(a,se,h),v(pt,se,null),e(se,Vl),e(se,gt),e(gt,ql),e(gt,Fa),e(Fa,Rl),e(gt,Hl),m(a,Bn,h),m(a,oe,h),v(_t,oe,null),e(oe,Ul),e(oe,ut),e(ut,Gl),e(ut,ja),e(ja,Jl),e(ut,Yl),m(a,Vn,h),m(a,H,h),v(vt,H,null),e(H,Xl),e(H,bt),e(bt,Kl),e(bt,Na),e(Na,Ql),e(bt,Zl),e(H,ei),e(H,U),e(U,ti),e(U,Wa),e(Wa,ai),e(U,ri),e(U,Cr),e(Cr,ni),e(U,si),e(U,za),e(za,oi),e(U,li),m(a,qn,h),m(a,le,h),v(Et,le,null),e(le,ii),e(le,ie),e(ie,ci),e(ie,Ba),e(Ba,fi),e(ie,hi),e(ie,kt),e(kt,mi),e(ie,di),m(a,Rn,h),m(a,G,h),v($t,G,null),e(G,pi),e(G,ce),e(ce,gi),e(ce,Va),e(Va,_i),e(ce,ui),e(ce,Tt),e(Tt,vi),e(ce,bi),e(G,Ei),e(G,W),v(Ct,W,null),e(W,ki),e(W,wt),e(wt,$i),e(wt,wr),e(wr,Ti),e(wt,Ci),e(W,wi),e(W,yt),e(yt,yi),e(yt,At),e(At,Ai),e(yt,Di),e(W,Li),e(W,d),e(d,Si),e(d,yr),e(yr,Pi),e(d,Oi),e(d,Ar),e(Ar,Ii),e(d,Mi),e(d,Dr),e(Dr,xi),e(d,Fi),e(d,Lr),e(Lr,ji),e(d,Ni),e(d,Sr),e(Sr,Wi),e(d,zi),e(d,Pr),e(Pr,Bi),e(d,Vi),e(d,Or),e(Or,qi),e(d,Ri),e(d,Ir),e(Ir,Hi),e(d,Ui),e(d,Mr),e(Mr,Gi),e(d,Ji),e(d,xr),e(xr,Yi),e(d,Xi),e(d,Fr),e(Fr,Ki),e(d,Qi),e(d,jr),e(jr,Zi),e(d,ec),e(d,Nr),e(Nr,tc),e(d,ac),e(d,Wr),e(Wr,rc),e(d,nc),e(d,zr),e(zr,sc),e(d,oc),e(d,Br),e(Br,lc),e(d,ic),e(d,Vr),e(Vr,cc),e(d,fc),e(d,qr),e(qr,hc),e(d,mc),e(d,Rr),e(Rr,dc),e(d,pc),m(a,Hn,h),m(a,J,h),v(Dt,J,null),e(J,gc),e(J,fe),e(fe,_c),e(fe,qa),e(qa,uc),e(fe,vc),e(fe,Lt),e(Lt,bc),e(fe,Ec),e(J,kc),e(J,z),v(St,z,null),e(z,$c),e(z,Hr),e(Hr,Tc),e(z,Cc),e(z,he),e(he,wc),e(he,Ur),e(Ur,yc),e(he,Ac),e(he,Gr),e(Gr,Dc),e(he,Lc),e(z,Sc),e(z,F),e(F,Pc),e(F,Jr),e(Jr,Oc),e(F,Ic),e(F,Yr),e(Yr,Mc),e(F,xc),e(F,Ra),e(Ra,Fc),e(F,jc),e(F,Xr),e(Xr,Nc),e(F,Wc),m(a,Un,h),m(a,me,h),v(Pt,me,null),e(me,zc),e(me,de),e(de,Bc),e(de,Ha),e(Ha,Vc),e(de,qc),e(de,Ot),e(Ot,Rc),e(de,Hc),m(a,Gn,h),m(a,pe,h),v(It,pe,null),e(pe,Uc),e(pe,Mt),e(Mt,Gc),e(Mt,Ua),e(Ua,Jc),e(Mt,Yc),m(a,Jn,h),m(a,ge,h),e(ge,Le),e(Le,Kr),v(xt,Kr,null),e(ge,Xc),e(ge,Qr),e(Qr,Kc),m(a,Yn,h),m(a,p,h),v(Ft,p,null),e(p,Qc),e(p,Zr),e(Zr,Zc),e(p,ef),e(p,jt),e(jt,tf),e(jt,en),e(en,af),e(jt,rf),e(p,nf),e(p,O),e(O,sf),e(O,tn),e(tn,of),e(O,lf),e(O,an),e(an,cf),e(O,ff),e(O,rn),e(rn,hf),e(O,mf),e(O,nn),e(nn,df),e(O,pf),e(O,sn),e(sn,gf),e(O,_f),e(p,uf),e(p,on),e(on,vf),e(p,bf),v(Nt,p,null),e(p,Ef),e(p,Se),v(Wt,Se,null),e(Se,kf),e(Se,ln),e(ln,$f),e(p,Tf),e(p,Pe),v(zt,Pe,null),e(Pe,Cf),e(Pe,cn),e(cn,wf),e(p,yf),e(p,Oe),v(Bt,Oe,null),e(Oe,Af),e(Oe,fn),e(fn,Df),e(p,Lf),e(p,Ie),v(Vt,Ie,null),e(Ie,Sf),e(Ie,qt),e(qt,Pf),e(qt,Ga),e(Ga,Of),e(qt,If),e(p,Mf),e(p,Me),v(Rt,Me,null),e(Me,xf),e(Me,hn),e(hn,Ff),e(p,jf),e(p,xe),v(Ht,xe,null),e(xe,Nf),e(xe,mn),e(mn,Wf),e(p,zf),e(p,Fe),v(Ut,Fe,null),e(Fe,Bf),e(Fe,dn),e(dn,Vf),e(p,qf),e(p,je),v(Gt,je,null),e(je,Rf),e(je,pn),e(pn,Hf),e(p,Uf),e(p,Ne),v(Jt,Ne,null),e(Ne,Gf),e(Ne,gn),e(gn,Jf),e(p,Yf),e(p,We),v(Yt,We,null),e(We,Xf),e(We,_n),e(_n,Kf),e(p,Qf),e(p,ze),v(Xt,ze,null),e(ze,Zf),e(ze,un),e(un,eh),e(p,th),e(p,Be),v(Kt,Be,null),e(Be,ah),e(Be,vn),e(vn,rh),m(a,Xn,h),m(a,Ve,h),e(Ve,nh),e(Ve,Ja),e(Ja,sh),e(Ve,oh),m(a,Kn,h),v(Qt,a,h),m(a,Qn,h),m(a,qe,h),e(qe,lh),e(qe,bn),e(bn,ih),e(qe,ch),m(a,Zn,h),v(Zt,a,h),m(a,es,h),m(a,_e,h),e(_e,Re),e(Re,En),v(ea,En,null),e(_e,fh),e(_e,kn),e(kn,hh),m(a,ts,h),m(a,I,h),v(ta,I,null),e(I,mh),e(I,ue),e(ue,dh),e(ue,Ya),e(Ya,ph),e(ue,gh),e(ue,Xa),e(Xa,_h),e(ue,uh),e(I,vh),v(He,I,null),e(I,bh),e(I,Ue),v(aa,Ue,null),e(Ue,Eh),e(Ue,ra),e(ra,kh),e(ra,$n),e($n,$h),e(ra,Th),e(I,Ch),e(I,Ge),v(na,Ge,null),e(Ge,wh),e(Ge,sa),e(sa,yh),e(sa,Tn),e(Tn,Ah),e(sa,Dh),m(a,as,h),m(a,ve,h),e(ve,Je),e(Je,Cn),v(oa,Cn,null),e(ve,Lh),e(ve,wn),e(wn,Sh),m(a,rs,h),m(a,be,h),v(la,be,null),e(be,Ph),e(be,Ee),e(Ee,Oh),e(Ee,Ka),e(Ka,Ih),e(Ee,Mh),e(Ee,Qa),e(Qa,xh),e(Ee,Fh),ns=!0},p(a,[h]){const ia={};h&2&&(ia.$$scope={dirty:h,ctx:a}),He.$set(ia)},i(a){ns||(b(M.$$.fragment,a),b(ot.$$.fragment,a),b(lt.$$.fragment,a),b(ct.$$.fragment,a),b(mt.$$.fragment,a),b(pt.$$.fragment,a),b(_t.$$.fragment,a),b(vt.$$.fragment,a),b(Et.$$.fragment,a),b($t.$$.fragment,a),b(Ct.$$.fragment,a),b(Dt.$$.fragment,a),b(St.$$.fragment,a),b(Pt.$$.fragment,a),b(It.$$.fragment,a),b(xt.$$.fragment,a),b(Ft.$$.fragment,a),b(Nt.$$.fragment,a),b(Wt.$$.fragment,a),b(zt.$$.fragment,a),b(Bt.$$.fragment,a),b(Vt.$$.fragment,a),b(Rt.$$.fragment,a),b(Ht.$$.fragment,a),b(Ut.$$.fragment,a),b(Gt.$$.fragment,a),b(Jt.$$.fragment,a),b(Yt.$$.fragment,a),b(Xt.$$.fragment,a),b(Kt.$$.fragment,a),b(Qt.$$.fragment,a),b(Zt.$$.fragment,a),b(ea.$$.fragment,a),b(ta.$$.fragment,a),b(He.$$.fragment,a),b(aa.$$.fragment,a),b(na.$$.fragment,a),b(oa.$$.fragment,a),b(la.$$.fragment,a),ns=!0)},o(a){E(M.$$.fragment,a),E(ot.$$.fragment,a),E(lt.$$.fragment,a),E(ct.$$.fragment,a),E(mt.$$.fragment,a),E(pt.$$.fragment,a),E(_t.$$.fragment,a),E(vt.$$.fragment,a),E(Et.$$.fragment,a),E($t.$$.fragment,a),E(Ct.$$.fragment,a),E(Dt.$$.fragment,a),E(St.$$.fragment,a),E(Pt.$$.fragment,a),E(It.$$.fragment,a),E(xt.$$.fragment,a),E(Ft.$$.fragment,a),E(Nt.$$.fragment,a),E(Wt.$$.fragment,a),E(zt.$$.fragment,a),E(Bt.$$.fragment,a),E(Vt.$$.fragment,a),E(Rt.$$.fragment,a),E(Ht.$$.fragment,a),E(Ut.$$.fragment,a),E(Gt.$$.fragment,a),E(Jt.$$.fragment,a),E(Yt.$$.fragment,a),E(Xt.$$.fragment,a),E(Kt.$$.fragment,a),E(Qt.$$.fragment,a),E(Zt.$$.fragment,a),E(ea.$$.fragment,a),E(ta.$$.fragment,a),E(He.$$.fragment,a),E(aa.$$.fragment,a),E(na.$$.fragment,a),E(oa.$$.fragment,a),E(la.$$.fragment,a),ns=!1},d(a){t(w),a&&t(Y),a&&t(D),k(M),a&&t(x),a&&t(q),a&&t(On),a&&t(j),a&&t(In),a&&t(ke),a&&t(Mn),a&&t(y),a&&t(xn),a&&t(L),a&&t(Fn),a&&t(ae),k(ot),a&&t(jn),a&&t(De),a&&t(Nn),a&&t(R),k(lt),k(ct),a&&t(Wn),a&&t(ne),k(mt),a&&t(zn),a&&t(se),k(pt),a&&t(Bn),a&&t(oe),k(_t),a&&t(Vn),a&&t(H),k(vt),a&&t(qn),a&&t(le),k(Et),a&&t(Rn),a&&t(G),k($t),k(Ct),a&&t(Hn),a&&t(J),k(Dt),k(St),a&&t(Un),a&&t(me),k(Pt),a&&t(Gn),a&&t(pe),k(It),a&&t(Jn),a&&t(ge),k(xt),a&&t(Yn),a&&t(p),k(Ft),k(Nt),k(Wt),k(zt),k(Bt),k(Vt),k(Rt),k(Ht),k(Ut),k(Gt),k(Jt),k(Yt),k(Xt),k(Kt),a&&t(Xn),a&&t(Ve),a&&t(Kn),k(Qt,a),a&&t(Qn),a&&t(qe),a&&t(Zn),k(Zt,a),a&&t(es),a&&t(_e),k(ea),a&&t(ts),a&&t(I),k(ta),k(He),k(aa),k(na),a&&t(as),a&&t(ve),k(oa),a&&t(rs),a&&t(be),k(la)}}}const hp={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 mp(hr,w,Y){let{fw:D}=w;return hr.$$set=P=>{"fw"in P&&Y(0,D=P.fw)},[D]}class bp extends np{constructor(w){super();sp(this,w,mp,fp,op,{fw:0})}}export{bp as default,hp as metadata};
