import{S as r4,i as a4,s as o4,w as _,x as b,y as E,q as g,o as u,B as T,F as l4,e as o,t,k as c,c as n,a as s,h as r,d as a,m as d,b as i,g as m,G as e,j as i4,H as c4,I as d4,J as f4,M as m4,v as h4,L as n4}from"../../chunks/vendor-hf-doc-builder.js";import{T as s4}from"../../chunks/Tip-hf-doc-builder.js";import{D as M}from"../../chunks/Docstring-hf-doc-builder.js";import{C as fc}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Pl}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as t4}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function p4(j){let h,L,v,k,w;const p=j[1].default,$=l4(p,j,j[2],null);return{c(){h=o("p"),L=t("Deprecated in "),v=t(j[0]),k=c(),$&&$.c(),this.h()},l(A){h=n(A,"P",{class:!0});var O=s(h);L=r(O,"Deprecated in "),v=r(O,j[0]),O.forEach(a),k=d(A),$&&$.l(A),this.h()},h(){i(h,"class","font-medium")},m(A,O){m(A,h,O),e(h,L),e(h,v),m(A,k,O),$&&$.m(A,O),w=!0},p(A,O){(!w||O&1)&&i4(v,A[0]),$&&$.p&&(!w||O&4)&&c4($,p,A,A[2],w?f4(p,A[2],O,null):d4(A[2]),null)},i(A){w||(g($,A),w=!0)},o(A){u($,A),w=!1},d(A){A&&a(h),A&&a(k),$&&$.d(A)}}}function g4(j){let h,L;return h=new s4({props:{warning:!0,$$slots:{default:[p4]},$$scope:{ctx:j}}}),{c(){_(h.$$.fragment)},l(v){b(h.$$.fragment,v)},m(v,k){E(h,v,k),L=!0},p(v,[k]){const w={};k&5&&(w.$$scope={dirty:k,ctx:v}),h.$set(w)},i(v){L||(g(h.$$.fragment,v),L=!0)},o(v){u(h.$$.fragment,v),L=!1},d(v){T(h,v)}}}function u4(j,h,L){let{$$slots:v={},$$scope:k}=h,{version:w}=h;return j.$$set=p=>{"version"in p&&L(0,w=p.version),"$$scope"in p&&L(2,k=p.$$scope)},[w,v,k]}class v4 extends r4{constructor(h){super();a4(this,h,u4,g4,o4,{version:0})}}function _4(j){let h,L,v,k,w,p,$,A;return{c(){h=o("p"),L=t("Setting "),v=o("code"),k=t("WANDB_LOG_MODEL"),w=t(" as "),p=o("code"),$=t("bool"),A=t(" will be deprecated in version 5 of \u{1F917} Transformers.")},l(O){h=n(O,"P",{});var S=s(h);L=r(S,"Setting "),v=n(S,"CODE",{});var Z=s(v);k=r(Z,"WANDB_LOG_MODEL"),Z.forEach(a),w=r(S," as "),p=n(S,"CODE",{});var We=s(p);$=r(We,"bool"),We.forEach(a),A=r(S," will be deprecated in version 5 of \u{1F917} Transformers."),S.forEach(a)},m(O,S){m(O,h,S),e(h,L),e(h,v),e(v,k),e(h,w),e(h,p),e(p,$),e(h,A)},d(O){O&&a(h)}}}function b4(j){let h,L,v,k,w;return k=new fc({props:{code:"JTIzJTIwTm90ZSUzQSUyMFRoaXMlMjBleGFtcGxlJTIwc2tpcHMlMjBvdmVyJTIwc29tZSUyMHNldHVwJTIwc3RlcHMlMjBmb3IlMjBicmV2aXR5LiUwQWZyb20lMjBmbHl0ZWtpdCUyMGltcG9ydCUyMGN1cnJlbnRfY29udGV4dCUyQyUyMHRhc2slMEElMEElMEElNDB0YXNrJTBBZGVmJTIwdHJhaW5faGZfdHJhbnNmb3JtZXIoKSUzQSUwQSUyMCUyMCUyMCUyMGNwJTIwJTNEJTIwY3VycmVudF9jb250ZXh0KCkuY2hlY2twb2ludCUwQSUyMCUyMCUyMCUyMHRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKC4uLiUyQyUyMGNhbGxiYWNrcyUzRCU1QkZseXRlQ2FsbGJhY2soKSU1RCklMEElMjAlMjAlMjAlMjBvdXRwdXQlMjAlM0QlMjB0cmFpbmVyLnRyYWluKHJlc3VtZV9mcm9tX2NoZWNrcG9pbnQlM0RjcC5yZXN0b3JlKCkp",highlighted:`<span class="hljs-comment"># Note: This example skips over some setup steps for brevity.</span>
<span class="hljs-keyword">from</span> flytekit <span class="hljs-keyword">import</span> current_context, task


<span class="hljs-meta">@task</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">train_hf_transformer</span>():
    cp = current_context().checkpoint
    trainer = Trainer(..., callbacks=[FlyteCallback()])
    output = trainer.train(resume_from_checkpoint=cp.restore())`}}),{c(){h=o("p"),L=t("Example:"),v=c(),_(k.$$.fragment)},l(p){h=n(p,"P",{});var $=s(h);L=r($,"Example:"),$.forEach(a),v=d(p),b(k.$$.fragment,p)},m(p,$){m(p,h,$),e(h,L),m(p,v,$),E(k,p,$),w=!0},p:n4,i(p){w||(g(k.$$.fragment,p),w=!0)},o(p){u(k.$$.fragment,p),w=!1},d(p){p&&a(h),p&&a(v),T(k,p)}}}function E4(j){let h,L,v,k,w;return k=new fc({props:{code:"Y2xhc3MlMjBQcmludGVyQ2FsbGJhY2soVHJhaW5lckNhbGxiYWNrKSUzQSUwQSUyMCUyMCUyMCUyMGRlZiUyMG9uX2xvZyhzZWxmJTJDJTIwYXJncyUyQyUyMHN0YXRlJTJDJTIwY29udHJvbCUyQyUyMGxvZ3MlM0ROb25lJTJDJTIwKiprd2FyZ3MpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwXyUyMCUzRCUyMGxvZ3MucG9wKCUyMnRvdGFsX2Zsb3MlMjIlMkMlMjBOb25lKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGlmJTIwc3RhdGUuaXNfbG9jYWxfcHJvY2Vzc196ZXJvJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcHJpbnQobG9ncyk=",highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">PrinterCallback</span>(<span class="hljs-title class_ inherited__">TrainerCallback</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">on_log</span>(<span class="hljs-params">self, args, state, control, logs=<span class="hljs-literal">None</span>, **kwargs</span>):
        _ = logs.pop(<span class="hljs-string">&quot;total_flos&quot;</span>, <span class="hljs-literal">None</span>)
        <span class="hljs-keyword">if</span> state.is_local_process_zero:
            <span class="hljs-built_in">print</span>(logs)`}}),{c(){h=o("p"),L=t("Example:"),v=c(),_(k.$$.fragment)},l(p){h=n(p,"P",{});var $=s(h);L=r($,"Example:"),$.forEach(a),v=d(p),b(k.$$.fragment,p)},m(p,$){m(p,h,$),e(h,L),m(p,v,$),E(k,p,$),w=!0},p:n4,i(p){w||(g(k.$$.fragment,p),w=!0)},o(p){u(k.$$.fragment,p),w=!1},d(p){p&&a(h),p&&a(v),T(k,p)}}}function T4(j){let h,L,v,k,w,p,$,A;return{c(){h=o("p"),L=t(`In all this class, one step is to be understood as one update step. When using gradient accumulation, one update
step may require several forward and backward passes: if you use `),v=o("code"),k=t("gradient_accumulation_steps=n"),w=t(`, then one update
step requires going through `),p=o("em"),$=t("n"),A=t(" batches.")},l(O){h=n(O,"P",{});var S=s(h);L=r(S,`In all this class, one step is to be understood as one update step. When using gradient accumulation, one update
step may require several forward and backward passes: if you use `),v=n(S,"CODE",{});var Z=s(v);k=r(Z,"gradient_accumulation_steps=n"),Z.forEach(a),w=r(S,`, then one update
step requires going through `),p=n(S,"EM",{});var We=s(p);$=r(We,"n"),We.forEach(a),A=r(S," batches."),S.forEach(a)},m(O,S){m(O,h,S),e(h,L),e(h,v),e(v,k),e(h,w),e(h,p),e(p,$),e(h,A)},d(O){O&&a(h)}}}function k4(j){let h,L,v,k,w,p,$,A,O,S,Z,We,Ia,mc,hc,Rl,le,pc,Oa,gc,uc,xa,vc,_c,Na,bc,Ec,Gl,pt,Tc,Sa,kc,Cc,Bl,D,Fa,ja,$c,wc,yc,Ne,Ja,Mc,Ac,Ua,Lc,Dc,Wa,Ic,Oc,xc,Pa,Ra,Nc,Sc,Fc,gt,Ga,jc,Jc,ar,Uc,Wc,Pc,ut,Ba,Rc,Gc,or,Bc,zc,Yc,vt,za,Hc,Vc,nr,Xc,Zc,Qc,_t,Ya,Kc,qc,sr,ed,td,rd,bt,Ha,ad,od,lr,nd,sd,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qs,Vu,Xu,Ks,Zu,Qu,qs,Ku,qu,el,ev,tv,li,Le,Kr,rv,et,av,To,ov,nv,qr,sv,lv,iv,Mt,ii,tt,At,tl,ea,cv,rl,dv,ci,C,ta,fv,al,mv,hv,ra,pv,ol,gv,uv,vv,H,_v,nl,bv,Ev,sl,Tv,kv,ll,Cv,$v,il,wv,yv,cl,Mv,Av,Lv,Lt,Dv,Dt,aa,Iv,dl,Ov,xv,It,oa,Nv,fl,Sv,Fv,Ot,na,jv,ml,Jv,Uv,xt,sa,Wv,la,Pv,ko,Rv,Gv,Bv,Nt,ia,zv,hl,Yv,Hv,St,ca,Vv,pl,Xv,Zv,Ft,da,Qv,gl,Kv,qv,jt,fa,e_,ul,t_,r_,Jt,ma,a_,vl,o_,n_,Ut,ha,s_,_l,l_,i_,Wt,pa,c_,bl,d_,f_,Pt,ga,m_,El,h_,p_,Rt,ua,g_,Tl,u_,di,Gt,v_,Co,__,b_,fi,va,mi,Bt,E_,kl,T_,k_,hi,_a,pi,rt,zt,Cl,ba,C_,$l,$_,gi,V,Ea,w_,at,y_,$o,M_,A_,wo,L_,D_,I_,Yt,O_,Ht,Ta,x_,ka,N_,wl,S_,F_,j_,Vt,Ca,J_,$a,U_,yl,W_,P_,ui,ot,Xt,Ml,wa,R_,Al,G_,vi,nt,ya,B_,st,z_,yo,Y_,H_,Mo,V_,X_,_i;return p=new Pl({}),mr=new Pl({}),hr=new M({props:{name:"class transformers.integrations.CometCallback",anchor:"transformers.integrations.CometCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L826"}}),gr=new M({props:{name:"setup",anchor:"transformers.integrations.CometCallback.setup",parameters:[{name:"args",val:""},{name:"state",val:""},{name:"model",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L837"}}),_r=new M({props:{name:"class transformers.DefaultFlowCallback",anchor:"transformers.DefaultFlowCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L424"}}),Er=new M({props:{name:"class transformers.PrinterCallback",anchor:"transformers.PrinterCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L524"}}),kr=new M({props:{name:"class transformers.ProgressCallback",anchor:"transformers.ProgressCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L474"}}),$r=new M({props:{name:"class transformers.EarlyStoppingCallback",anchor:"transformers.EarlyStoppingCallback",parameters:[{name:"early_stopping_patience",val:": int = 1"},{name:"early_stopping_threshold",val:": typing.Optional[float] = 0.0"}],parametersDescription:[{anchor:"transformers.EarlyStoppingCallback.early_stopping_patience",description:`<strong>early_stopping_patience</strong> (<code>int</code>) &#x2014;
Use with <code>metric_for_best_model</code> to stop training when the specified metric worsens for
<code>early_stopping_patience</code> evaluation calls.`,name:"early_stopping_patience"},{anchor:"transformers.EarlyStoppingCallback.early_stopping_threshold(float,",description:`<strong>early_stopping_threshold(<code>float</code>,</strong> <em>optional</em>) &#x2014;
Use with TrainingArguments <code>metric_for_best_model</code> and <code>early_stopping_patience</code> to denote how much the
specified metric must improve to satisfy early stopping conditions. \``,name:"early_stopping_threshold(float,"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L535"}}),yr=new M({props:{name:"class transformers.integrations.TensorBoardCallback",anchor:"transformers.integrations.TensorBoardCallback",parameters:[{name:"tb_writer",val:" = None"}],parametersDescription:[{anchor:"transformers.integrations.TensorBoardCallback.tb_writer",description:`<strong>tb_writer</strong> (<code>SummaryWriter</code>, <em>optional</em>) &#x2014;
The writer to use. Will instantiate one if not set.`,name:"tb_writer"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L573"}}),Ar=new M({props:{name:"class transformers.integrations.WandbCallback",anchor:"transformers.integrations.WandbCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L659"}}),Dr=new M({props:{name:"setup",anchor:"transformers.integrations.WandbCallback.setup",parameters:[{name:"args",val:""},{name:"state",val:""},{name:"model",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L684"}}),yt=new v4({props:{version:"5.0",$$slots:{default:[_4]},$$scope:{ctx:j}}}),Sr=new M({props:{name:"class transformers.integrations.MLflowCallback",anchor:"transformers.integrations.MLflowCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L926"}}),jr=new M({props:{name:"setup",anchor:"transformers.integrations.MLflowCallback.setup",parameters:[{name:"args",val:""},{name:"state",val:""},{name:"model",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L945"}}),Jr=new M({props:{name:"class transformers.integrations.AzureMLCallback",anchor:"transformers.integrations.AzureMLCallback",parameters:[{name:"azureml_run",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L903"}}),Wr=new M({props:{name:"class transformers.integrations.CodeCarbonCallback",anchor:"transformers.integrations.CodeCarbonCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L1388"}}),Rr=new M({props:{name:"class transformers.integrations.NeptuneCallback",anchor:"transformers.integrations.NeptuneCallback",parameters:[{name:"api_token",val:": typing.Optional[str] = None"},{name:"project",val:": typing.Optional[str] = None"},{name:"name",val:": typing.Optional[str] = None"},{name:"base_namespace",val:": str = 'finetuning'"},{name:"run",val:" = None"},{name:"log_parameters",val:": bool = True"},{name:"log_checkpoints",val:": typing.Optional[str] = None"},{name:"**neptune_run_kwargs",val:""}],parametersDescription:[{anchor:"transformers.integrations.NeptuneCallback.api_token",description:`<strong>api_token</strong> (<code>str</code>, <em>optional</em>) &#x2014; Neptune API token obtained upon registration.
You can leave this argument out if you have saved your token to the <code>NEPTUNE_API_TOKEN</code> environment
variable (strongly recommended). See full setup instructions in the
<a href="https://docs.neptune.ai/setup/installation" rel="nofollow">docs</a>.`,name:"api_token"},{anchor:"transformers.integrations.NeptuneCallback.project",description:`<strong>project</strong> (<code>str</code>, <em>optional</em>) &#x2014; Name of an existing Neptune project, in the form &#x201C;workspace-name/project-name&#x201D;.
You can find and copy the name in Neptune from the project settings -&gt; Properties. If None (default), the
value of the <code>NEPTUNE_PROJECT</code> environment variable is used.`,name:"project"},{anchor:"transformers.integrations.NeptuneCallback.name",description:"<strong>name</strong> (<code>str</code>, <em>optional</em>) &#x2014; Custom name for the run.",name:"name"},{anchor:"transformers.integrations.NeptuneCallback.base_namespace",description:`<strong>base_namespace</strong> (<code>str</code>, optional, defaults to &#x201C;finetuning&#x201D;) &#x2014; In the Neptune run, the root namespace
that will contain all of the metadata logged by the callback.`,name:"base_namespace"},{anchor:"transformers.integrations.NeptuneCallback.log_parameters",description:`<strong>log_parameters</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
If True, logs all Trainer arguments and model parameters provided by the Trainer.`,name:"log_parameters"},{anchor:"transformers.integrations.NeptuneCallback.log_checkpoints",description:`<strong>log_checkpoints</strong> (<code>str</code>, <em>optional</em>) &#x2014; If &#x201C;same&#x201D;, uploads checkpoints whenever they are saved by the Trainer.
If &#x201C;last&#x201D;, uploads only the most recently saved checkpoint. If &#x201C;best&#x201D;, uploads the best checkpoint (among
the ones saved by the Trainer). If <code>None</code>, does not upload checkpoints.`,name:"log_checkpoints"},{anchor:"transformers.integrations.NeptuneCallback.run",description:`<strong>run</strong> (<code>Run</code>, <em>optional</em>) &#x2014; Pass a Neptune run object if you want to continue logging to an existing run.
Read more about resuming runs in the <a href="https://docs.neptune.ai/logging/to_existing_object" rel="nofollow">docs</a>.`,name:"run"},{anchor:"transformers.integrations.NeptuneCallback.*neptune_run_kwargs",description:`*<strong>*neptune_run_kwargs</strong> (<em>optional</em>) &#x2014;
Additional keyword arguments to be passed directly to the
<a href="https://docs.neptune.ai/api/neptune#init_run" rel="nofollow"><code>neptune.init_run()</code></a> function when a new run is created.`,name:"*neptune_run_kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L1121"}}),Hr=new M({props:{name:"class transformers.integrations.ClearMLCallback",anchor:"transformers.integrations.ClearMLCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L1417"}}),Xr=new M({props:{name:"class transformers.integrations.DagsHubCallback",anchor:"transformers.integrations.DagsHubCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L1061"}}),Qr=new M({props:{name:"setup",anchor:"transformers.integrations.DagsHubCallback.setup",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L1075"}}),Kr=new M({props:{name:"class transformers.integrations.FlyteCallback",anchor:"transformers.integrations.FlyteCallback",parameters:[{name:"save_log_history",val:": bool = True"},{name:"sync_checkpoints",val:": bool = True"}],parametersDescription:[{anchor:"transformers.integrations.FlyteCallback.save_log_history",description:`<strong>save_log_history</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
When set to True, the training logs are saved as a Flyte Deck.`,name:"save_log_history"},{anchor:"transformers.integrations.FlyteCallback.sync_checkpoints",description:`<strong>sync_checkpoints</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
When set to True, checkpoints are synced with Flyte and can be used to resume training in the case of an
interruption.`,name:"sync_checkpoints"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/integrations.py#L1536"}}),Mt=new t4({props:{anchor:"transformers.integrations.FlyteCallback.example",$$slots:{default:[b4]},$$scope:{ctx:j}}}),ea=new Pl({}),ta=new M({props:{name:"class transformers.TrainerCallback",anchor:"transformers.TrainerCallback",parameters:[],parametersDescription:[{anchor:"transformers.TrainerCallback.args",description:`<strong>args</strong> (<a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>) &#x2014;
The training arguments used to instantiate the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>.`,name:"args"},{anchor:"transformers.TrainerCallback.state",description:`<strong>state</strong> (<a href="/docs/transformers/v4.32.0/en/main_classes/callback#transformers.TrainerState">TrainerState</a>) &#x2014;
The current state of the <a href="/docs/transformers/v4.32.0/en/main_classes/trainer#transformers.Trainer">Trainer</a>.`,name:"state"},{anchor:"transformers.TrainerCallback.control",description:`<strong>control</strong> (<a href="/docs/transformers/v4.32.0/en/main_classes/callback#transformers.TrainerControl">TrainerControl</a>) &#x2014;
The object that is returned to the <a href="/docs/transformers/v4.32.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.32.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.32.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.32.0/src/transformers/trainer_callback.py#L168"}}),Lt=new t4({props:{anchor:"transformers.TrainerCallback.example",$$slots:{default:[E4]},$$scope:{ctx:j}}}),aa=new M({props:{name:"on_epoch_begin",anchor:"transformers.TrainerCallback.on_epoch_begin",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L236"}}),oa=new M({props:{name:"on_epoch_end",anchor:"transformers.TrainerCallback.on_epoch_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L242"}}),na=new M({props:{name:"on_evaluate",anchor:"transformers.TrainerCallback.on_evaluate",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L268"}}),sa=new M({props:{name:"on_init_end",anchor:"transformers.TrainerCallback.on_init_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L218"}}),ia=new M({props:{name:"on_log",anchor:"transformers.TrainerCallback.on_log",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L286"}}),ca=new M({props:{name:"on_predict",anchor:"transformers.TrainerCallback.on_predict",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"metrics",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L274"}}),da=new M({props:{name:"on_prediction_step",anchor:"transformers.TrainerCallback.on_prediction_step",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L292"}}),fa=new M({props:{name:"on_save",anchor:"transformers.TrainerCallback.on_save",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L280"}}),ma=new M({props:{name:"on_step_begin",anchor:"transformers.TrainerCallback.on_step_begin",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L248"}}),ha=new M({props:{name:"on_step_end",anchor:"transformers.TrainerCallback.on_step_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L261"}}),pa=new M({props:{name:"on_substep_end",anchor:"transformers.TrainerCallback.on_substep_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L255"}}),ga=new M({props:{name:"on_train_begin",anchor:"transformers.TrainerCallback.on_train_begin",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L224"}}),ua=new M({props:{name:"on_train_end",anchor:"transformers.TrainerCallback.on_train_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/trainer_callback.py#L230"}}),va=new fc({props:{code:"Y2xhc3MlMjBNeUNhbGxiYWNrKFRyYWluZXJDYWxsYmFjayklM0ElMEElMjAlMjAlMjAlMjAlMjJBJTIwY2FsbGJhY2slMjB0aGF0JTIwcHJpbnRzJTIwYSUyMG1lc3NhZ2UlMjBhdCUyMHRoZSUyMGJlZ2lubmluZyUyMG9mJTIwdHJhaW5pbmclMjIlMEElMEElMjAlMjAlMjAlMjBkZWYlMjBvbl90cmFpbl9iZWdpbihzZWxmJTJDJTIwYXJncyUyQyUyMHN0YXRlJTJDJTIwY29udHJvbCUyQyUyMCoqa3dhcmdzKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByaW50KCUyMlN0YXJ0aW5nJTIwdHJhaW5pbmclMjIpJTBBJTBBJTBBdHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTJDJTBBJTIwJTIwJTIwJTIwdHJhaW5fZGF0YXNldCUzRHRyYWluX2RhdGFzZXQlMkMlMEElMjAlMjAlMjAlMjBldmFsX2RhdGFzZXQlM0RldmFsX2RhdGFzZXQlMkMlMEElMjAlMjAlMjAlMjBjYWxsYmFja3MlM0QlNUJNeUNhbGxiYWNrJTVEJTJDJTIwJTIwJTIzJTIwV2UlMjBjYW4lMjBlaXRoZXIlMjBwYXNzJTIwdGhlJTIwY2FsbGJhY2slMjBjbGFzcyUyMHRoaXMlMjB3YXklMjBvciUyMGFuJTIwaW5zdGFuY2UlMjBvZiUyMGl0JTIwKE15Q2FsbGJhY2soKSklMEEp",highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">MyCallback</span>(<span class="hljs-title class_ inherited__">TrainerCallback</span>):
    <span class="hljs-string">&quot;A callback that prints a message at the beginning of training&quot;</span>

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


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