import{s as Rs,n as Hs,o as xs}from"../chunks/scheduler.9991993c.js";import{S as Ss,i as zs,g as p,s as e,r as i,A as Fs,h as M,f as l,c as n,j as Gs,u as y,x as m,k as Ns,y as Es,a as t,v as r,d as J,t as c,w as T}from"../chunks/index.7fc9a5e7.js";import{C as j}from"../chunks/CodeBlock.e11cba92.js";import{H as fs,E as Ds}from"../chunks/EditOnGithub.84ab7f0e.js";function Ls(bs){let o,F,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,Xs='对于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,_,Ws='对于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,X,is,W,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,Js,V,Vs="定义一个<code>model_init</code>函数并将其传递给[Trainer]，作为示例：",cs,v,Ts,Q,vs="使用你的<code>model_init</code>函数、训练参数、训练和测试数据集以及评估函数创建一个<code>Trainer</code>。",os,k,js,A,Qs="调用超参数搜索，获取最佳试验参数，后端可以是<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,G,ks="您可以定义自己的compute_objective函数，如果没有定义，将调用默认的compute_objective，并将评估指标（如f1）之和作为目标值返回。",hs,N,us,R,ws,H,As="目前，Optuna和Sigopt已启用针对DDP的超参数搜索。只有rank-zero进程会进行超参数搜索并将参数传递给其他进程。",Is,x,ds,z,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:"cGlwJTIwaW5zdGFsbCUyMG9wdHVuYSUyRnNpZ29wdCUyRndhbmRiJTJGcmF5JTVCdHVuZSU1RCUyMA==",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}}),X=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}}),v=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}}),k=new j({props:{code:"dHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0ROb25lJTJDJTBBJTIwJTIwJTIwJTIwYXJncyUzRHRyYWluaW5nX2FyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEc21hbGxfdHJhaW5fZGF0YXNldCUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRHNtYWxsX2V2YWxfZGF0YXNldCUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfbWV0cmljcyUzRGNvbXB1dGVfbWV0cmljcyUyQyUwQSUyMCUyMCUyMCUyMHRva2VuaXplciUzRHRva2VuaXplciUyQyUwQSUyMCUyMCUyMCUyMG1vZGVsX2luaXQlM0Rtb2RlbF9pbml0JTJDJTBBJTIwJTIwJTIwJTIwZGF0YV9jb2xsYXRvciUzRGRhdGFfY29sbGF0b3IlMkMlMEEp",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>    tokenizer=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}}),N=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"}}),x=new Ds({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/zh/hpo_train.md"}}),{c(){o=p("meta"),F=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=Xs,ts=e(),i(g.$$.fragment),es=e(),_=p("p"),_.innerHTML=Ws,ns=e(),i($.$$.fragment),ps=e(),q=p("p"),q.innerHTML=Bs,Ms=e(),i(X.$$.fragment),is=e(),W=p("p"),W.innerHTML=Zs,ys=e(),i(B.$$.fragment),ms=e(),Z=p("p"),Z.innerHTML=Ys,rs=e(),i(Y.$$.fragment),Js=e(),V=p("p"),V.innerHTML=Vs,cs=e(),i(v.$$.fragment),Ts=e(),Q=p("p"),Q.innerHTML=vs,os=e(),i(k.$$.fragment),js=e(),A=p("p"),A.innerHTML=Qs,Us=e(),G=p("p"),G.textContent=ks,hs=e(),i(N.$$.fragment),us=e(),i(R.$$.fragment),ws=e(),H=p("p"),H.textContent=As,Is=e(),i(x.$$.fragment),ds=e(),z=p("p"),this.h()},l(s){const a=Fs("svelte-u9bgzb",document.head);o=M(a,"META",{name:!0,content:!0}),a.forEach(l),F=n(s),S=M(s,"P",{}),Gs(S).forEach(l),E=n(s),y(U.$$.fragment,s),D=n(s),h=M(s,"P",{"data-svelte-h":!0}),m(h)!=="svelte-8j0u42"&&(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=Xs),ts=n(s),y(g.$$.fragment,s),es=n(s),_=M(s,"P",{"data-svelte-h":!0}),m(_)!=="svelte-1q93awm"&&(_.innerHTML=Ws),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(X.$$.fragment,s),is=n(s),W=M(s,"P",{"data-svelte-h":!0}),m(W)!=="svelte-1w57ahn"&&(W.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),Js=n(s),V=M(s,"P",{"data-svelte-h":!0}),m(V)!=="svelte-1ik81ii"&&(V.innerHTML=Vs),cs=n(s),y(v.$$.fragment,s),Ts=n(s),Q=M(s,"P",{"data-svelte-h":!0}),m(Q)!=="svelte-w9fjru"&&(Q.innerHTML=vs),os=n(s),y(k.$$.fragment,s),js=n(s),A=M(s,"P",{"data-svelte-h":!0}),m(A)!=="svelte-1fogicn"&&(A.innerHTML=Qs),Us=n(s),G=M(s,"P",{"data-svelte-h":!0}),m(G)!=="svelte-1k3ogdl"&&(G.textContent=ks),hs=n(s),y(N.$$.fragment,s),us=n(s),y(R.$$.fragment,s),ws=n(s),H=M(s,"P",{"data-svelte-h":!0}),m(H)!=="svelte-wf0c68"&&(H.textContent=As),Is=n(s),y(x.$$.fragment,s),ds=n(s),z=M(s,"P",{}),Gs(z).forEach(l),this.h()},h(){Ns(o,"name","hf:doc:metadata"),Ns(o,"content",Ps)},m(s,a){Es(document.head,o),t(s,F,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(X,s,a),t(s,is,a),t(s,W,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,Js,a),t(s,V,a),t(s,cs,a),r(v,s,a),t(s,Ts,a),t(s,Q,a),t(s,os,a),r(k,s,a),t(s,js,a),t(s,A,a),t(s,Us,a),t(s,G,a),t(s,hs,a),r(N,s,a),t(s,us,a),r(R,s,a),t(s,ws,a),t(s,H,a),t(s,Is,a),r(x,s,a),t(s,ds,a),t(s,z,a),Cs=!0},p:Hs,i(s){Cs||(J(U.$$.fragment,s),J(u.$$.fragment,s),J(d.$$.fragment,s),J(C.$$.fragment,s),J(g.$$.fragment,s),J($.$$.fragment,s),J(X.$$.fragment,s),J(B.$$.fragment,s),J(Y.$$.fragment,s),J(v.$$.fragment,s),J(k.$$.fragment,s),J(N.$$.fragment,s),J(R.$$.fragment,s),J(x.$$.fragment,s),Cs=!0)},o(s){c(U.$$.fragment,s),c(u.$$.fragment,s),c(d.$$.fragment,s),c(C.$$.fragment,s),c(g.$$.fragment,s),c($.$$.fragment,s),c(X.$$.fragment,s),c(B.$$.fragment,s),c(Y.$$.fragment,s),c(v.$$.fragment,s),c(k.$$.fragment,s),c(N.$$.fragment,s),c(R.$$.fragment,s),c(x.$$.fragment,s),Cs=!1},d(s){s&&(l(F),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(W),l(ys),l(ms),l(Z),l(rs),l(Js),l(V),l(cs),l(Ts),l(Q),l(os),l(js),l(A),l(Us),l(G),l(hs),l(us),l(ws),l(H),l(Is),l(ds),l(z)),l(o),T(U,s),T(u,s),T(d,s),T(C,s),T(g,s),T($,s),T(X,s),T(B,s),T(Y,s),T(v,s),T(k,s),T(N,s),T(R,s),T(x,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 xs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ta extends Ss{constructor(o){super(),zs(this,o,Ks,Ls,Rs,{})}}export{ta as component};
