import{s as Rs,n as xs,o as Hs}from"../chunks/scheduler.25b97de1.js";import{S as Ss,i as Fs,g as p,s as e,r as i,A as zs,h as M,f as l,c as n,j as ks,u as y,x as m,k as Gs,y as Es,a as t,v as r,d as c,t as J,w as o}from"../chunks/index.d9030fc9.js";import{C as j}from"../chunks/CodeBlock.e6cd0d95.js";import{H as fs,E as Ds}from"../chunks/EditOnGithub.91d95064.js";function Ls(bs){let T,z,S,E,U,D,h,gs="🤗 Transformers库提供了一个优化过的<code>Trainer</code>类，用于训练🤗 Transformers模型，相比于手动编写自己的训练循环，这更容易开始训练。<code>Trainer</code>提供了超参数搜索的API。本文档展示了如何在示例中启用它。",L,u,P,w,_s='<code>Trainer</code> 目前支持四种超参数搜索后端：<a href="https://optuna.org/" rel="nofollow">optuna</a>，<a href="https://sigopt.com/" rel="nofollow">sigopt</a>，<a href="https://docs.ray.io/en/latest/tune/index.html" rel="nofollow">raytune</a>，<a href="https://wandb.ai/site/sweeps" rel="nofollow">wandb</a>',K,I,$s="在使用它们之前，您应该先安装它们作为超参数搜索后端。",O,d,ss,C,as,f,qs="定义超参数搜索空间，不同的后端需要不同的格式。",ls,b,Ws='对于sigopt，请参阅sigopt <a href="https://docs.sigopt.com/ai-module-api-references/api_reference/objects/object_parameter" rel="nofollow">object_parameter</a>，它类似于以下内容：',ts,g,es,_,Xs='对于optuna，请参阅optuna <a href="https://optuna.readthedocs.io/en/stable/tutorial/10_key_features/002_configurations.html#sphx-glr-tutorial-10-key-features-002-configurations-py" rel="nofollow">object_parameter</a>，它类似于以下内容：',ns,$,ps,q,Bs='Optuna提供了多目标HPO。您可以在<code>hyperparameter_search</code>中传递<code>direction</code>参数，并定义自己的<code>compute_objective</code>以返回多个目标值。在<code>hyperparameter_search</code>中将返回Pareto Front（<code>List[BestRun]</code>），您应该参考<a href="https://github.com/huggingface/transformers/blob/main/tests/trainer/test_trainer.py" rel="nofollow">test_trainer</a>中的测试用例<code>TrainerHyperParameterMultiObjectOptunaIntegrationTest</code>。它类似于以下内容：',Ms,W,is,X,Zs='对于raytune，可以参考raytune的<a href="https://docs.ray.io/en/latest/tune/api/search_space.html" rel="nofollow">object_parameter</a>，它类似于以下内容：',ys,B,ms,Z,Ys='对于wandb，可以参考wandb的<a href="https://docs.wandb.ai/guides/sweeps/configuration" rel="nofollow">object_parameter</a>，它类似于以下内容：',rs,Y,cs,V,Vs="定义一个<code>model_init</code>函数并将其传递给[Trainer]，作为示例：",Js,Q,os,v,Qs="使用你的<code>model_init</code>函数、训练参数、训练和测试数据集以及评估函数创建一个<code>Trainer</code>。",Ts,A,js,N,vs="调用超参数搜索，获取最佳试验参数，后端可以是<code>&quot;optuna&quot;</code>/<code>&quot;sigopt&quot;</code>/<code>&quot;wandb&quot;</code>/<code>&quot;ray&quot;</code>。方向可以是<code>&quot;minimize&quot;</code>或<code>&quot;maximize&quot;</code>，表示是否优化更大或更低的目标。",Us,k,As="您可以定义自己的compute_objective函数，如果没有定义，将调用默认的compute_objective，并将评估指标（如f1）之和作为目标值返回。",hs,G,us,R,ws,x,Ns="目前，Optuna和Sigopt已启用针对DDP的超参数搜索。只有rank-zero进程会进行超参数搜索并将参数传递给其他进程。",Is,H,ds,F,Cs;return U=new fs({props:{title:"使用Trainer API进行超参数搜索",local:"使用trainer-api进行超参数搜索",headingTag:"h1"}}),u=new fs({props:{title:"超参数搜索后端",local:"超参数搜索后端",headingTag:"h2"}}),d=new j({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wdHVuYSUyRnNpZ29wdCUyRndhbmRiJTJGcmF5JTVCdHVuZSU1RA==",highlighted:"pip install optuna/sigopt/wandb/ray[tune]",wrap:!1}}),C=new fs({props:{title:"如何在示例中启用超参数搜索",local:"如何在示例中启用超参数搜索",headingTag:"h2"}}),g=new j({props:{code:"ZGVmJTIwc2lnb3B0X2hwX3NwYWNlKHRyaWFsKSUzQSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMmJvdW5kcyUyMiUzQSUyMCU3QiUyMm1pbiUyMiUzQSUyMDFlLTYlMkMlMjAlMjJtYXglMjIlM0ElMjAxZS00JTdEJTJDJTIwJTIybmFtZSUyMiUzQSUyMCUyMmxlYXJuaW5nX3JhdGUlMjIlMkMlMjAlMjJ0eXBlJTIyJTNBJTIwJTIyZG91YmxlJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY2F0ZWdvcmljYWxfdmFsdWVzJTIyJTNBJTIwJTVCJTIyMTYlMjIlMkMlMjAlMjIzMiUyMiUyQyUyMCUyMjY0JTIyJTJDJTIwJTIyMTI4JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybmFtZSUyMiUzQSUyMCUyMnBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnR5cGUlMjIlM0ElMjAlMjJjYXRlZ29yaWNhbCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">sigopt_hp_space</span>(<span class="hljs-params">trial</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> [
<span class="hljs-meta">... </span>        {<span class="hljs-string">&quot;bounds&quot;</span>: {<span class="hljs-string">&quot;min&quot;</span>: <span class="hljs-number">1e-6</span>, <span class="hljs-string">&quot;max&quot;</span>: <span class="hljs-number">1e-4</span>}, <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;learning_rate&quot;</span>, <span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;double&quot;</span>},
<span class="hljs-meta">... </span>        {
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;categorical_values&quot;</span>: [<span class="hljs-string">&quot;16&quot;</span>, <span class="hljs-string">&quot;32&quot;</span>, <span class="hljs-string">&quot;64&quot;</span>, <span class="hljs-string">&quot;128&quot;</span>],
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;per_device_train_batch_size&quot;</span>,
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;categorical&quot;</span>,
<span class="hljs-meta">... </span>        },
<span class="hljs-meta">... </span>    ]`,wrap:!1}}),$=new j({props:{code:"ZGVmJTIwb3B0dW5hX2hwX3NwYWNlKHRyaWFsKSUzQSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmxlYXJuaW5nX3JhdGUlMjIlM0ElMjB0cmlhbC5zdWdnZXN0X2Zsb2F0KCUyMmxlYXJuaW5nX3JhdGUlMjIlMkMlMjAxZS02JTJDJTIwMWUtNCUyQyUyMGxvZyUzRFRydWUpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTIyJTNBJTIwdHJpYWwuc3VnZ2VzdF9jYXRlZ29yaWNhbCglMjJwZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlMjIlMkMlMjAlNUIxNiUyQyUyMDMyJTJDJTIwNjQlMkMlMjAxMjglNUQpJTJDJTBBJTIwJTIwJTIwJTIwJTdE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">optuna_hp_space</span>(<span class="hljs-params">trial</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;learning_rate&quot;</span>: trial.suggest_float(<span class="hljs-string">&quot;learning_rate&quot;</span>, <span class="hljs-number">1e-6</span>, <span class="hljs-number">1e-4</span>, log=<span class="hljs-literal">True</span>),
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;per_device_train_batch_size&quot;</span>: trial.suggest_categorical(<span class="hljs-string">&quot;per_device_train_batch_size&quot;</span>, [<span class="hljs-number">16</span>, <span class="hljs-number">32</span>, <span class="hljs-number">64</span>, <span class="hljs-number">128</span>]),
<span class="hljs-meta">... </span>    }`,wrap:!1}}),W=new j({props:{code:"YmVzdF90cmlhbHMlMjAlM0QlMjB0cmFpbmVyLmh5cGVycGFyYW1ldGVyX3NlYXJjaCglMEElMjAlMjAlMjAlMjBkaXJlY3Rpb24lM0QlNUIlMjJtaW5pbWl6ZSUyMiUyQyUyMCUyMm1heGltaXplJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwYmFja2VuZCUzRCUyMm9wdHVuYSUyMiUyQyUwQSUyMCUyMCUyMCUyMGhwX3NwYWNlJTNEb3B0dW5hX2hwX3NwYWNlJTJDJTBBJTIwJTIwJTIwJTIwbl90cmlhbHMlM0QyMCUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfb2JqZWN0aXZlJTNEY29tcHV0ZV9vYmplY3RpdmUlMkMlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>best_trials = trainer.hyperparameter_search(
<span class="hljs-meta">... </span>    direction=[<span class="hljs-string">&quot;minimize&quot;</span>, <span class="hljs-string">&quot;maximize&quot;</span>],
<span class="hljs-meta">... </span>    backend=<span class="hljs-string">&quot;optuna&quot;</span>,
<span class="hljs-meta">... </span>    hp_space=optuna_hp_space,
<span class="hljs-meta">... </span>    n_trials=<span class="hljs-number">20</span>,
<span class="hljs-meta">... </span>    compute_objective=compute_objective,
<span class="hljs-meta">... </span>)`,wrap:!1}}),B=new j({props:{code:"ZGVmJTIwcmF5X2hwX3NwYWNlKHRyaWFsKSUzQSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmxlYXJuaW5nX3JhdGUlMjIlM0ElMjB0dW5lLmxvZ3VuaWZvcm0oMWUtNiUyQyUyMDFlLTQpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTIyJTNBJTIwdHVuZS5jaG9pY2UoJTVCMTYlMkMlMjAzMiUyQyUyMDY0JTJDJTIwMTI4JTVEKSUyQyUwQSUyMCUyMCUyMCUyMCU3RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">ray_hp_space</span>(<span class="hljs-params">trial</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;learning_rate&quot;</span>: tune.loguniform(<span class="hljs-number">1e-6</span>, <span class="hljs-number">1e-4</span>),
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;per_device_train_batch_size&quot;</span>: tune.choice([<span class="hljs-number">16</span>, <span class="hljs-number">32</span>, <span class="hljs-number">64</span>, <span class="hljs-number">128</span>]),
<span class="hljs-meta">... </span>    }`,wrap:!1}}),Y=new j({props:{code:"ZGVmJTIwd2FuZGJfaHBfc3BhY2UodHJpYWwpJTNBJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybWV0aG9kJTIyJTNBJTIwJTIycmFuZG9tJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybWV0cmljJTIyJTNBJTIwJTdCJTIybmFtZSUyMiUzQSUyMCUyMm9iamVjdGl2ZSUyMiUyQyUyMCUyMmdvYWwlMjIlM0ElMjAlMjJtaW5pbWl6ZSUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnBhcmFtZXRlcnMlMjIlM0ElMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJsZWFybmluZ19yYXRlJTIyJTNBJTIwJTdCJTIyZGlzdHJpYnV0aW9uJTIyJTNBJTIwJTIydW5pZm9ybSUyMiUyQyUyMCUyMm1pbiUyMiUzQSUyMDFlLTYlMkMlMjAlMjJtYXglMjIlM0ElMjAxZS00JTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTIyJTNBJTIwJTdCJTIydmFsdWVzJTIyJTNBJTIwJTVCMTYlMkMlMjAzMiUyQyUyMDY0JTJDJTIwMTI4JTVEJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTdE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">wandb_hp_space</span>(<span class="hljs-params">trial</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;method&quot;</span>: <span class="hljs-string">&quot;random&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;metric&quot;</span>: {<span class="hljs-string">&quot;name&quot;</span>: <span class="hljs-string">&quot;objective&quot;</span>, <span class="hljs-string">&quot;goal&quot;</span>: <span class="hljs-string">&quot;minimize&quot;</span>},
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;parameters&quot;</span>: {
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;learning_rate&quot;</span>: {<span class="hljs-string">&quot;distribution&quot;</span>: <span class="hljs-string">&quot;uniform&quot;</span>, <span class="hljs-string">&quot;min&quot;</span>: <span class="hljs-number">1e-6</span>, <span class="hljs-string">&quot;max&quot;</span>: <span class="hljs-number">1e-4</span>},
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;per_device_train_batch_size&quot;</span>: {<span class="hljs-string">&quot;values&quot;</span>: [<span class="hljs-number">16</span>, <span class="hljs-number">32</span>, <span class="hljs-number">64</span>, <span class="hljs-number">128</span>]},
<span class="hljs-meta">... </span>        },
<span class="hljs-meta">... </span>    }`,wrap:!1}}),Q=new j({props:{code:"ZGVmJTIwbW9kZWxfaW5pdCh0cmlhbCklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjBBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBtb2RlbF9hcmdzLm1vZGVsX25hbWVfb3JfcGF0aCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGZyb21fdGYlM0Rib29sKCUyMi5ja3B0JTIyJTIwaW4lMjBtb2RlbF9hcmdzLm1vZGVsX25hbWVfb3JfcGF0aCklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBjb25maWclM0Rjb25maWclMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBjYWNoZV9kaXIlM0Rtb2RlbF9hcmdzLmNhY2hlX2RpciUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldmlzaW9uJTNEbW9kZWxfYXJncy5tb2RlbF9yZXZpc2lvbiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHVzZV9hdXRoX3Rva2VuJTNEVHJ1ZSUyMGlmJTIwbW9kZWxfYXJncy51c2VfYXV0aF90b2tlbiUyMGVsc2UlMjBOb25lJTJDJTBBJTIwJTIwJTIwJTIwKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">model_init</span>(<span class="hljs-params">trial</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> AutoModelForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>        model_args.model_name_or_path,
<span class="hljs-meta">... </span>        from_tf=<span class="hljs-built_in">bool</span>(<span class="hljs-string">&quot;.ckpt&quot;</span> <span class="hljs-keyword">in</span> model_args.model_name_or_path),
<span class="hljs-meta">... </span>        config=config,
<span class="hljs-meta">... </span>        cache_dir=model_args.cache_dir,
<span class="hljs-meta">... </span>        revision=model_args.model_revision,
<span class="hljs-meta">... </span>        use_auth_token=<span class="hljs-literal">True</span> <span class="hljs-keyword">if</span> model_args.use_auth_token <span class="hljs-keyword">else</span> <span class="hljs-literal">None</span>,
<span class="hljs-meta">... </span>    )`,wrap:!1}}),A=new j({props:{code:"dHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0ROb25lJTJDJTBBJTIwJTIwJTIwJTIwYXJncyUzRHRyYWluaW5nX2FyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEc21hbGxfdHJhaW5fZGF0YXNldCUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRHNtYWxsX2V2YWxfZGF0YXNldCUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfbWV0cmljcyUzRGNvbXB1dGVfbWV0cmljcyUyQyUwQSUyMCUyMCUyMCUyMHByb2Nlc3NpbmdfY2xhc3MlM0R0b2tlbml6ZXIlMkMlMEElMjAlMjAlMjAlMjBtb2RlbF9pbml0JTNEbW9kZWxfaW5pdCUyQyUwQSUyMCUyMCUyMCUyMGRhdGFfY29sbGF0b3IlM0RkYXRhX2NvbGxhdG9yJTJDJTBBKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=<span class="hljs-literal">None</span>,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=small_train_dataset,
<span class="hljs-meta">... </span>    eval_dataset=small_eval_dataset,
<span class="hljs-meta">... </span>    compute_metrics=compute_metrics,
<span class="hljs-meta">... </span>    processing_class=tokenizer,
<span class="hljs-meta">... </span>    model_init=model_init,
<span class="hljs-meta">... </span>    data_collator=data_collator,
<span class="hljs-meta">... </span>)`,wrap:!1}}),G=new j({props:{code:"YmVzdF90cmlhbCUyMCUzRCUyMHRyYWluZXIuaHlwZXJwYXJhbWV0ZXJfc2VhcmNoKCUwQSUyMCUyMCUyMCUyMGRpcmVjdGlvbiUzRCUyMm1heGltaXplJTIyJTJDJTBBJTIwJTIwJTIwJTIwYmFja2VuZCUzRCUyMm9wdHVuYSUyMiUyQyUwQSUyMCUyMCUyMCUyMGhwX3NwYWNlJTNEb3B0dW5hX2hwX3NwYWNlJTJDJTBBJTIwJTIwJTIwJTIwbl90cmlhbHMlM0QyMCUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfb2JqZWN0aXZlJTNEY29tcHV0ZV9vYmplY3RpdmUlMkMlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>best_trial = trainer.hyperparameter_search(
<span class="hljs-meta">... </span>    direction=<span class="hljs-string">&quot;maximize&quot;</span>,
<span class="hljs-meta">... </span>    backend=<span class="hljs-string">&quot;optuna&quot;</span>,
<span class="hljs-meta">... </span>    hp_space=optuna_hp_space,
<span class="hljs-meta">... </span>    n_trials=<span class="hljs-number">20</span>,
<span class="hljs-meta">... </span>    compute_objective=compute_objective,
<span class="hljs-meta">... </span>)`,wrap:!1}}),R=new fs({props:{title:"针对DDP微调的超参数搜索",local:"针对ddp微调的超参数搜索",headingTag:"h2"}}),H=new Ds({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/zh/hpo_train.md"}}),{c(){T=p("meta"),z=e(),S=p("p"),E=e(),i(U.$$.fragment),D=e(),h=p("p"),h.innerHTML=gs,L=e(),i(u.$$.fragment),P=e(),w=p("p"),w.innerHTML=_s,K=e(),I=p("p"),I.textContent=$s,O=e(),i(d.$$.fragment),ss=e(),i(C.$$.fragment),as=e(),f=p("p"),f.textContent=qs,ls=e(),b=p("p"),b.innerHTML=Ws,ts=e(),i(g.$$.fragment),es=e(),_=p("p"),_.innerHTML=Xs,ns=e(),i($.$$.fragment),ps=e(),q=p("p"),q.innerHTML=Bs,Ms=e(),i(W.$$.fragment),is=e(),X=p("p"),X.innerHTML=Zs,ys=e(),i(B.$$.fragment),ms=e(),Z=p("p"),Z.innerHTML=Ys,rs=e(),i(Y.$$.fragment),cs=e(),V=p("p"),V.innerHTML=Vs,Js=e(),i(Q.$$.fragment),os=e(),v=p("p"),v.innerHTML=Qs,Ts=e(),i(A.$$.fragment),js=e(),N=p("p"),N.innerHTML=vs,Us=e(),k=p("p"),k.textContent=As,hs=e(),i(G.$$.fragment),us=e(),i(R.$$.fragment),ws=e(),x=p("p"),x.textContent=Ns,Is=e(),i(H.$$.fragment),ds=e(),F=p("p"),this.h()},l(s){const a=zs("svelte-u9bgzb",document.head);T=M(a,"META",{name:!0,content:!0}),a.forEach(l),z=n(s),S=M(s,"P",{}),ks(S).forEach(l),E=n(s),y(U.$$.fragment,s),D=n(s),h=M(s,"P",{"data-svelte-h":!0}),m(h)!=="svelte-12ddgou"&&(h.innerHTML=gs),L=n(s),y(u.$$.fragment,s),P=n(s),w=M(s,"P",{"data-svelte-h":!0}),m(w)!=="svelte-as9xxk"&&(w.innerHTML=_s),K=n(s),I=M(s,"P",{"data-svelte-h":!0}),m(I)!=="svelte-1owi0b4"&&(I.textContent=$s),O=n(s),y(d.$$.fragment,s),ss=n(s),y(C.$$.fragment,s),as=n(s),f=M(s,"P",{"data-svelte-h":!0}),m(f)!=="svelte-3ulmkt"&&(f.textContent=qs),ls=n(s),b=M(s,"P",{"data-svelte-h":!0}),m(b)!=="svelte-s7uas8"&&(b.innerHTML=Ws),ts=n(s),y(g.$$.fragment,s),es=n(s),_=M(s,"P",{"data-svelte-h":!0}),m(_)!=="svelte-1q93awm"&&(_.innerHTML=Xs),ns=n(s),y($.$$.fragment,s),ps=n(s),q=M(s,"P",{"data-svelte-h":!0}),m(q)!=="svelte-1ocmljl"&&(q.innerHTML=Bs),Ms=n(s),y(W.$$.fragment,s),is=n(s),X=M(s,"P",{"data-svelte-h":!0}),m(X)!=="svelte-1w57ahn"&&(X.innerHTML=Zs),ys=n(s),y(B.$$.fragment,s),ms=n(s),Z=M(s,"P",{"data-svelte-h":!0}),m(Z)!=="svelte-j3ax4r"&&(Z.innerHTML=Ys),rs=n(s),y(Y.$$.fragment,s),cs=n(s),V=M(s,"P",{"data-svelte-h":!0}),m(V)!=="svelte-1ik81ii"&&(V.innerHTML=Vs),Js=n(s),y(Q.$$.fragment,s),os=n(s),v=M(s,"P",{"data-svelte-h":!0}),m(v)!=="svelte-w9fjru"&&(v.innerHTML=Qs),Ts=n(s),y(A.$$.fragment,s),js=n(s),N=M(s,"P",{"data-svelte-h":!0}),m(N)!=="svelte-1fogicn"&&(N.innerHTML=vs),Us=n(s),k=M(s,"P",{"data-svelte-h":!0}),m(k)!=="svelte-1k3ogdl"&&(k.textContent=As),hs=n(s),y(G.$$.fragment,s),us=n(s),y(R.$$.fragment,s),ws=n(s),x=M(s,"P",{"data-svelte-h":!0}),m(x)!=="svelte-wf0c68"&&(x.textContent=Ns),Is=n(s),y(H.$$.fragment,s),ds=n(s),F=M(s,"P",{}),ks(F).forEach(l),this.h()},h(){Gs(T,"name","hf:doc:metadata"),Gs(T,"content",Ps)},m(s,a){Es(document.head,T),t(s,z,a),t(s,S,a),t(s,E,a),r(U,s,a),t(s,D,a),t(s,h,a),t(s,L,a),r(u,s,a),t(s,P,a),t(s,w,a),t(s,K,a),t(s,I,a),t(s,O,a),r(d,s,a),t(s,ss,a),r(C,s,a),t(s,as,a),t(s,f,a),t(s,ls,a),t(s,b,a),t(s,ts,a),r(g,s,a),t(s,es,a),t(s,_,a),t(s,ns,a),r($,s,a),t(s,ps,a),t(s,q,a),t(s,Ms,a),r(W,s,a),t(s,is,a),t(s,X,a),t(s,ys,a),r(B,s,a),t(s,ms,a),t(s,Z,a),t(s,rs,a),r(Y,s,a),t(s,cs,a),t(s,V,a),t(s,Js,a),r(Q,s,a),t(s,os,a),t(s,v,a),t(s,Ts,a),r(A,s,a),t(s,js,a),t(s,N,a),t(s,Us,a),t(s,k,a),t(s,hs,a),r(G,s,a),t(s,us,a),r(R,s,a),t(s,ws,a),t(s,x,a),t(s,Is,a),r(H,s,a),t(s,ds,a),t(s,F,a),Cs=!0},p:xs,i(s){Cs||(c(U.$$.fragment,s),c(u.$$.fragment,s),c(d.$$.fragment,s),c(C.$$.fragment,s),c(g.$$.fragment,s),c($.$$.fragment,s),c(W.$$.fragment,s),c(B.$$.fragment,s),c(Y.$$.fragment,s),c(Q.$$.fragment,s),c(A.$$.fragment,s),c(G.$$.fragment,s),c(R.$$.fragment,s),c(H.$$.fragment,s),Cs=!0)},o(s){J(U.$$.fragment,s),J(u.$$.fragment,s),J(d.$$.fragment,s),J(C.$$.fragment,s),J(g.$$.fragment,s),J($.$$.fragment,s),J(W.$$.fragment,s),J(B.$$.fragment,s),J(Y.$$.fragment,s),J(Q.$$.fragment,s),J(A.$$.fragment,s),J(G.$$.fragment,s),J(R.$$.fragment,s),J(H.$$.fragment,s),Cs=!1},d(s){s&&(l(z),l(S),l(E),l(D),l(h),l(L),l(P),l(w),l(K),l(I),l(O),l(ss),l(as),l(f),l(ls),l(b),l(ts),l(es),l(_),l(ns),l(ps),l(q),l(Ms),l(is),l(X),l(ys),l(ms),l(Z),l(rs),l(cs),l(V),l(Js),l(os),l(v),l(Ts),l(js),l(N),l(Us),l(k),l(hs),l(us),l(ws),l(x),l(Is),l(ds),l(F)),l(T),o(U,s),o(u,s),o(d,s),o(C,s),o(g,s),o($,s),o(W,s),o(B,s),o(Y,s),o(Q,s),o(A,s),o(G,s),o(R,s),o(H,s)}}}const Ps='{"title":"使用Trainer API进行超参数搜索","local":"使用trainer-api进行超参数搜索","sections":[{"title":"超参数搜索后端","local":"超参数搜索后端","sections":[],"depth":2},{"title":"如何在示例中启用超参数搜索","local":"如何在示例中启用超参数搜索","sections":[],"depth":2},{"title":"针对DDP微调的超参数搜索","local":"针对ddp微调的超参数搜索","sections":[],"depth":2}],"depth":1}';function Ks(bs){return Hs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ta extends Ss{constructor(T){super(),Fs(this,T,Ks,Ls,Rs,{})}}export{ta as component};
