import{s as _o,c as Co,u as ko,g as wo,d as yo,o as Mo,n as Ja}from"../chunks/scheduler.9bc65507.js";import{S as vo,i as To,r as f,u as g,v as h,d,t as p,w as u,g as s,m as ho,s as r,h as o,j as T,n as uo,f as n,c as a,k as $,a as i,y as t,o as xo,A as Lo,x as c}from"../chunks/index.707bf1b6.js";import{T as $o}from"../chunks/Tip.c2ecdbf4.js";import{D as w}from"../chunks/Docstring.17db21ae.js";import{C as Ha}from"../chunks/CodeBlock.54a9f38d.js";import{E as bo}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{H as Hr}from"../chunks/Heading.342b1fa6.js";function jo(j){let m,x,b,C,y;const _=j[1].default,M=Co(_,j,j[2],null);return{c(){m=s("p"),x=ho("Deprecated in "),b=ho(j[0]),C=r(),M&&M.c(),this.h()},l(L){m=o(L,"P",{class:!0});var I=T(m);x=uo(I,"Deprecated in "),b=uo(I,j[0]),I.forEach(n),C=a(L),M&&M.l(L),this.h()},h(){$(m,"class","font-medium")},m(L,I){i(L,m,I),t(m,x),t(m,b),i(L,C,I),M&&M.m(L,I),y=!0},p(L,I){(!y||I&1)&&xo(b,L[0]),M&&M.p&&(!y||I&4)&&ko(M,_,L,L[2],y?yo(_,L[2],I,null):wo(L[2]),null)},i(L){y||(d(M,L),y=!0)},o(L){p(M,L),y=!1},d(L){L&&(n(m),n(C)),M&&M.d(L)}}}function Io(j){let m,x;return m=new $o({props:{warning:!0,$$slots:{default:[jo]},$$scope:{ctx:j}}}),{c(){f(m.$$.fragment)},l(b){g(m.$$.fragment,b)},m(b,C){h(m,b,C),x=!0},p(b,[C]){const y={};C&5&&(y.$$scope={dirty:C,ctx:b}),m.$set(y)},i(b){x||(d(m.$$.fragment,b),x=!0)},o(b){p(m.$$.fragment,b),x=!1},d(b){u(m,b)}}}function Eo(j,m,x){let{$$slots:b={},$$scope:C}=m,{version:y}=m;return j.$$set=_=>{"version"in _&&x(0,y=_.version),"$$scope"in _&&x(2,C=_.$$scope)},[y,b,C]}class Ho extends vo{constructor(m){super(),To(this,m,Eo,Io,_o,{version:0})}}function Jo(j){let m,x="Setting <code>WANDB_LOG_MODEL</code> as <code>bool</code> will be deprecated in version 5 of 🤗 Transformers.";return{c(){m=s("p"),m.innerHTML=x},l(b){m=o(b,"P",{"data-svelte-h":!0}),c(m)!=="svelte-fxlq1n"&&(m.innerHTML=x)},m(b,C){i(b,m,C)},p:Ja,d(b){b&&n(m)}}}function Uo(j){let m,x="Example:",b,C,y;return C=new Ha({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())`,wrap:!1}}),{c(){m=s("p"),m.textContent=x,b=r(),f(C.$$.fragment)},l(_){m=o(_,"P",{"data-svelte-h":!0}),c(m)!=="svelte-11lpom8"&&(m.textContent=x),b=a(_),g(C.$$.fragment,_)},m(_,M){i(_,m,M),i(_,b,M),h(C,_,M),y=!0},p:Ja,i(_){y||(d(C.$$.fragment,_),y=!0)},o(_){p(C.$$.fragment,_),y=!1},d(_){_&&(n(m),n(b)),u(C,_)}}}function Ao(j){let m,x="Example:",b,C,y;return C=new Ha({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)`,wrap:!1}}),{c(){m=s("p"),m.textContent=x,b=r(),f(C.$$.fragment)},l(_){m=o(_,"P",{"data-svelte-h":!0}),c(m)!=="svelte-11lpom8"&&(m.textContent=x),b=a(_),g(C.$$.fragment,_)},m(_,M){i(_,m,M),i(_,b,M),h(C,_,M),y=!0},p:Ja,i(_){y||(d(C.$$.fragment,_),y=!0)},o(_){p(C.$$.fragment,_),y=!1},d(_){_&&(n(m),n(b)),u(C,_)}}}function Do(j){let m,x=`In all this class, one step is to be understood as one update step. When using gradient accumulation, one update
step may require several forward and backward passes: if you use <code>gradient_accumulation_steps=n</code>, then one update
step requires going through <em>n</em> batches.`;return{c(){m=s("p"),m.innerHTML=x},l(b){m=o(b,"P",{"data-svelte-h":!0}),c(m)!=="svelte-rhwh6p"&&(m.innerHTML=x)},m(b,C){i(b,m,C)},p:Ja,d(b){b&&n(m)}}}function No(j){let m,x,b,C,y,_,M,L=`コールバックは、PyTorch のトレーニング ループの動作をカスタマイズできるオブジェクトです。
トレーニング ループを検査できる <a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a> (この機能は TensorFlow にはまだ実装されていません)
状態を確認し (進捗レポート、TensorBoard または他の ML プラットフォームへのログ記録など)、決定を下します (初期段階など)。
停止中）。`,I,ye,ss=`コールバックは、返される <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerControl">TrainerControl</a> オブジェクトを除けば、「読み取り専用」のコード部分です。
トレーニング ループ内では何も変更できません。トレーニング ループの変更が必要なカスタマイズの場合は、次のことを行う必要があります。
<a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a> をサブクラス化し、必要なメソッドをオーバーライドします (例については、<a href="trainer">trainer</a> を参照してください)。`,Jr,Me,os='デフォルトでは、<code>TrainingArguments.report_to</code> は <code>&quot;all&quot;</code> に設定されているため、<a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a> は次のコールバックを使用します。',Ur,xe,ls=`<li><a href="/docs/transformers/main/ja/main_classes/callback#transformers.DefaultFlowCallback">DefaultFlowCallback</a> は、ログ記録、保存、評価のデフォルトの動作を処理します。</li> <li><a href="/docs/transformers/main/ja/main_classes/callback#transformers.PrinterCallback">PrinterCallback</a> または <a href="/docs/transformers/main/ja/main_classes/callback#transformers.ProgressCallback">ProgressCallback</a> で進行状況を表示し、
ログ (最初のログは、<a href="/docs/transformers/main/ja/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a> を通じて tqdm を非アクティブ化する場合に使用され、そうでない場合に使用されます)
2番目です)。</li> <li><a href="/docs/transformers/main/ja/main_classes/callback#transformers.integrations.TensorBoardCallback">TensorBoardCallback</a> (PyTorch &gt;= 1.4 を介して) tensorboard にアクセスできる場合
またはテンソルボードX）。</li> <li><a href="/docs/transformers/main/ja/main_classes/callback#transformers.integrations.WandbCallback">WandbCallback</a> <a href="https://www.wandb.com/" rel="nofollow">wandb</a> がインストールされている場合。</li> <li><a href="/docs/transformers/main/ja/main_classes/callback#transformers.integrations.CometCallback">CometCallback</a> <a href="https://www.comet.ml/site/" rel="nofollow">comet_ml</a> がインストールされている場合。</li> <li><a href="https://www.mlflow.org/" rel="nofollow">mlflow</a> がインストールされている場合は <a href="/docs/transformers/main/ja/main_classes/callback#transformers.integrations.MLflowCallback">MLflowCallback</a>。</li> <li><a href="/docs/transformers/main/ja/main_classes/callback#transformers.integrations.NeptuneCallback">NeptuneCallback</a> <a href="https://neptune.ai/" rel="nofollow">neptune</a> がインストールされている場合。</li> <li><a href="/docs/transformers/main/ja/main_classes/callback#transformers.integrations.AzureMLCallback">AzureMLCallback</a> <a href="https://pypi.org/project/azureml-sdk/" rel="nofollow">azureml-sdk</a> の場合
インストールされています。</li> <li><a href="/docs/transformers/main/ja/main_classes/callback#transformers.integrations.CodeCarbonCallback">CodeCarbonCallback</a> <a href="https://pypi.org/project/codecarbon/" rel="nofollow">codecarbon</a> の場合
インストールされています。</li> <li><a href="/docs/transformers/main/ja/main_classes/callback#transformers.integrations.ClearMLCallback">ClearMLCallback</a> <a href="https://github.com/allegroai/clearml" rel="nofollow">clearml</a> がインストールされている場合。</li> <li><a href="/docs/transformers/main/ja/main_classes/callback#transformers.integrations.DagsHubCallback">DagsHubCallback</a> <a href="https://dagshub.com/" rel="nofollow">dagshub</a> がインストールされている場合。</li> <li><a href="/docs/transformers/main/ja/main_classes/callback#transformers.integrations.FlyteCallback">FlyteCallback</a> <a href="https://flyte.org/" rel="nofollow">flyte</a> がインストールされている場合。</li>`,Ar,Le,is="パッケージがインストールされているが、付随する統合を使用したくない場合は、<code>TrainingArguments.report_to</code> を、使用したい統合のみのリストに変更できます (例: <code>[&quot;azure_ml&quot;, &quot;wandb&quot;]</code>) 。",Dr,je,cs=`コールバックを実装するメインクラスは <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> です。それは、
<a href="/docs/transformers/main/ja/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a> は <a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a> をインスタンス化するために使用され、それにアクセスできます。
<a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerState">TrainerState</a> を介してトレーナーの内部状態を取得し、トレーニング ループ上でいくつかのアクションを実行できます。
<a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerControl">TrainerControl</a>。`,Nr,Ie,Fr,Ee,ms='ライブラリで利用可能な <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> のリストは次のとおりです。',Sr,F,He,Ua,wt,ds='A <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that sends the logs to <a href="https://www.comet.ml/site/" rel="nofollow">Comet ML</a>.',Aa,H,Je,Da,yt,ps="Setup the optional Comet.ml integration.",Na,Mt,fs="Environment:",Fa,xt,gs=`<li><strong>COMET_MODE</strong> (<code>str</code>, <em>optional</em>, defaults to <code>ONLINE</code>):
Whether to create an online, offline experiment or disable Comet logging. Can be <code>OFFLINE</code>, <code>ONLINE</code>, or
<code>DISABLED</code>.</li> <li><strong>COMET_PROJECT_NAME</strong> (<code>str</code>, <em>optional</em>):
Comet project name for experiments.</li> <li><strong>COMET_OFFLINE_DIRECTORY</strong> (<code>str</code>, <em>optional</em>):
Folder to use for saving offline experiments when <code>COMET_MODE</code> is <code>OFFLINE</code>.</li> <li><strong>COMET_LOG_ASSETS</strong> (<code>str</code>, <em>optional</em>, defaults to <code>TRUE</code>):
Whether or not to log training assets (tf event logs, checkpoints, etc), to Comet. Can be <code>TRUE</code>, or
<code>FALSE</code>.</li>`,Sa,Lt,hs=`For a number of configurable items in the environment, see
<a href="https://www.comet.ml/docs/python-sdk/advanced/#comet-configuration-variables" rel="nofollow">here</a>.`,Pr,O,Ue,Pa,jt,us='A <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that handles the default flow of the training loop for logs, evaluation and checkpoints.',Wr,V,Ae,Wa,It,bs='A bare <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that just prints the logs.',Br,X,De,Ba,Et,_s='A <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that displays the progress of training or evaluation.',zr,S,Ne,za,Ht,vs='A <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that handles early stopping.',Ra,Jt,Ts=`This callback depends on <a href="/docs/transformers/main/ja/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a> argument <em>load_best_model_at_end</em> functionality to set best_metric
in <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerState">TrainerState</a>. Note that if the <a href="/docs/transformers/main/ja/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a> argument <em>save_steps</em> differs from <em>eval_steps</em>, the
early stopping will not occur until the next save step.`,Rr,Z,Fe,Ga,Ut,$s='A <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that sends the logs to <a href="https://www.tensorflow.org/tensorboard" rel="nofollow">TensorBoard</a>.',Gr,P,Se,Ya,At,Cs='A <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that logs metrics, media, model checkpoints to <a href="https://www.wandb.com/" rel="nofollow">Weight and Biases</a>.',qa,J,Pe,Oa,Dt,ks="Setup the optional Weights &amp; Biases (<em>wandb</em>) integration.",Va,Nt,ws=`One can subclass and override this method to customize the setup if needed. Find more information
<a href="https://docs.wandb.ai/guides/integrations/huggingface" rel="nofollow">here</a>. You can also override the following environment
variables:`,Xa,Ft,ys="Environment:",Za,W,We,St,Ms=`<strong>WANDB_LOG_MODEL</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;false&quot;</code>):
Whether to log model and checkpoints during training. Can be <code>&quot;end&quot;</code>, <code>&quot;checkpoint&quot;</code> or <code>&quot;false&quot;</code>. If set
to <code>&quot;end&quot;</code>, the model will be uploaded at the end of training. If set to <code>&quot;checkpoint&quot;</code>, the checkpoint
will be uploaded every <code>args.save_steps</code> . If set to <code>&quot;false&quot;</code>, the model will not be uploaded. Use along
with <code>load_best_model_at_end()</code> to upload best model.`,Qa,re,Ka,Pt,xs=`<p><strong>WANDB_WATCH</strong> (<code>str</code>, <em>optional</em> defaults to <code>&quot;false&quot;</code>):
Can be <code>&quot;gradients&quot;</code>, <code>&quot;all&quot;</code>, <code>&quot;parameters&quot;</code>, or <code>&quot;false&quot;</code>. Set to <code>&quot;all&quot;</code> to log gradients and
parameters.</p>`,en,Wt,Ls=`<p><strong>WANDB_PROJECT</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;huggingface&quot;</code>):
Set this to a custom string to store results in a different project.</p>`,tn,Bt,js=`<p><strong>WANDB_DISABLED</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>):
Whether to disable wandb entirely. Set <code>WANDB_DISABLED=true</code> to disable.</p>`,Yr,B,Be,rn,zt,Is=`A <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that sends the logs to <a href="https://www.mlflow.org/" rel="nofollow">MLflow</a>. Can be disabled by setting
environment variable <code>DISABLE_MLFLOW_INTEGRATION = TRUE</code>.`,an,D,ze,nn,Rt,Es="Setup the optional MLflow integration.",sn,Gt,Hs="Environment:",on,Yt,Js=`<li><strong>HF_MLFLOW_LOG_ARTIFACTS</strong> (<code>str</code>, <em>optional</em>):
Whether to use MLflow <code>.log_artifact()</code> facility to log artifacts. This only makes sense if logging to a
remote server, e.g. s3 or GCS. If set to <code>True</code> or <em>1</em>, will copy each saved checkpoint on each save in
<a href="/docs/transformers/main/ja/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>’s <code>output_dir</code> to the local or remote artifact storage. Using it without a remote
storage will just copy the files to your artifact location.</li> <li><strong>MLFLOW_EXPERIMENT_NAME</strong> (<code>str</code>, <em>optional</em>, defaults to <code>None</code>):
Whether to use an MLflow experiment_name under which to launch the run. Default to <code>None</code> which will point
to the <code>Default</code> 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.</li> <li><strong>MLFLOW_TAGS</strong> (<code>str</code>, <em>optional</em>):
A string dump of a dictionary of key/value pair to be added to the MLflow run as tags. Example:
<code>os.environ[&#39;MLFLOW_TAGS&#39;]=&#39;{&quot;release.candidate&quot;: &quot;RC1&quot;, &quot;release.version&quot;: &quot;2.2.0&quot;}&#39;</code>.</li> <li><strong>MLFLOW_NESTED_RUN</strong> (<code>str</code>, <em>optional</em>):
Whether to use MLflow nested runs. If set to <code>True</code> or <em>1</em>, will create a nested run inside the current
run.</li> <li><strong>MLFLOW_RUN_ID</strong> (<code>str</code>, <em>optional</em>):
Allow to reattach to an existing run which can be usefull when resuming training from a checkpoint. When
<code>MLFLOW_RUN_ID</code> environment variable is set, <code>start_run</code> attempts to resume a run with the specified run ID
and other parameters are ignored.</li> <li><strong>MLFLOW_FLATTEN_PARAMS</strong> (<code>str</code>, <em>optional</em>, defaults to <code>False</code>):
Whether to flatten the parameters dictionary before logging.</li>`,qr,Q,Re,ln,qt,Us='A <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that sends the logs to <a href="https://pypi.org/project/azureml-sdk/" rel="nofollow">AzureML</a>.',Or,K,Ge,cn,Ot,As='A <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that tracks the CO2 emission of training.',Vr,z,Ye,mn,Vt,Ds='TrainerCallback that sends the logs to <a href="https://app.neptune.ai" rel="nofollow">Neptune</a>.',dn,Xt,Ns=`For instructions and examples, see the <a href="https://docs.neptune.ai/integrations/transformers" rel="nofollow">Transformers integration
guide</a> in the Neptune documentation.`,Xr,U,qe,pn,Zt,Fs='A <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that sends the logs to <a href="https://clear.ml/" rel="nofollow">ClearML</a>.',fn,Qt,Ss="Environment:",gn,Kt,Ps=`<li><strong>CLEARML_PROJECT</strong> (<code>str</code>, <em>optional</em>, defaults to <code>HuggingFace Transformers</code>):
ClearML project name.</li> <li><strong>CLEARML_TASK</strong> (<code>str</code>, <em>optional</em>, defaults to <code>Trainer</code>):
ClearML task name.</li> <li><strong>CLEARML_LOG_MODEL</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>):
Whether to log models as artifacts during training.</li>`,Zr,R,Oe,hn,er,Ws='A <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that logs to <a href="https://dagshub.com/" rel="nofollow">DagsHub</a>. Extends <code>MLflowCallback</code>',un,N,Ve,bn,tr,Bs="Setup the DagsHub’s Logging integration.",_n,rr,zs="Environment:",vn,ar,Rs=`<li><strong>HF_DAGSHUB_LOG_ARTIFACTS</strong> (<code>str</code>, <em>optional</em>):
Whether to save the data and model artifacts for the experiment. Default to <code>False</code>.</li>`,Qr,G,Xe,Tn,nr,Gs=`A <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> that sends the logs to <a href="https://flyte.org/" rel="nofollow">Flyte</a>.
NOTE: This callback only works within a Flyte task.`,$n,ae,Kr,Ze,ea,v,Qe,Cn,sr,Ys=`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:`,kn,or,qs=`The <code>control</code> 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.`,wn,lr,Os=`The argument <code>args</code>, <code>state</code> and <code>control</code> are positionals for all events, all the others are grouped in <code>kwargs</code>.
You can unpack the ones you need in the signature of the event using them. As an example, see the code of the
simple <code>~transformer.PrinterCallback</code>.`,yn,ne,Mn,se,Ke,xn,ir,Vs="Event called at the beginning of an epoch.",Ln,oe,et,jn,cr,Xs="Event called at the end of an epoch.",In,le,tt,En,mr,Zs="Event called after an evaluation phase.",Hn,ie,rt,Jn,dr,Qs='Event called at the end of the initialization of the <a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a>.',Un,ce,at,An,pr,Ks="Event called after logging the last logs.",Dn,me,nt,Nn,fr,eo="Event called after a successful prediction.",Fn,de,st,Sn,gr,to="Event called after a prediction step.",Pn,pe,ot,Wn,hr,ro="Event called after a checkpoint save.",Bn,fe,lt,zn,ur,ao=`Event called at the beginning of a training step. If using gradient accumulation, one training step might take
several inputs.`,Rn,ge,it,Gn,br,no=`Event called at the end of a training step. If using gradient accumulation, one training step might take
several inputs.`,Yn,he,ct,qn,_r,so="Event called at the end of an substep during gradient accumulation.",On,ue,mt,Vn,vr,oo="Event called at the beginning of training.",Xn,be,dt,Zn,Tr,lo="Event called at the end of training.",ta,pt,io='以下は、カスタム コールバックを PyTorch <a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a> に登録する方法の例です。',ra,ft,aa,gt,co="コールバックを登録する別の方法は、次のように <code>trainer.add_callback()</code> を呼び出すことです。",na,ht,sa,ut,oa,E,bt,Qn,$r,mo=`A class containing the <a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a> inner state that will be saved along the model and optimizer when checkpointing
and passed to the <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a>.`,Kn,_e,es,ve,_t,ts,Cr,po="Create an instance from the content of <code>json_path</code>.",rs,Te,vt,as,kr,fo="Save the content of this instance in JSON format inside <code>json_path</code>.",la,Tt,ia,ee,$t,ns,wr,go=`A class that handles the <a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a> control flow. This class is used by the <a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerCallback">TrainerCallback</a> to activate some
switches in the training loop.`,ca,Er,ma;return y=new Hr({props:{title:"コールバック数",local:"コールバック数",headingTag:"h1"}}),Ie=new Hr({props:{title:"利用可能なコールバック",local:"transformers.integrations.CometCallback",headingTag:"h2"}}),He=new w({props:{name:"class transformers.integrations.CometCallback",anchor:"transformers.integrations.CometCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/integrations/integration_utils.py#L829"}}),Je=new w({props:{name:"setup",anchor:"transformers.integrations.CometCallback.setup",parameters:[{name:"args",val:""},{name:"state",val:""},{name:"model",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/integrations/integration_utils.py#L840"}}),Ue=new w({props:{name:"class transformers.DefaultFlowCallback",anchor:"transformers.DefaultFlowCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L425"}}),Ae=new w({props:{name:"class transformers.PrinterCallback",anchor:"transformers.PrinterCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L525"}}),De=new w({props:{name:"class transformers.ProgressCallback",anchor:"transformers.ProgressCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L475"}}),Ne=new w({props:{name:"class transformers.EarlyStoppingCallback",anchor:"transformers.EarlyStoppingCallback",parameters:[{name:"early_stopping_patience",val:": int = 1"},{name:"early_stopping_threshold",val:": typing.Optional[float] = 0.0"}],parametersDescription:[{anchor:"transformers.EarlyStoppingCallback.early_stopping_patience",description:`<strong>early_stopping_patience</strong> (<code>int</code>) &#x2014;
Use with <code>metric_for_best_model</code> to stop training when the specified metric worsens for
<code>early_stopping_patience</code> evaluation calls.`,name:"early_stopping_patience"},{anchor:"transformers.EarlyStoppingCallback.early_stopping_threshold(float,",description:`<strong>early_stopping_threshold(<code>float</code>,</strong> <em>optional</em>) &#x2014;
Use with TrainingArguments <code>metric_for_best_model</code> and <code>early_stopping_patience</code> to denote how much the
specified metric must improve to satisfy early stopping conditions. \``,name:"early_stopping_threshold(float,"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L536"}}),Fe=new w({props:{name:"class transformers.integrations.TensorBoardCallback",anchor:"transformers.integrations.TensorBoardCallback",parameters:[{name:"tb_writer",val:" = None"}],parametersDescription:[{anchor:"transformers.integrations.TensorBoardCallback.tb_writer",description:`<strong>tb_writer</strong> (<code>SummaryWriter</code>, <em>optional</em>) &#x2014;
The writer to use. Will instantiate one if not set.`,name:"tb_writer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/integrations/integration_utils.py#L575"}}),Se=new w({props:{name:"class transformers.integrations.WandbCallback",anchor:"transformers.integrations.WandbCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/integrations/integration_utils.py#L661"}}),Pe=new w({props:{name:"setup",anchor:"transformers.integrations.WandbCallback.setup",parameters:[{name:"args",val:""},{name:"state",val:""},{name:"model",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/integrations/integration_utils.py#L686"}}),re=new Ho({props:{version:"5.0",$$slots:{default:[Jo]},$$scope:{ctx:j}}}),Be=new w({props:{name:"class transformers.integrations.MLflowCallback",anchor:"transformers.integrations.MLflowCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/integrations/integration_utils.py#L929"}}),ze=new w({props:{name:"setup",anchor:"transformers.integrations.MLflowCallback.setup",parameters:[{name:"args",val:""},{name:"state",val:""},{name:"model",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/integrations/integration_utils.py#L948"}}),Re=new w({props:{name:"class transformers.integrations.AzureMLCallback",anchor:"transformers.integrations.AzureMLCallback",parameters:[{name:"azureml_run",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/integrations/integration_utils.py#L906"}}),Ge=new w({props:{name:"class transformers.integrations.CodeCarbonCallback",anchor:"transformers.integrations.CodeCarbonCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/integrations/integration_utils.py#L1395"}}),Ye=new w({props:{name:"class transformers.integrations.NeptuneCallback",anchor:"transformers.integrations.NeptuneCallback",parameters:[{name:"api_token",val:": typing.Optional[str] = None"},{name:"project",val:": typing.Optional[str] = None"},{name:"name",val:": typing.Optional[str] = None"},{name:"base_namespace",val:": str = 'finetuning'"},{name:"run",val:" = 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/main/src/transformers/integrations/integration_utils.py#L1124"}}),qe=new w({props:{name:"class transformers.integrations.ClearMLCallback",anchor:"transformers.integrations.ClearMLCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/integrations/integration_utils.py#L1424"}}),Oe=new w({props:{name:"class transformers.integrations.DagsHubCallback",anchor:"transformers.integrations.DagsHubCallback",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/integrations/integration_utils.py#L1064"}}),Ve=new w({props:{name:"setup",anchor:"transformers.integrations.DagsHubCallback.setup",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/integrations/integration_utils.py#L1078"}}),Xe=new w({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/main/src/transformers/integrations/integration_utils.py#L1545"}}),ae=new bo({props:{anchor:"transformers.integrations.FlyteCallback.example",$$slots:{default:[Uo]},$$scope:{ctx:j}}}),Ze=new Hr({props:{title:"TrainerCallback",local:"transformers.TrainerCallback",headingTag:"h2"}}),Qe=new w({props:{name:"class transformers.TrainerCallback",anchor:"transformers.TrainerCallback",parameters:[],parametersDescription:[{anchor:"transformers.TrainerCallback.args",description:`<strong>args</strong> (<a href="/docs/transformers/main/ja/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>) &#x2014;
The training arguments used to instantiate the <a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a>.`,name:"args"},{anchor:"transformers.TrainerCallback.state",description:`<strong>state</strong> (<a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerState">TrainerState</a>) &#x2014;
The current state of the <a href="/docs/transformers/main/ja/main_classes/trainer#transformers.Trainer">Trainer</a>.`,name:"state"},{anchor:"transformers.TrainerCallback.control",description:`<strong>control</strong> (<a href="/docs/transformers/main/ja/main_classes/callback#transformers.TrainerControl">TrainerControl</a>) &#x2014;
The object that is returned to the <a href="/docs/transformers/main/ja/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/main/ja/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/main/ja/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/main/src/transformers/trainer_callback.py#L168"}}),ne=new bo({props:{anchor:"transformers.TrainerCallback.example",$$slots:{default:[Ao]},$$scope:{ctx:j}}}),Ke=new w({props:{name:"on_epoch_begin",anchor:"transformers.TrainerCallback.on_epoch_begin",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L237"}}),et=new w({props:{name:"on_epoch_end",anchor:"transformers.TrainerCallback.on_epoch_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L243"}}),tt=new w({props:{name:"on_evaluate",anchor:"transformers.TrainerCallback.on_evaluate",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L269"}}),rt=new w({props:{name:"on_init_end",anchor:"transformers.TrainerCallback.on_init_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L219"}}),at=new w({props:{name:"on_log",anchor:"transformers.TrainerCallback.on_log",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L287"}}),nt=new w({props:{name:"on_predict",anchor:"transformers.TrainerCallback.on_predict",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"metrics",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L275"}}),st=new w({props:{name:"on_prediction_step",anchor:"transformers.TrainerCallback.on_prediction_step",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L293"}}),ot=new w({props:{name:"on_save",anchor:"transformers.TrainerCallback.on_save",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L281"}}),lt=new w({props:{name:"on_step_begin",anchor:"transformers.TrainerCallback.on_step_begin",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L249"}}),it=new w({props:{name:"on_step_end",anchor:"transformers.TrainerCallback.on_step_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L262"}}),ct=new w({props:{name:"on_substep_end",anchor:"transformers.TrainerCallback.on_substep_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L256"}}),mt=new w({props:{name:"on_train_begin",anchor:"transformers.TrainerCallback.on_train_begin",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L225"}}),dt=new w({props:{name:"on_train_end",anchor:"transformers.TrainerCallback.on_train_end",parameters:[{name:"args",val:": TrainingArguments"},{name:"state",val:": TrainerState"},{name:"control",val:": TrainerControl"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L231"}}),ft=new Ha({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>
)`,wrap:!1}}),ht=new Ha({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())`,wrap:!1}}),ut=new Hr({props:{title:"TrainerState",local:"transformers.TrainerState",headingTag:"h2"}}),bt=new w({props:{name:"class transformers.TrainerState",anchor:"transformers.TrainerState",parameters:[{name:"epoch",val:": typing.Optional[float] = None"},{name:"global_step",val:": int = 0"},{name:"max_steps",val:": int = 0"},{name:"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/main/src/transformers/trainer_callback.py#L35"}}),_e=new $o({props:{$$slots:{default:[Do]},$$scope:{ctx:j}}}),_t=new w({props:{name:"load_from_json",anchor:"transformers.TrainerState.load_from_json",parameters:[{name:"json_path",val:": str"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L110"}}),vt=new w({props:{name:"save_to_json",anchor:"transformers.TrainerState.save_to_json",parameters:[{name:"json_path",val:": str"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L104"}}),Tt=new Hr({props:{title:"TrainerControl",local:"transformers.TrainerControl",headingTag:"h2"}}),$t=new w({props:{name:"class transformers.TrainerControl",anchor:"transformers.TrainerControl",parameters:[{name:"should_training_stop",val:": bool = False"},{name:"should_epoch_stop",val:": bool = False"},{name:"should_save",val:": bool = False"},{name:"should_evaluate",val:": bool = False"},{name:"should_log",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TrainerControl.should_training_stop",description:`<strong>should_training_stop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the training should be interrupted.</p>
<p>If <code>True</code>, this variable will not be set back to <code>False</code>. The training will just stop.`,name:"should_training_stop"},{anchor:"transformers.TrainerControl.should_epoch_stop",description:`<strong>should_epoch_stop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the current epoch should be interrupted.</p>
<p>If <code>True</code>, this variable will be set back to <code>False</code> at the beginning of the next epoch.`,name:"should_epoch_stop"},{anchor:"transformers.TrainerControl.should_save",description:`<strong>should_save</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should be saved at this step.</p>
<p>If <code>True</code>, this variable will be set back to <code>False</code> at the beginning of the next step.`,name:"should_save"},{anchor:"transformers.TrainerControl.should_evaluate",description:`<strong>should_evaluate</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should be evaluated at this step.</p>
<p>If <code>True</code>, this variable will be set back to <code>False</code> at the beginning of the next step.`,name:"should_evaluate"},{anchor:"transformers.TrainerControl.should_log",description:`<strong>should_log</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the logs should be reported at this step.</p>
<p>If <code>True</code>, this variable will be set back to <code>False</code> at the beginning of the next step.`,name:"should_log"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/trainer_callback.py#L119"}}),{c(){m=s("meta"),x=r(),b=s("p"),C=r(),f(y.$$.fragment),_=r(),M=s("p"),M.innerHTML=L,I=r(),ye=s("p"),ye.innerHTML=ss,Jr=r(),Me=s("p"),Me.innerHTML=os,Ur=r(),xe=s("ul"),xe.innerHTML=ls,Ar=r(),Le=s("p"),Le.innerHTML=is,Dr=r(),je=s("p"),je.innerHTML=cs,Nr=r(),f(Ie.$$.fragment),Fr=r(),Ee=s("p"),Ee.innerHTML=ms,Sr=r(),F=s("div"),f(He.$$.fragment),Ua=r(),wt=s("p"),wt.innerHTML=ds,Aa=r(),H=s("div"),f(Je.$$.fragment),Da=r(),yt=s("p"),yt.textContent=ps,Na=r(),Mt=s("p"),Mt.textContent=fs,Fa=r(),xt=s("ul"),xt.innerHTML=gs,Sa=r(),Lt=s("p"),Lt.innerHTML=hs,Pr=r(),O=s("div"),f(Ue.$$.fragment),Pa=r(),jt=s("p"),jt.innerHTML=us,Wr=r(),V=s("div"),f(Ae.$$.fragment),Wa=r(),It=s("p"),It.innerHTML=bs,Br=r(),X=s("div"),f(De.$$.fragment),Ba=r(),Et=s("p"),Et.innerHTML=_s,zr=r(),S=s("div"),f(Ne.$$.fragment),za=r(),Ht=s("p"),Ht.innerHTML=vs,Ra=r(),Jt=s("p"),Jt.innerHTML=Ts,Rr=r(),Z=s("div"),f(Fe.$$.fragment),Ga=r(),Ut=s("p"),Ut.innerHTML=$s,Gr=r(),P=s("div"),f(Se.$$.fragment),Ya=r(),At=s("p"),At.innerHTML=Cs,qa=r(),J=s("div"),f(Pe.$$.fragment),Oa=r(),Dt=s("p"),Dt.innerHTML=ks,Va=r(),Nt=s("p"),Nt.innerHTML=ws,Xa=r(),Ft=s("p"),Ft.textContent=ys,Za=r(),W=s("ul"),We=s("li"),St=s("p"),St.innerHTML=Ms,Qa=r(),f(re.$$.fragment),Ka=r(),Pt=s("li"),Pt.innerHTML=xs,en=r(),Wt=s("li"),Wt.innerHTML=Ls,tn=r(),Bt=s("li"),Bt.innerHTML=js,Yr=r(),B=s("div"),f(Be.$$.fragment),rn=r(),zt=s("p"),zt.innerHTML=Is,an=r(),D=s("div"),f(ze.$$.fragment),nn=r(),Rt=s("p"),Rt.textContent=Es,sn=r(),Gt=s("p"),Gt.textContent=Hs,on=r(),Yt=s("ul"),Yt.innerHTML=Js,qr=r(),Q=s("div"),f(Re.$$.fragment),ln=r(),qt=s("p"),qt.innerHTML=Us,Or=r(),K=s("div"),f(Ge.$$.fragment),cn=r(),Ot=s("p"),Ot.innerHTML=As,Vr=r(),z=s("div"),f(Ye.$$.fragment),mn=r(),Vt=s("p"),Vt.innerHTML=Ds,dn=r(),Xt=s("p"),Xt.innerHTML=Ns,Xr=r(),U=s("div"),f(qe.$$.fragment),pn=r(),Zt=s("p"),Zt.innerHTML=Fs,fn=r(),Qt=s("p"),Qt.textContent=Ss,gn=r(),Kt=s("ul"),Kt.innerHTML=Ps,Zr=r(),R=s("div"),f(Oe.$$.fragment),hn=r(),er=s("p"),er.innerHTML=Ws,un=r(),N=s("div"),f(Ve.$$.fragment),bn=r(),tr=s("p"),tr.textContent=Bs,_n=r(),rr=s("p"),rr.textContent=zs,vn=r(),ar=s("ul"),ar.innerHTML=Rs,Qr=r(),G=s("div"),f(Xe.$$.fragment),Tn=r(),nr=s("p"),nr.innerHTML=Gs,$n=r(),f(ae.$$.fragment),Kr=r(),f(Ze.$$.fragment),ea=r(),v=s("div"),f(Qe.$$.fragment),Cn=r(),sr=s("p"),sr.textContent=Ys,kn=r(),or=s("p"),or.innerHTML=qs,wn=r(),lr=s("p"),lr.innerHTML=Os,yn=r(),f(ne.$$.fragment),Mn=r(),se=s("div"),f(Ke.$$.fragment),xn=r(),ir=s("p"),ir.textContent=Vs,Ln=r(),oe=s("div"),f(et.$$.fragment),jn=r(),cr=s("p"),cr.textContent=Xs,In=r(),le=s("div"),f(tt.$$.fragment),En=r(),mr=s("p"),mr.textContent=Zs,Hn=r(),ie=s("div"),f(rt.$$.fragment),Jn=r(),dr=s("p"),dr.innerHTML=Qs,Un=r(),ce=s("div"),f(at.$$.fragment),An=r(),pr=s("p"),pr.textContent=Ks,Dn=r(),me=s("div"),f(nt.$$.fragment),Nn=r(),fr=s("p"),fr.textContent=eo,Fn=r(),de=s("div"),f(st.$$.fragment),Sn=r(),gr=s("p"),gr.textContent=to,Pn=r(),pe=s("div"),f(ot.$$.fragment),Wn=r(),hr=s("p"),hr.textContent=ro,Bn=r(),fe=s("div"),f(lt.$$.fragment),zn=r(),ur=s("p"),ur.textContent=ao,Rn=r(),ge=s("div"),f(it.$$.fragment),Gn=r(),br=s("p"),br.textContent=no,Yn=r(),he=s("div"),f(ct.$$.fragment),qn=r(),_r=s("p"),_r.textContent=so,On=r(),ue=s("div"),f(mt.$$.fragment),Vn=r(),vr=s("p"),vr.textContent=oo,Xn=r(),be=s("div"),f(dt.$$.fragment),Zn=r(),Tr=s("p"),Tr.textContent=lo,ta=r(),pt=s("p"),pt.innerHTML=io,ra=r(),f(ft.$$.fragment),aa=r(),gt=s("p"),gt.innerHTML=co,na=r(),f(ht.$$.fragment),sa=r(),f(ut.$$.fragment),oa=r(),E=s("div"),f(bt.$$.fragment),Qn=r(),$r=s("p"),$r.innerHTML=mo,Kn=r(),f(_e.$$.fragment),es=r(),ve=s("div"),f(_t.$$.fragment),ts=r(),Cr=s("p"),Cr.innerHTML=po,rs=r(),Te=s("div"),f(vt.$$.fragment),as=r(),kr=s("p"),kr.innerHTML=fo,la=r(),f(Tt.$$.fragment),ia=r(),ee=s("div"),f($t.$$.fragment),ns=r(),wr=s("p"),wr.innerHTML=go,ca=r(),Er=s("p"),this.h()},l(e){const l=Lo("svelte-u9bgzb",document.head);m=o(l,"META",{name:!0,content:!0}),l.forEach(n),x=a(e),b=o(e,"P",{}),T(b).forEach(n),C=a(e),g(y.$$.fragment,e),_=a(e),M=o(e,"P",{"data-svelte-h":!0}),c(M)!=="svelte-1vobzxg"&&(M.innerHTML=L),I=a(e),ye=o(e,"P",{"data-svelte-h":!0}),c(ye)!=="svelte-1cfup3n"&&(ye.innerHTML=ss),Jr=a(e),Me=o(e,"P",{"data-svelte-h":!0}),c(Me)!=="svelte-d50wob"&&(Me.innerHTML=os),Ur=a(e),xe=o(e,"UL",{"data-svelte-h":!0}),c(xe)!=="svelte-eqdn05"&&(xe.innerHTML=ls),Ar=a(e),Le=o(e,"P",{"data-svelte-h":!0}),c(Le)!=="svelte-1b834xs"&&(Le.innerHTML=is),Dr=a(e),je=o(e,"P",{"data-svelte-h":!0}),c(je)!=="svelte-1ecg6pf"&&(je.innerHTML=cs),Nr=a(e),g(Ie.$$.fragment,e),Fr=a(e),Ee=o(e,"P",{"data-svelte-h":!0}),c(Ee)!=="svelte-k1ad7d"&&(Ee.innerHTML=ms),Sr=a(e),F=o(e,"DIV",{class:!0});var te=T(F);g(He.$$.fragment,te),Ua=a(te),wt=o(te,"P",{"data-svelte-h":!0}),c(wt)!=="svelte-1l2y3b6"&&(wt.innerHTML=ds),Aa=a(te),H=o(te,"DIV",{class:!0});var A=T(H);g(Je.$$.fragment,A),Da=a(A),yt=o(A,"P",{"data-svelte-h":!0}),c(yt)!=="svelte-1bfkm9x"&&(yt.textContent=ps),Na=a(A),Mt=o(A,"P",{"data-svelte-h":!0}),c(Mt)!=="svelte-1fkshtn"&&(Mt.textContent=fs),Fa=a(A),xt=o(A,"UL",{"data-svelte-h":!0}),c(xt)!=="svelte-12drq5x"&&(xt.innerHTML=gs),Sa=a(A),Lt=o(A,"P",{"data-svelte-h":!0}),c(Lt)!=="svelte-1faq0a7"&&(Lt.innerHTML=hs),A.forEach(n),te.forEach(n),Pr=a(e),O=o(e,"DIV",{class:!0});var Ct=T(O);g(Ue.$$.fragment,Ct),Pa=a(Ct),jt=o(Ct,"P",{"data-svelte-h":!0}),c(jt)!=="svelte-6svysx"&&(jt.innerHTML=us),Ct.forEach(n),Wr=a(e),V=o(e,"DIV",{class:!0});var kt=T(V);g(Ae.$$.fragment,kt),Wa=a(kt),It=o(kt,"P",{"data-svelte-h":!0}),c(It)!=="svelte-e6fxs2"&&(It.innerHTML=bs),kt.forEach(n),Br=a(e),X=o(e,"DIV",{class:!0});var da=T(X);g(De.$$.fragment,da),Ba=a(da),Et=o(da,"P",{"data-svelte-h":!0}),c(Et)!=="svelte-w3u5vn"&&(Et.innerHTML=_s),da.forEach(n),zr=a(e),S=o(e,"DIV",{class:!0});var yr=T(S);g(Ne.$$.fragment,yr),za=a(yr),Ht=o(yr,"P",{"data-svelte-h":!0}),c(Ht)!=="svelte-1u5pbjw"&&(Ht.innerHTML=vs),Ra=a(yr),Jt=o(yr,"P",{"data-svelte-h":!0}),c(Jt)!=="svelte-1cmgnu4"&&(Jt.innerHTML=Ts),yr.forEach(n),Rr=a(e),Z=o(e,"DIV",{class:!0});var pa=T(Z);g(Fe.$$.fragment,pa),Ga=a(pa),Ut=o(pa,"P",{"data-svelte-h":!0}),c(Ut)!=="svelte-1hfmggn"&&(Ut.innerHTML=$s),pa.forEach(n),Gr=a(e),P=o(e,"DIV",{class:!0});var Mr=T(P);g(Se.$$.fragment,Mr),Ya=a(Mr),At=o(Mr,"P",{"data-svelte-h":!0}),c(At)!=="svelte-12eqks8"&&(At.innerHTML=Cs),qa=a(Mr),J=o(Mr,"DIV",{class:!0});var Y=T(J);g(Pe.$$.fragment,Y),Oa=a(Y),Dt=o(Y,"P",{"data-svelte-h":!0}),c(Dt)!=="svelte-op70zs"&&(Dt.innerHTML=ks),Va=a(Y),Nt=o(Y,"P",{"data-svelte-h":!0}),c(Nt)!=="svelte-m2rt7w"&&(Nt.innerHTML=ws),Xa=a(Y),Ft=o(Y,"P",{"data-svelte-h":!0}),c(Ft)!=="svelte-1fkshtn"&&(Ft.textContent=ys),Za=a(Y),W=o(Y,"UL",{});var $e=T(W);We=o($e,"LI",{});var fa=T(We);St=o(fa,"P",{"data-svelte-h":!0}),c(St)!=="svelte-py3r3s"&&(St.innerHTML=Ms),Qa=a(fa),g(re.$$.fragment,fa),fa.forEach(n),Ka=a($e),Pt=o($e,"LI",{"data-svelte-h":!0}),c(Pt)!=="svelte-dx3m30"&&(Pt.innerHTML=xs),en=a($e),Wt=o($e,"LI",{"data-svelte-h":!0}),c(Wt)!=="svelte-n1uh6c"&&(Wt.innerHTML=Ls),tn=a($e),Bt=o($e,"LI",{"data-svelte-h":!0}),c(Bt)!=="svelte-ybo66z"&&(Bt.innerHTML=js),$e.forEach(n),Y.forEach(n),Mr.forEach(n),Yr=a(e),B=o(e,"DIV",{class:!0});var xr=T(B);g(Be.$$.fragment,xr),rn=a(xr),zt=o(xr,"P",{"data-svelte-h":!0}),c(zt)!=="svelte-lcj2so"&&(zt.innerHTML=Is),an=a(xr),D=o(xr,"DIV",{class:!0});var Ce=T(D);g(ze.$$.fragment,Ce),nn=a(Ce),Rt=o(Ce,"P",{"data-svelte-h":!0}),c(Rt)!=="svelte-nmg16f"&&(Rt.textContent=Es),sn=a(Ce),Gt=o(Ce,"P",{"data-svelte-h":!0}),c(Gt)!=="svelte-1fkshtn"&&(Gt.textContent=Hs),on=a(Ce),Yt=o(Ce,"UL",{"data-svelte-h":!0}),c(Yt)!=="svelte-1joe424"&&(Yt.innerHTML=Js),Ce.forEach(n),xr.forEach(n),qr=a(e),Q=o(e,"DIV",{class:!0});var ga=T(Q);g(Re.$$.fragment,ga),ln=a(ga),qt=o(ga,"P",{"data-svelte-h":!0}),c(qt)!=="svelte-4clse7"&&(qt.innerHTML=Us),ga.forEach(n),Or=a(e),K=o(e,"DIV",{class:!0});var ha=T(K);g(Ge.$$.fragment,ha),cn=a(ha),Ot=o(ha,"P",{"data-svelte-h":!0}),c(Ot)!=="svelte-1daiwkb"&&(Ot.innerHTML=As),ha.forEach(n),Vr=a(e),z=o(e,"DIV",{class:!0});var Lr=T(z);g(Ye.$$.fragment,Lr),mn=a(Lr),Vt=o(Lr,"P",{"data-svelte-h":!0}),c(Vt)!=="svelte-4ag9j6"&&(Vt.innerHTML=Ds),dn=a(Lr),Xt=o(Lr,"P",{"data-svelte-h":!0}),c(Xt)!=="svelte-1mhjcx0"&&(Xt.innerHTML=Ns),Lr.forEach(n),Xr=a(e),U=o(e,"DIV",{class:!0});var ke=T(U);g(qe.$$.fragment,ke),pn=a(ke),Zt=o(ke,"P",{"data-svelte-h":!0}),c(Zt)!=="svelte-mdwcvt"&&(Zt.innerHTML=Fs),fn=a(ke),Qt=o(ke,"P",{"data-svelte-h":!0}),c(Qt)!=="svelte-1fkshtn"&&(Qt.textContent=Ss),gn=a(ke),Kt=o(ke,"UL",{"data-svelte-h":!0}),c(Kt)!=="svelte-15svthu"&&(Kt.innerHTML=Ps),ke.forEach(n),Zr=a(e),R=o(e,"DIV",{class:!0});var jr=T(R);g(Oe.$$.fragment,jr),hn=a(jr),er=o(jr,"P",{"data-svelte-h":!0}),c(er)!=="svelte-140pgpo"&&(er.innerHTML=Ws),un=a(jr),N=o(jr,"DIV",{class:!0});var we=T(N);g(Ve.$$.fragment,we),bn=a(we),tr=o(we,"P",{"data-svelte-h":!0}),c(tr)!=="svelte-1wbmj3"&&(tr.textContent=Bs),_n=a(we),rr=o(we,"P",{"data-svelte-h":!0}),c(rr)!=="svelte-1fkshtn"&&(rr.textContent=zs),vn=a(we),ar=o(we,"UL",{"data-svelte-h":!0}),c(ar)!=="svelte-dna85o"&&(ar.innerHTML=Rs),we.forEach(n),jr.forEach(n),Qr=a(e),G=o(e,"DIV",{class:!0});var Ir=T(G);g(Xe.$$.fragment,Ir),Tn=a(Ir),nr=o(Ir,"P",{"data-svelte-h":!0}),c(nr)!=="svelte-1ooma4z"&&(nr.innerHTML=Gs),$n=a(Ir),g(ae.$$.fragment,Ir),Ir.forEach(n),Kr=a(e),g(Ze.$$.fragment,e),ea=a(e),v=o(e,"DIV",{class:!0});var k=T(v);g(Qe.$$.fragment,k),Cn=a(k),sr=o(k,"P",{"data-svelte-h":!0}),c(sr)!=="svelte-14xg00o"&&(sr.textContent=Ys),kn=a(k),or=o(k,"P",{"data-svelte-h":!0}),c(or)!=="svelte-1xprdvt"&&(or.innerHTML=qs),wn=a(k),lr=o(k,"P",{"data-svelte-h":!0}),c(lr)!=="svelte-1vv9zs6"&&(lr.innerHTML=Os),yn=a(k),g(ne.$$.fragment,k),Mn=a(k),se=o(k,"DIV",{class:!0});var ua=T(se);g(Ke.$$.fragment,ua),xn=a(ua),ir=o(ua,"P",{"data-svelte-h":!0}),c(ir)!=="svelte-106889p"&&(ir.textContent=Vs),ua.forEach(n),Ln=a(k),oe=o(k,"DIV",{class:!0});var ba=T(oe);g(et.$$.fragment,ba),jn=a(ba),cr=o(ba,"P",{"data-svelte-h":!0}),c(cr)!=="svelte-oshcpj"&&(cr.textContent=Xs),ba.forEach(n),In=a(k),le=o(k,"DIV",{class:!0});var _a=T(le);g(tt.$$.fragment,_a),En=a(_a),mr=o(_a,"P",{"data-svelte-h":!0}),c(mr)!=="svelte-1o0xh73"&&(mr.textContent=Zs),_a.forEach(n),Hn=a(k),ie=o(k,"DIV",{class:!0});var va=T(ie);g(rt.$$.fragment,va),Jn=a(va),dr=o(va,"P",{"data-svelte-h":!0}),c(dr)!=="svelte-jt4n1g"&&(dr.innerHTML=Qs),va.forEach(n),Un=a(k),ce=o(k,"DIV",{class:!0});var Ta=T(ce);g(at.$$.fragment,Ta),An=a(Ta),pr=o(Ta,"P",{"data-svelte-h":!0}),c(pr)!=="svelte-10eiwg0"&&(pr.textContent=Ks),Ta.forEach(n),Dn=a(k),me=o(k,"DIV",{class:!0});var $a=T(me);g(nt.$$.fragment,$a),Nn=a($a),fr=o($a,"P",{"data-svelte-h":!0}),c(fr)!=="svelte-1df7x4n"&&(fr.textContent=eo),$a.forEach(n),Fn=a(k),de=o(k,"DIV",{class:!0});var Ca=T(de);g(st.$$.fragment,Ca),Sn=a(Ca),gr=o(Ca,"P",{"data-svelte-h":!0}),c(gr)!=="svelte-18swygp"&&(gr.textContent=to),Ca.forEach(n),Pn=a(k),pe=o(k,"DIV",{class:!0});var ka=T(pe);g(ot.$$.fragment,ka),Wn=a(ka),hr=o(ka,"P",{"data-svelte-h":!0}),c(hr)!=="svelte-19xp05v"&&(hr.textContent=ro),ka.forEach(n),Bn=a(k),fe=o(k,"DIV",{class:!0});var wa=T(fe);g(lt.$$.fragment,wa),zn=a(wa),ur=o(wa,"P",{"data-svelte-h":!0}),c(ur)!=="svelte-7af61p"&&(ur.textContent=ao),wa.forEach(n),Rn=a(k),ge=o(k,"DIV",{class:!0});var ya=T(ge);g(it.$$.fragment,ya),Gn=a(ya),br=o(ya,"P",{"data-svelte-h":!0}),c(br)!=="svelte-8cdxjr"&&(br.textContent=no),ya.forEach(n),Yn=a(k),he=o(k,"DIV",{class:!0});var Ma=T(he);g(ct.$$.fragment,Ma),qn=a(Ma),_r=o(Ma,"P",{"data-svelte-h":!0}),c(_r)!=="svelte-sluvs0"&&(_r.textContent=so),Ma.forEach(n),On=a(k),ue=o(k,"DIV",{class:!0});var xa=T(ue);g(mt.$$.fragment,xa),Vn=a(xa),vr=o(xa,"P",{"data-svelte-h":!0}),c(vr)!=="svelte-6bvy6d"&&(vr.textContent=oo),xa.forEach(n),Xn=a(k),be=o(k,"DIV",{class:!0});var La=T(be);g(dt.$$.fragment,La),Zn=a(La),Tr=o(La,"P",{"data-svelte-h":!0}),c(Tr)!=="svelte-zzwxsv"&&(Tr.textContent=lo),La.forEach(n),k.forEach(n),ta=a(e),pt=o(e,"P",{"data-svelte-h":!0}),c(pt)!=="svelte-wu4ft3"&&(pt.innerHTML=io),ra=a(e),g(ft.$$.fragment,e),aa=a(e),gt=o(e,"P",{"data-svelte-h":!0}),c(gt)!=="svelte-183oh1l"&&(gt.innerHTML=co),na=a(e),g(ht.$$.fragment,e),sa=a(e),g(ut.$$.fragment,e),oa=a(e),E=o(e,"DIV",{class:!0});var q=T(E);g(bt.$$.fragment,q),Qn=a(q),$r=o(q,"P",{"data-svelte-h":!0}),c($r)!=="svelte-1o3q9xe"&&($r.innerHTML=mo),Kn=a(q),g(_e.$$.fragment,q),es=a(q),ve=o(q,"DIV",{class:!0});var ja=T(ve);g(_t.$$.fragment,ja),ts=a(ja),Cr=o(ja,"P",{"data-svelte-h":!0}),c(Cr)!=="svelte-hbs6ga"&&(Cr.innerHTML=po),ja.forEach(n),rs=a(q),Te=o(q,"DIV",{class:!0});var Ia=T(Te);g(vt.$$.fragment,Ia),as=a(Ia),kr=o(Ia,"P",{"data-svelte-h":!0}),c(kr)!=="svelte-dkslae"&&(kr.innerHTML=fo),Ia.forEach(n),q.forEach(n),la=a(e),g(Tt.$$.fragment,e),ia=a(e),ee=o(e,"DIV",{class:!0});var Ea=T(ee);g($t.$$.fragment,Ea),ns=a(Ea),wr=o(Ea,"P",{"data-svelte-h":!0}),c(wr)!=="svelte-t17a5m"&&(wr.innerHTML=go),Ea.forEach(n),ca=a(e),Er=o(e,"P",{}),T(Er).forEach(n),this.h()},h(){$(m,"name","hf:doc:metadata"),$(m,"content",Fo),$(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,l){t(document.head,m),i(e,x,l),i(e,b,l),i(e,C,l),h(y,e,l),i(e,_,l),i(e,M,l),i(e,I,l),i(e,ye,l),i(e,Jr,l),i(e,Me,l),i(e,Ur,l),i(e,xe,l),i(e,Ar,l),i(e,Le,l),i(e,Dr,l),i(e,je,l),i(e,Nr,l),h(Ie,e,l),i(e,Fr,l),i(e,Ee,l),i(e,Sr,l),i(e,F,l),h(He,F,null),t(F,Ua),t(F,wt),t(F,Aa),t(F,H),h(Je,H,null),t(H,Da),t(H,yt),t(H,Na),t(H,Mt),t(H,Fa),t(H,xt),t(H,Sa),t(H,Lt),i(e,Pr,l),i(e,O,l),h(Ue,O,null),t(O,Pa),t(O,jt),i(e,Wr,l),i(e,V,l),h(Ae,V,null),t(V,Wa),t(V,It),i(e,Br,l),i(e,X,l),h(De,X,null),t(X,Ba),t(X,Et),i(e,zr,l),i(e,S,l),h(Ne,S,null),t(S,za),t(S,Ht),t(S,Ra),t(S,Jt),i(e,Rr,l),i(e,Z,l),h(Fe,Z,null),t(Z,Ga),t(Z,Ut),i(e,Gr,l),i(e,P,l),h(Se,P,null),t(P,Ya),t(P,At),t(P,qa),t(P,J),h(Pe,J,null),t(J,Oa),t(J,Dt),t(J,Va),t(J,Nt),t(J,Xa),t(J,Ft),t(J,Za),t(J,W),t(W,We),t(We,St),t(We,Qa),h(re,We,null),t(W,Ka),t(W,Pt),t(W,en),t(W,Wt),t(W,tn),t(W,Bt),i(e,Yr,l),i(e,B,l),h(Be,B,null),t(B,rn),t(B,zt),t(B,an),t(B,D),h(ze,D,null),t(D,nn),t(D,Rt),t(D,sn),t(D,Gt),t(D,on),t(D,Yt),i(e,qr,l),i(e,Q,l),h(Re,Q,null),t(Q,ln),t(Q,qt),i(e,Or,l),i(e,K,l),h(Ge,K,null),t(K,cn),t(K,Ot),i(e,Vr,l),i(e,z,l),h(Ye,z,null),t(z,mn),t(z,Vt),t(z,dn),t(z,Xt),i(e,Xr,l),i(e,U,l),h(qe,U,null),t(U,pn),t(U,Zt),t(U,fn),t(U,Qt),t(U,gn),t(U,Kt),i(e,Zr,l),i(e,R,l),h(Oe,R,null),t(R,hn),t(R,er),t(R,un),t(R,N),h(Ve,N,null),t(N,bn),t(N,tr),t(N,_n),t(N,rr),t(N,vn),t(N,ar),i(e,Qr,l),i(e,G,l),h(Xe,G,null),t(G,Tn),t(G,nr),t(G,$n),h(ae,G,null),i(e,Kr,l),h(Ze,e,l),i(e,ea,l),i(e,v,l),h(Qe,v,null),t(v,Cn),t(v,sr),t(v,kn),t(v,or),t(v,wn),t(v,lr),t(v,yn),h(ne,v,null),t(v,Mn),t(v,se),h(Ke,se,null),t(se,xn),t(se,ir),t(v,Ln),t(v,oe),h(et,oe,null),t(oe,jn),t(oe,cr),t(v,In),t(v,le),h(tt,le,null),t(le,En),t(le,mr),t(v,Hn),t(v,ie),h(rt,ie,null),t(ie,Jn),t(ie,dr),t(v,Un),t(v,ce),h(at,ce,null),t(ce,An),t(ce,pr),t(v,Dn),t(v,me),h(nt,me,null),t(me,Nn),t(me,fr),t(v,Fn),t(v,de),h(st,de,null),t(de,Sn),t(de,gr),t(v,Pn),t(v,pe),h(ot,pe,null),t(pe,Wn),t(pe,hr),t(v,Bn),t(v,fe),h(lt,fe,null),t(fe,zn),t(fe,ur),t(v,Rn),t(v,ge),h(it,ge,null),t(ge,Gn),t(ge,br),t(v,Yn),t(v,he),h(ct,he,null),t(he,qn),t(he,_r),t(v,On),t(v,ue),h(mt,ue,null),t(ue,Vn),t(ue,vr),t(v,Xn),t(v,be),h(dt,be,null),t(be,Zn),t(be,Tr),i(e,ta,l),i(e,pt,l),i(e,ra,l),h(ft,e,l),i(e,aa,l),i(e,gt,l),i(e,na,l),h(ht,e,l),i(e,sa,l),h(ut,e,l),i(e,oa,l),i(e,E,l),h(bt,E,null),t(E,Qn),t(E,$r),t(E,Kn),h(_e,E,null),t(E,es),t(E,ve),h(_t,ve,null),t(ve,ts),t(ve,Cr),t(E,rs),t(E,Te),h(vt,Te,null),t(Te,as),t(Te,kr),i(e,la,l),h(Tt,e,l),i(e,ia,l),i(e,ee,l),h($t,ee,null),t(ee,ns),t(ee,wr),i(e,ca,l),i(e,Er,l),ma=!0},p(e,[l]){const te={};l&2&&(te.$$scope={dirty:l,ctx:e}),re.$set(te);const A={};l&2&&(A.$$scope={dirty:l,ctx:e}),ae.$set(A);const Ct={};l&2&&(Ct.$$scope={dirty:l,ctx:e}),ne.$set(Ct);const kt={};l&2&&(kt.$$scope={dirty:l,ctx:e}),_e.$set(kt)},i(e){ma||(d(y.$$.fragment,e),d(Ie.$$.fragment,e),d(He.$$.fragment,e),d(Je.$$.fragment,e),d(Ue.$$.fragment,e),d(Ae.$$.fragment,e),d(De.$$.fragment,e),d(Ne.$$.fragment,e),d(Fe.$$.fragment,e),d(Se.$$.fragment,e),d(Pe.$$.fragment,e),d(re.$$.fragment,e),d(Be.$$.fragment,e),d(ze.$$.fragment,e),d(Re.$$.fragment,e),d(Ge.$$.fragment,e),d(Ye.$$.fragment,e),d(qe.$$.fragment,e),d(Oe.$$.fragment,e),d(Ve.$$.fragment,e),d(Xe.$$.fragment,e),d(ae.$$.fragment,e),d(Ze.$$.fragment,e),d(Qe.$$.fragment,e),d(ne.$$.fragment,e),d(Ke.$$.fragment,e),d(et.$$.fragment,e),d(tt.$$.fragment,e),d(rt.$$.fragment,e),d(at.$$.fragment,e),d(nt.$$.fragment,e),d(st.$$.fragment,e),d(ot.$$.fragment,e),d(lt.$$.fragment,e),d(it.$$.fragment,e),d(ct.$$.fragment,e),d(mt.$$.fragment,e),d(dt.$$.fragment,e),d(ft.$$.fragment,e),d(ht.$$.fragment,e),d(ut.$$.fragment,e),d(bt.$$.fragment,e),d(_e.$$.fragment,e),d(_t.$$.fragment,e),d(vt.$$.fragment,e),d(Tt.$$.fragment,e),d($t.$$.fragment,e),ma=!0)},o(e){p(y.$$.fragment,e),p(Ie.$$.fragment,e),p(He.$$.fragment,e),p(Je.$$.fragment,e),p(Ue.$$.fragment,e),p(Ae.$$.fragment,e),p(De.$$.fragment,e),p(Ne.$$.fragment,e),p(Fe.$$.fragment,e),p(Se.$$.fragment,e),p(Pe.$$.fragment,e),p(re.$$.fragment,e),p(Be.$$.fragment,e),p(ze.$$.fragment,e),p(Re.$$.fragment,e),p(Ge.$$.fragment,e),p(Ye.$$.fragment,e),p(qe.$$.fragment,e),p(Oe.$$.fragment,e),p(Ve.$$.fragment,e),p(Xe.$$.fragment,e),p(ae.$$.fragment,e),p(Ze.$$.fragment,e),p(Qe.$$.fragment,e),p(ne.$$.fragment,e),p(Ke.$$.fragment,e),p(et.$$.fragment,e),p(tt.$$.fragment,e),p(rt.$$.fragment,e),p(at.$$.fragment,e),p(nt.$$.fragment,e),p(st.$$.fragment,e),p(ot.$$.fragment,e),p(lt.$$.fragment,e),p(it.$$.fragment,e),p(ct.$$.fragment,e),p(mt.$$.fragment,e),p(dt.$$.fragment,e),p(ft.$$.fragment,e),p(ht.$$.fragment,e),p(ut.$$.fragment,e),p(bt.$$.fragment,e),p(_e.$$.fragment,e),p(_t.$$.fragment,e),p(vt.$$.fragment,e),p(Tt.$$.fragment,e),p($t.$$.fragment,e),ma=!1},d(e){e&&(n(x),n(b),n(C),n(_),n(M),n(I),n(ye),n(Jr),n(Me),n(Ur),n(xe),n(Ar),n(Le),n(Dr),n(je),n(Nr),n(Fr),n(Ee),n(Sr),n(F),n(Pr),n(O),n(Wr),n(V),n(Br),n(X),n(zr),n(S),n(Rr),n(Z),n(Gr),n(P),n(Yr),n(B),n(qr),n(Q),n(Or),n(K),n(Vr),n(z),n(Xr),n(U),n(Zr),n(R),n(Qr),n(G),n(Kr),n(ea),n(v),n(ta),n(pt),n(ra),n(aa),n(gt),n(na),n(sa),n(oa),n(E),n(la),n(ia),n(ee),n(ca),n(Er)),n(m),u(y,e),u(Ie,e),u(He),u(Je),u(Ue),u(Ae),u(De),u(Ne),u(Fe),u(Se),u(Pe),u(re),u(Be),u(ze),u(Re),u(Ge),u(Ye),u(qe),u(Oe),u(Ve),u(Xe),u(ae),u(Ze,e),u(Qe),u(ne),u(Ke),u(et),u(tt),u(rt),u(at),u(nt),u(st),u(ot),u(lt),u(it),u(ct),u(mt),u(dt),u(ft,e),u(ht,e),u(ut,e),u(bt),u(_e),u(_t),u(vt),u(Tt,e),u($t)}}}const Fo='{"title":"コールバック数","local":"コールバック数","sections":[{"title":"利用可能なコールバック","local":"transformers.integrations.CometCallback","sections":[],"depth":2},{"title":"TrainerCallback","local":"transformers.TrainerCallback","sections":[],"depth":2},{"title":"TrainerState","local":"transformers.TrainerState","sections":[],"depth":2},{"title":"TrainerControl","local":"transformers.TrainerControl","sections":[],"depth":2}],"depth":1}';function So(j){return Mo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qo extends vo{constructor(m){super(),To(this,m,So,No,_o,{})}}export{qo as component};
