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