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