import{s as Xr,o as zr,n as Qr}from"../chunks/scheduler.78382b47.js";import{S as Or,i as Yr,e as n,s as r,c as u,h as Kr,a as s,d as o,b as a,f as _,g as c,j as i,k as b,l as t,m as T,n as m,t as g,o as f,p as h}from"../chunks/index.6dd35eb6.js";import{C as ea,H as gr,E as ta}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.6888f903.js";import{D as x}from"../chunks/Docstring.286e0aef.js";import{C as ra}from"../chunks/CodeBlock.658dd679.js";import{E as aa}from"../chunks/ExampleCodeBlock.3f133c9f.js";function na(at){let y,X="Example:",k,B,L;return B=new ra({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTBBZnJvbSUyMHBlZnQlMjBpbXBvcnQlMjBQZWZ0TW9kZWwlMEElMEFtb2RlbF9pZCUyMCUzRCUyMC4uLiUwQWJhc2VfbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQpJTBBcGVmdF9tb2RlbF9pZCUyMCUzRCUyMC4uLiUwQW1vZGVsJTIwJTNEJTIwUGVmdE1vZGVsLmZyb21fcHJldHJhaW5lZChiYXNlX21vZGVsJTJDJTIwcGVmdF9tb2RlbF9pZCklMEFtZXJnZWRfbW9kZWwlMjAlM0QlMjBtb2RlbC5tZXJnZV9hbmRfdW5sb2FkKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> peft <span class="hljs-keyword">import</span> PeftModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model_id = ...
<span class="hljs-meta">&gt;&gt;&gt; </span>base_model = AutoModelForCausalLM.from_pretrained(model_id)
<span class="hljs-meta">&gt;&gt;&gt; </span>peft_model_id = ...
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PeftModel.from_pretrained(base_model, peft_model_id)
<span class="hljs-meta">&gt;&gt;&gt; </span>merged_model = model.merge_and_unload()`,wrap:!1}}),{c(){y=n("p"),y.textContent=X,k=r(),u(B.$$.fragment)},l(v){y=s(v,"P",{"data-svelte-h":!0}),i(y)!=="svelte-11lpom8"&&(y.textContent=X),k=a(v),c(B.$$.fragment,v)},m(v,P){T(v,y,P),T(v,k,P),m(B,v,P),L=!0},p:Qr,i(v){L||(g(B.$$.fragment,v),L=!0)},o(v){f(B.$$.fragment,v),L=!1},d(v){v&&(o(y),o(k)),h(B,v)}}}function sa(at){let y,X,k,B,L,v,P,nt,z,fr="A tuner (or adapter) is a module that can be plugged into a <code>torch.nn.Module</code>. <code>BaseTuner</code> base class for other tuners and provides shared methods and attributes for preparing an adapter configuration and replacing a target module with the adapter module. <code>BaseTunerLayer</code> is a base class for adapter layers. It offers methods and attributes for managing adapters such as activating and disabling adapters.",st,Q,ot,l,O,vt,_e,hr=`A base tuner model that provides the common methods and attributes for all tuners that are injectable into a
torch.nn.Module`,$t,be,_r="For adding a new Tuner class, one needs to overwrite the following methods:",xt,ve,br=`<li><strong>_prepare_adapter_config</strong>:
A private method to eventually prepare the adapter config, for example in case the field <code>target_modules</code> is
missing.</li> <li><strong>_create_and_replace</strong>:
A private method to create and replace the target module with the adapter module.</li> <li><strong>_check_target_module_exists</strong>:
A private helper method to check if the passed module’s key name matches any of the target modules in the
adapter_config.</li>`,yt,$e,vr="The easiest is to check what is done in the <code>peft.tuners.lora.LoraModel</code> class.",Tt,Z,Y,Ct,xe,$r="Deletes an existing adapter.",wt,D,K,Bt,ye,xr="Disable all adapters in-place.",Lt,Te,yr="When disabling all adapters, the model output corresponds to the output of the base model.",Mt,N,ee,Pt,Ce,Tr="Enable all adapters in-place",kt,U,te,Dt,we,Cr=`This method gets the config from a model in dictionary form. If model has not attribute config, then this
method returns a default config.`,Et,E,re,jt,Be,wr=`Creates adapter layers and replaces the target modules with the adapter layers. This method is called under the
hood by <code>peft.mapping.get_peft_model</code> if a non-prompt tuning adapter class is passed.`,qt,Le,Br="The corresponding PEFT config is directly retrieved from the <code>peft_config</code> attribute of the BaseTuner class.",Ft,j,ae,It,Me,Lr="This method merges the adapter layers into the base model.",Wt,Pe,Mr=`Merging adapters can lead to a speed up of the forward pass. A copy of the adapter weights is still kept in
memory, which is required to unmerge the adapters. In order to merge the adapter weights without keeping them
in memory, please call <code>merge_and_unload</code>.`,Vt,C,ne,Zt,ke,Pr="This method merges the adapter layers into the base model.",Nt,De,kr=`This is needed if someone wants to use the base model as a standalone model. The returned model has the same
architecture as the original base model.`,Ut,Ee,Dr="It is important to assign the returned model to a variable and use it, this is not an in-place operation!",Ht,H,At,A,se,Jt,je,Er="Set the active adapter(s).",Rt,J,oe,St,qe,jr="Enable or disable gradients on the given adapter(s).",Gt,q,le,Xt,Fe,qr="Return the base model by removing all the PEFT modules.",zt,Ie,Fr="It is important to assign the returned model to a variable and use it, this is not an in-place operation!",Qt,R,de,Ot,We,Ir="This method unmerges all merged adapter layers from the base model.",lt,ie,dt,$,pe,Yt,Ve,Wr="A tuner layer mixin that provides the common methods and attributes for all tuners.",Kt,M,ue,er,Ze,Vr="Delete an adapter from the layer",tr,Ne,Zr="This should be called on all adapter layers, or else we will get an inconsistent state.",rr,Ue,Nr=`This method will also set a new active adapter if the deleted adapter was an active adapter. It is important
that the new adapter is chosen in a deterministic way, so that the same adapter is chosen on all layers.`,ar,F,ce,nr,He,Ur="Toggle the enabling and disabling of adapters",sr,Ae,Hr="Takes care of setting the requires_grad flag for the adapter weights.",or,I,me,lr,Je,Ar="(Recursively) get the base_layer.",dr,Re,Jr="This is necessary for the case that the tuner layer wraps another tuner layer.",ir,W,ge,pr,Se,Rr="Set the active adapter(s).",ur,Ge,Sr=`Additionally, this function will set the specified adapter to trainable (i.e., requires_grad=True) unless
inference_mode is True.`,cr,S,fe,mr,Xe,Gr="Enable or disable gradients on the given adapter(s).",it,he,pt,rt,ut;return L=new ea({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),P=new gr({props:{title:"Tuners",local:"tuners",headingTag:"h1"}}),Q=new gr({props:{title:"BaseTuner",local:"peft.tuners.tuners_utils.BaseTuner",headingTag:"h2"}}),O=new x({props:{name:"class peft.tuners.tuners_utils.BaseTuner",anchor:"peft.tuners.tuners_utils.BaseTuner",parameters:[{name:"model",val:""},{name:"peft_config",val:": Union[PeftConfig, dict[str, PeftConfig]]"},{name:"adapter_name",val:": str"},{name:"low_cpu_mem_usage",val:": bool = False"},{name:"state_dict",val:": Optional[dict[str, torch.Tensor]] = None"}],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTuner.model",description:`<strong>model</strong> (<code>torch.nn.Module</code>) &#x2014;
The model to which the adapter tuner layers will be attached.`,name:"model"},{anchor:"peft.tuners.tuners_utils.BaseTuner.forward",description:`<strong>forward</strong> (<code>Callable</code>) &#x2014;
The forward method of the model.`,name:"forward"},{anchor:"peft.tuners.tuners_utils.BaseTuner.peft_config",description:`<strong>peft_config</strong> (<code>Union[</code>PeftConfig<code>, dict[str, PeftConfig]]</code>) &#x2014;
The adapter configuration object, it should be a dictionary of <code>str</code> to <code>PeftConfig</code> objects. One can also
pass a PeftConfig object and a new adapter will be created with the default name <code>adapter</code> or create a new
dictionary with a key <code>adapter_name</code> and a value of that peft config.`,name:"peft_config"},{anchor:"peft.tuners.tuners_utils.BaseTuner.config",description:`<strong>config</strong> (<code>dict[str, Any]</code>) &#x2014;
The model configuration object, it should be a dictionary of <code>str</code> to <code>Any</code> objects.`,name:"config"},{anchor:"peft.tuners.tuners_utils.BaseTuner.targeted_module_names",description:`<strong>targeted_module_names</strong> (<code>list[str]</code>) &#x2014;
The list of module names that were actually adapted. Can be useful to inspect if you want to quickly
double-check that the <code>config.target_modules</code> were specified correctly.`,name:"targeted_module_names"},{anchor:"peft.tuners.tuners_utils.BaseTuner.targeted_parameter_names",description:`<strong>targeted_parameter_names</strong> (<code>list[str]</code>) &#x2014;
The list of parameter names that were actually adapted. Can be useful to inspect if you want to quickly
double-check that the <code>config.target_parameters</code> were specified correctly.`,name:"targeted_parameter_names"},{anchor:"peft.tuners.tuners_utils.BaseTuner.prefix",description:`<strong>prefix</strong> (<code>str</code>) &#x2014;
The PEFT-method specific unique prefix. E.g. <code>&quot;lora_&quot;</code> for LoRA.`,name:"prefix"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L213"}}),Y=new x({props:{name:"delete_adapter",anchor:"peft.tuners.tuners_utils.BaseTuner.delete_adapter",parameters:[{name:"adapter_name",val:": str"}],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTuner.delete_adapter.adapter_name",description:"<strong>adapter_name</strong> (str) &#x2014; Name of the adapter to be deleted.",name:"adapter_name"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L473"}}),K=new x({props:{name:"disable_adapter_layers",anchor:"peft.tuners.tuners_utils.BaseTuner.disable_adapter_layers",parameters:[],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L449"}}),ee=new x({props:{name:"enable_adapter_layers",anchor:"peft.tuners.tuners_utils.BaseTuner.enable_adapter_layers",parameters:[],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L466"}}),te=new x({props:{name:"get_model_config",anchor:"peft.tuners.tuners_utils.BaseTuner.get_model_config",parameters:[{name:"model",val:": nn.Module"}],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTuner.get_model_config.model",description:`<strong>model</strong> (<code>nn.Module</code>) &#x2014;
Model to get the config from.`,name:"model"},{anchor:"peft.tuners.tuners_utils.BaseTuner.get_model_config.default",description:`<strong>default</strong> (<code>dict|None</code>, <em>optional</em>) &#x2014;:
What to return if model does not have a config attribute.`,name:"default"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L1128"}}),re=new x({props:{name:"inject_adapter",anchor:"peft.tuners.tuners_utils.BaseTuner.inject_adapter",parameters:[{name:"model",val:": nn.Module"},{name:"adapter_name",val:": str"},{name:"autocast_adapter_dtype",val:": bool = True"},{name:"low_cpu_mem_usage",val:": bool = False"},{name:"state_dict",val:": Optional[dict[str, torch.Tensor]] = None"}],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTuner.inject_adapter.model",description:`<strong>model</strong> (<code>nn.Module</code>) &#x2014;
The model to be tuned.`,name:"model"},{anchor:"peft.tuners.tuners_utils.BaseTuner.inject_adapter.adapter_name",description:`<strong>adapter_name</strong> (<code>str</code>) &#x2014;
The adapter name.`,name:"adapter_name"},{anchor:"peft.tuners.tuners_utils.BaseTuner.inject_adapter.autocast_adapter_dtype",description:`<strong>autocast_adapter_dtype</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to autocast the adapter dtype. Defaults to <code>True</code>.`,name:"autocast_adapter_dtype"},{anchor:"peft.tuners.tuners_utils.BaseTuner.inject_adapter.low_cpu_mem_usage",description:`<strong>low_cpu_mem_usage</strong> (<code>bool</code>, <code>optional</code>, defaults to <code>False</code>) &#x2014;
Create empty adapter weights on meta device. Useful to speed up the loading process.`,name:"low_cpu_mem_usage"},{anchor:"peft.tuners.tuners_utils.BaseTuner.inject_adapter.state_dict",description:`<strong>state_dict</strong> (<code>dict</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
If a state_dict is passed here, the adapters will be injected based on the entries of the state_dict.
This can be useful when the exact <code>target_modules</code> of the PEFT method is unknown, for instance because
the checkpoint was created without meta data. Note that the values from the state_dict are not used,
only the keys are used to determine the correct layers that should be adapted.`,name:"state_dict"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L665"}}),ae=new x({props:{name:"merge_adapter",anchor:"peft.tuners.tuners_utils.BaseTuner.merge_adapter",parameters:[{name:"adapter_names",val:": Optional[list[str]] = None"},{name:"safe_merge",val:": bool = False"}],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTuner.merge_adapter.adapter_names",description:`<strong>adapter_names</strong> (<code>list[str]</code>, <em>optional</em>) &#x2014;
The list of adapter names that should be merged. If <code>None</code>, all active adapters will be merged.
Defaults to <code>None</code>.`,name:"adapter_names"},{anchor:"peft.tuners.tuners_utils.BaseTuner.merge_adapter.safe_merge",description:`<strong>safe_merge</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If <code>True</code>, the merge operation will be performed in a copy of the original weights and check for NaNs
before merging the weights. This is useful if you want to check if the merge operation will produce
NaNs. Defaults to <code>False</code>.`,name:"safe_merge"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L1076"}}),ne=new x({props:{name:"merge_and_unload",anchor:"peft.tuners.tuners_utils.BaseTuner.merge_and_unload",parameters:[{name:"progressbar",val:": bool = False"},{name:"safe_merge",val:": bool = False"},{name:"adapter_names",val:": Optional[list[str]] = None"}],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTuner.merge_and_unload.progressbar",description:`<strong>progressbar</strong> (<code>bool</code>) &#x2014;
whether to show a progressbar indicating the unload and merge process (default: False).`,name:"progressbar"},{anchor:"peft.tuners.tuners_utils.BaseTuner.merge_and_unload.safe_merge",description:`<strong>safe_merge</strong> (<code>bool</code>) &#x2014;
whether to activate the safe merging check to check if there is any potential Nan in the adapter
weights.`,name:"safe_merge"},{anchor:"peft.tuners.tuners_utils.BaseTuner.merge_and_unload.adapter_names",description:`<strong>adapter_names</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
The list of adapter names that should be merged. If None, all active adapters will be merged. Defaults
to <code>None</code>.`,name:"adapter_names"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L608"}}),H=new aa({props:{anchor:"peft.tuners.tuners_utils.BaseTuner.merge_and_unload.example",$$slots:{default:[na]},$$scope:{ctx:at}}}),se=new x({props:{name:"set_adapter",anchor:"peft.tuners.tuners_utils.BaseTuner.set_adapter",parameters:[{name:"adapter_name",val:": str | list[str]"},{name:"inference_mode",val:": bool = False"}],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTuner.set_adapter.adapter_name",description:`<strong>adapter_name</strong> (str, list[str]) &#x2014;
The name(s) of the adapter(s) to set as active`,name:"adapter_name"},{anchor:"peft.tuners.tuners_utils.BaseTuner.set_adapter.inference_mode",description:`<strong>inference_mode</strong> (bool, optional) &#x2014;
Whether the activated adapter should be frozen (i.e. <code>requires_grad=False</code>). Default is False.`,name:"inference_mode"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L1114"}}),oe=new x({props:{name:"set_requires_grad",anchor:"peft.tuners.tuners_utils.BaseTuner.set_requires_grad",parameters:[{name:"adapter_names",val:": str | Sequence[str]"},{name:"requires_grad",val:": bool = True"}],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTuner.set_requires_grad.adapter_name",description:`<strong>adapter_name</strong> (<code>str</code> or <code>Sequence[str]</code>) &#x2014;
The name of the adapter(s) whose gradients should be enabled/disabled.`,name:"adapter_name"},{anchor:"peft.tuners.tuners_utils.BaseTuner.set_requires_grad.requires_grad",description:`<strong>requires_grad</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to enable (<code>True</code>, default) or disable (<code>False</code>).`,name:"requires_grad"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L489"}}),le=new x({props:{name:"unload",anchor:"peft.tuners.tuners_utils.BaseTuner.unload",parameters:[],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L646"}}),de=new x({props:{name:"unmerge_adapter",anchor:"peft.tuners.tuners_utils.BaseTuner.unmerge_adapter",parameters:[],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L1105"}}),ie=new gr({props:{title:"BaseTunerLayer",local:"peft.tuners.tuners_utils.BaseTunerLayer",headingTag:"h2"}}),pe=new x({props:{name:"class peft.tuners.tuners_utils.BaseTunerLayer",anchor:"peft.tuners.tuners_utils.BaseTunerLayer",parameters:[],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTunerLayer.is_pluggable",description:`<strong>is_pluggable</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether the adapter layer can be plugged to any pytorch module`,name:"is_pluggable"},{anchor:"peft.tuners.tuners_utils.BaseTunerLayer.active_adapters",description:`<strong>active_adapters</strong> (Union[List<code>str</code>, <code>str</code>], <em>optional</em>) &#x2014;
The name of the active adapter.`,name:"active_adapters"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L1228"}}),ue=new x({props:{name:"delete_adapter",anchor:"peft.tuners.tuners_utils.BaseTunerLayer.delete_adapter",parameters:[{name:"adapter_name",val:": str"}],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTunerLayer.delete_adapter.adapter_name",description:"<strong>adapter_name</strong> (<code>str</code>) &#x2014; The name of the adapter to delete",name:"adapter_name"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L1417"}}),ce=new x({props:{name:"enable_adapters",anchor:"peft.tuners.tuners_utils.BaseTunerLayer.enable_adapters",parameters:[{name:"enabled",val:": bool"}],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTunerLayer.enable_adapters.enabled",description:"<strong>enabled</strong> (bool) &#x2014; True to enable adapters, False to disable adapters",name:"enabled"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L1360"}}),me=new x({props:{name:"get_base_layer",anchor:"peft.tuners.tuners_utils.BaseTunerLayer.get_base_layer",parameters:[],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L1253"}}),ge=new x({props:{name:"set_adapter",anchor:"peft.tuners.tuners_utils.BaseTunerLayer.set_adapter",parameters:[{name:"adapter_names",val:": str | list[str]"},{name:"inference_mode",val:": bool = False"}],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTunerLayer.set_adapter.adapter_name",description:`<strong>adapter_name</strong> (<code>str</code> or <code>list[str]</code>) &#x2014;
The name(s) of the adapter(s) to set as active.`,name:"adapter_name"},{anchor:"peft.tuners.tuners_utils.BaseTunerLayer.set_adapter.inference_mode",description:`<strong>inference_mode</strong> (bool, optional) &#x2014;
Whether the activated adapter should be frozen (i.e. <code>requires_grad=False</code>). Default is False.`,name:"inference_mode"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L1378"}}),fe=new x({props:{name:"set_requires_grad",anchor:"peft.tuners.tuners_utils.BaseTunerLayer.set_requires_grad",parameters:[{name:"adapter_names",val:": str | Sequence[str]"},{name:"requires_grad",val:": bool = True"}],parametersDescription:[{anchor:"peft.tuners.tuners_utils.BaseTunerLayer.set_requires_grad.adapter_name",description:`<strong>adapter_name</strong> (<code>str</code> or <code>Sequence[str]</code>) &#x2014;
The name of the adapter(s) whose gradients should be enabled/disabled.`,name:"adapter_name"},{anchor:"peft.tuners.tuners_utils.BaseTunerLayer.set_requires_grad.requires_grad",description:`<strong>requires_grad</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to enable (<code>True</code>, default) or disable (<code>False</code>).`,name:"requires_grad"}],source:"https://github.com/huggingface/peft/blob/v0.18.0/src/peft/tuners/tuners_utils.py#L1454"}}),he=new ta({props:{source:"https://github.com/huggingface/peft/blob/main/docs/source/package_reference/tuners.md"}}),{c(){y=n("meta"),X=r(),k=n("p"),B=r(),u(L.$$.fragment),v=r(),u(P.$$.fragment),nt=r(),z=n("p"),z.innerHTML=fr,st=r(),u(Q.$$.fragment),ot=r(),l=n("div"),u(O.$$.fragment),vt=r(),_e=n("p"),_e.textContent=hr,$t=r(),be=n("p"),be.textContent=_r,xt=r(),ve=n("ul"),ve.innerHTML=br,yt=r(),$e=n("p"),$e.innerHTML=vr,Tt=r(),Z=n("div"),u(Y.$$.fragment),Ct=r(),xe=n("p"),xe.textContent=$r,wt=r(),D=n("div"),u(K.$$.fragment),Bt=r(),ye=n("p"),ye.textContent=xr,Lt=r(),Te=n("p"),Te.textContent=yr,Mt=r(),N=n("div"),u(ee.$$.fragment),Pt=r(),Ce=n("p"),Ce.textContent=Tr,kt=r(),U=n("div"),u(te.$$.fragment),Dt=r(),we=n("p"),we.textContent=Cr,Et=r(),E=n("div"),u(re.$$.fragment),jt=r(),Be=n("p"),Be.innerHTML=wr,qt=r(),Le=n("p"),Le.innerHTML=Br,Ft=r(),j=n("div"),u(ae.$$.fragment),It=r(),Me=n("p"),Me.textContent=Lr,Wt=r(),Pe=n("p"),Pe.innerHTML=Mr,Vt=r(),C=n("div"),u(ne.$$.fragment),Zt=r(),ke=n("p"),ke.textContent=Pr,Nt=r(),De=n("p"),De.textContent=kr,Ut=r(),Ee=n("p"),Ee.textContent=Dr,Ht=r(),u(H.$$.fragment),At=r(),A=n("div"),u(se.$$.fragment),Jt=r(),je=n("p"),je.textContent=Er,Rt=r(),J=n("div"),u(oe.$$.fragment),St=r(),qe=n("p"),qe.textContent=jr,Gt=r(),q=n("div"),u(le.$$.fragment),Xt=r(),Fe=n("p"),Fe.textContent=qr,zt=r(),Ie=n("p"),Ie.textContent=Fr,Qt=r(),R=n("div"),u(de.$$.fragment),Ot=r(),We=n("p"),We.textContent=Ir,lt=r(),u(ie.$$.fragment),dt=r(),$=n("div"),u(pe.$$.fragment),Yt=r(),Ve=n("p"),Ve.textContent=Wr,Kt=r(),M=n("div"),u(ue.$$.fragment),er=r(),Ze=n("p"),Ze.textContent=Vr,tr=r(),Ne=n("p"),Ne.textContent=Zr,rr=r(),Ue=n("p"),Ue.textContent=Nr,ar=r(),F=n("div"),u(ce.$$.fragment),nr=r(),He=n("p"),He.textContent=Ur,sr=r(),Ae=n("p"),Ae.textContent=Hr,or=r(),I=n("div"),u(me.$$.fragment),lr=r(),Je=n("p"),Je.textContent=Ar,dr=r(),Re=n("p"),Re.textContent=Jr,ir=r(),W=n("div"),u(ge.$$.fragment),pr=r(),Se=n("p"),Se.textContent=Rr,ur=r(),Ge=n("p"),Ge.textContent=Sr,cr=r(),S=n("div"),u(fe.$$.fragment),mr=r(),Xe=n("p"),Xe.textContent=Gr,it=r(),u(he.$$.fragment),pt=r(),rt=n("p"),this.h()},l(e){const p=Kr("svelte-u9bgzb",document.head);y=s(p,"META",{name:!0,content:!0}),p.forEach(o),X=a(e),k=s(e,"P",{}),_(k).forEach(o),B=a(e),c(L.$$.fragment,e),v=a(e),c(P.$$.fragment,e),nt=a(e),z=s(e,"P",{"data-svelte-h":!0}),i(z)!=="svelte-dsnslo"&&(z.innerHTML=fr),st=a(e),c(Q.$$.fragment,e),ot=a(e),l=s(e,"DIV",{class:!0});var d=_(l);c(O.$$.fragment,d),vt=a(d),_e=s(d,"P",{"data-svelte-h":!0}),i(_e)!=="svelte-1k0hvlq"&&(_e.textContent=hr),$t=a(d),be=s(d,"P",{"data-svelte-h":!0}),i(be)!=="svelte-fkgwsm"&&(be.textContent=_r),xt=a(d),ve=s(d,"UL",{"data-svelte-h":!0}),i(ve)!=="svelte-uumdnf"&&(ve.innerHTML=br),yt=a(d),$e=s(d,"P",{"data-svelte-h":!0}),i($e)!=="svelte-1sc4mfu"&&($e.innerHTML=vr),Tt=a(d),Z=s(d,"DIV",{class:!0});var ct=_(Z);c(Y.$$.fragment,ct),Ct=a(ct),xe=s(ct,"P",{"data-svelte-h":!0}),i(xe)!=="svelte-1cw64z1"&&(xe.textContent=$r),ct.forEach(o),wt=a(d),D=s(d,"DIV",{class:!0});var ze=_(D);c(K.$$.fragment,ze),Bt=a(ze),ye=s(ze,"P",{"data-svelte-h":!0}),i(ye)!=="svelte-1hrol74"&&(ye.textContent=xr),Lt=a(ze),Te=s(ze,"P",{"data-svelte-h":!0}),i(Te)!=="svelte-1ecn6m6"&&(Te.textContent=yr),ze.forEach(o),Mt=a(d),N=s(d,"DIV",{class:!0});var mt=_(N);c(ee.$$.fragment,mt),Pt=a(mt),Ce=s(mt,"P",{"data-svelte-h":!0}),i(Ce)!=="svelte-1l6xdbj"&&(Ce.textContent=Tr),mt.forEach(o),kt=a(d),U=s(d,"DIV",{class:!0});var gt=_(U);c(te.$$.fragment,gt),Dt=a(gt),we=s(gt,"P",{"data-svelte-h":!0}),i(we)!=="svelte-wp66wq"&&(we.textContent=Cr),gt.forEach(o),Et=a(d),E=s(d,"DIV",{class:!0});var Qe=_(E);c(re.$$.fragment,Qe),jt=a(Qe),Be=s(Qe,"P",{"data-svelte-h":!0}),i(Be)!=="svelte-1ybn6sj"&&(Be.innerHTML=wr),qt=a(Qe),Le=s(Qe,"P",{"data-svelte-h":!0}),i(Le)!=="svelte-fvf2kw"&&(Le.innerHTML=Br),Qe.forEach(o),Ft=a(d),j=s(d,"DIV",{class:!0});var Oe=_(j);c(ae.$$.fragment,Oe),It=a(Oe),Me=s(Oe,"P",{"data-svelte-h":!0}),i(Me)!=="svelte-kun7ud"&&(Me.textContent=Lr),Wt=a(Oe),Pe=s(Oe,"P",{"data-svelte-h":!0}),i(Pe)!=="svelte-1f1s101"&&(Pe.innerHTML=Mr),Oe.forEach(o),Vt=a(d),C=s(d,"DIV",{class:!0});var V=_(C);c(ne.$$.fragment,V),Zt=a(V),ke=s(V,"P",{"data-svelte-h":!0}),i(ke)!=="svelte-kun7ud"&&(ke.textContent=Pr),Nt=a(V),De=s(V,"P",{"data-svelte-h":!0}),i(De)!=="svelte-1xvyps2"&&(De.textContent=kr),Ut=a(V),Ee=s(V,"P",{"data-svelte-h":!0}),i(Ee)!=="svelte-1t73dx4"&&(Ee.textContent=Dr),Ht=a(V),c(H.$$.fragment,V),V.forEach(o),At=a(d),A=s(d,"DIV",{class:!0});var ft=_(A);c(se.$$.fragment,ft),Jt=a(ft),je=s(ft,"P",{"data-svelte-h":!0}),i(je)!=="svelte-8teaja"&&(je.textContent=Er),ft.forEach(o),Rt=a(d),J=s(d,"DIV",{class:!0});var ht=_(J);c(oe.$$.fragment,ht),St=a(ht),qe=s(ht,"P",{"data-svelte-h":!0}),i(qe)!=="svelte-aqtirv"&&(qe.textContent=jr),ht.forEach(o),Gt=a(d),q=s(d,"DIV",{class:!0});var Ye=_(q);c(le.$$.fragment,Ye),Xt=a(Ye),Fe=s(Ye,"P",{"data-svelte-h":!0}),i(Fe)!=="svelte-5oaxgp"&&(Fe.textContent=qr),zt=a(Ye),Ie=s(Ye,"P",{"data-svelte-h":!0}),i(Ie)!=="svelte-1t73dx4"&&(Ie.textContent=Fr),Ye.forEach(o),Qt=a(d),R=s(d,"DIV",{class:!0});var _t=_(R);c(de.$$.fragment,_t),Ot=a(_t),We=s(_t,"P",{"data-svelte-h":!0}),i(We)!=="svelte-2eloeq"&&(We.textContent=Ir),_t.forEach(o),d.forEach(o),lt=a(e),c(ie.$$.fragment,e),dt=a(e),$=s(e,"DIV",{class:!0});var w=_($);c(pe.$$.fragment,w),Yt=a(w),Ve=s(w,"P",{"data-svelte-h":!0}),i(Ve)!=="svelte-1fdxdjn"&&(Ve.textContent=Wr),Kt=a(w),M=s(w,"DIV",{class:!0});var G=_(M);c(ue.$$.fragment,G),er=a(G),Ze=s(G,"P",{"data-svelte-h":!0}),i(Ze)!=="svelte-950rwb"&&(Ze.textContent=Vr),tr=a(G),Ne=s(G,"P",{"data-svelte-h":!0}),i(Ne)!=="svelte-1nnxg1l"&&(Ne.textContent=Zr),rr=a(G),Ue=s(G,"P",{"data-svelte-h":!0}),i(Ue)!=="svelte-1vxxy19"&&(Ue.textContent=Nr),G.forEach(o),ar=a(w),F=s(w,"DIV",{class:!0});var Ke=_(F);c(ce.$$.fragment,Ke),nr=a(Ke),He=s(Ke,"P",{"data-svelte-h":!0}),i(He)!=="svelte-2or2k8"&&(He.textContent=Ur),sr=a(Ke),Ae=s(Ke,"P",{"data-svelte-h":!0}),i(Ae)!=="svelte-ujp0ui"&&(Ae.textContent=Hr),Ke.forEach(o),or=a(w),I=s(w,"DIV",{class:!0});var et=_(I);c(me.$$.fragment,et),lr=a(et),Je=s(et,"P",{"data-svelte-h":!0}),i(Je)!=="svelte-6rdpda"&&(Je.textContent=Ar),dr=a(et),Re=s(et,"P",{"data-svelte-h":!0}),i(Re)!=="svelte-dptqqh"&&(Re.textContent=Jr),et.forEach(o),ir=a(w),W=s(w,"DIV",{class:!0});var tt=_(W);c(ge.$$.fragment,tt),pr=a(tt),Se=s(tt,"P",{"data-svelte-h":!0}),i(Se)!=="svelte-8teaja"&&(Se.textContent=Rr),ur=a(tt),Ge=s(tt,"P",{"data-svelte-h":!0}),i(Ge)!=="svelte-1020tdh"&&(Ge.textContent=Sr),tt.forEach(o),cr=a(w),S=s(w,"DIV",{class:!0});var bt=_(S);c(fe.$$.fragment,bt),mr=a(bt),Xe=s(bt,"P",{"data-svelte-h":!0}),i(Xe)!=="svelte-aqtirv"&&(Xe.textContent=Gr),bt.forEach(o),w.forEach(o),it=a(e),c(he.$$.fragment,e),pt=a(e),rt=s(e,"P",{}),_(rt).forEach(o),this.h()},h(){b(y,"name","hf:doc:metadata"),b(y,"content",oa),b(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(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(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(l,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(S,"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")},m(e,p){t(document.head,y),T(e,X,p),T(e,k,p),T(e,B,p),m(L,e,p),T(e,v,p),m(P,e,p),T(e,nt,p),T(e,z,p),T(e,st,p),m(Q,e,p),T(e,ot,p),T(e,l,p),m(O,l,null),t(l,vt),t(l,_e),t(l,$t),t(l,be),t(l,xt),t(l,ve),t(l,yt),t(l,$e),t(l,Tt),t(l,Z),m(Y,Z,null),t(Z,Ct),t(Z,xe),t(l,wt),t(l,D),m(K,D,null),t(D,Bt),t(D,ye),t(D,Lt),t(D,Te),t(l,Mt),t(l,N),m(ee,N,null),t(N,Pt),t(N,Ce),t(l,kt),t(l,U),m(te,U,null),t(U,Dt),t(U,we),t(l,Et),t(l,E),m(re,E,null),t(E,jt),t(E,Be),t(E,qt),t(E,Le),t(l,Ft),t(l,j),m(ae,j,null),t(j,It),t(j,Me),t(j,Wt),t(j,Pe),t(l,Vt),t(l,C),m(ne,C,null),t(C,Zt),t(C,ke),t(C,Nt),t(C,De),t(C,Ut),t(C,Ee),t(C,Ht),m(H,C,null),t(l,At),t(l,A),m(se,A,null),t(A,Jt),t(A,je),t(l,Rt),t(l,J),m(oe,J,null),t(J,St),t(J,qe),t(l,Gt),t(l,q),m(le,q,null),t(q,Xt),t(q,Fe),t(q,zt),t(q,Ie),t(l,Qt),t(l,R),m(de,R,null),t(R,Ot),t(R,We),T(e,lt,p),m(ie,e,p),T(e,dt,p),T(e,$,p),m(pe,$,null),t($,Yt),t($,Ve),t($,Kt),t($,M),m(ue,M,null),t(M,er),t(M,Ze),t(M,tr),t(M,Ne),t(M,rr),t(M,Ue),t($,ar),t($,F),m(ce,F,null),t(F,nr),t(F,He),t(F,sr),t(F,Ae),t($,or),t($,I),m(me,I,null),t(I,lr),t(I,Je),t(I,dr),t(I,Re),t($,ir),t($,W),m(ge,W,null),t(W,pr),t(W,Se),t(W,ur),t(W,Ge),t($,cr),t($,S),m(fe,S,null),t(S,mr),t(S,Xe),T(e,it,p),m(he,e,p),T(e,pt,p),T(e,rt,p),ut=!0},p(e,[p]){const d={};p&2&&(d.$$scope={dirty:p,ctx:e}),H.$set(d)},i(e){ut||(g(L.$$.fragment,e),g(P.$$.fragment,e),g(Q.$$.fragment,e),g(O.$$.fragment,e),g(Y.$$.fragment,e),g(K.$$.fragment,e),g(ee.$$.fragment,e),g(te.$$.fragment,e),g(re.$$.fragment,e),g(ae.$$.fragment,e),g(ne.$$.fragment,e),g(H.$$.fragment,e),g(se.$$.fragment,e),g(oe.$$.fragment,e),g(le.$$.fragment,e),g(de.$$.fragment,e),g(ie.$$.fragment,e),g(pe.$$.fragment,e),g(ue.$$.fragment,e),g(ce.$$.fragment,e),g(me.$$.fragment,e),g(ge.$$.fragment,e),g(fe.$$.fragment,e),g(he.$$.fragment,e),ut=!0)},o(e){f(L.$$.fragment,e),f(P.$$.fragment,e),f(Q.$$.fragment,e),f(O.$$.fragment,e),f(Y.$$.fragment,e),f(K.$$.fragment,e),f(ee.$$.fragment,e),f(te.$$.fragment,e),f(re.$$.fragment,e),f(ae.$$.fragment,e),f(ne.$$.fragment,e),f(H.$$.fragment,e),f(se.$$.fragment,e),f(oe.$$.fragment,e),f(le.$$.fragment,e),f(de.$$.fragment,e),f(ie.$$.fragment,e),f(pe.$$.fragment,e),f(ue.$$.fragment,e),f(ce.$$.fragment,e),f(me.$$.fragment,e),f(ge.$$.fragment,e),f(fe.$$.fragment,e),f(he.$$.fragment,e),ut=!1},d(e){e&&(o(X),o(k),o(B),o(v),o(nt),o(z),o(st),o(ot),o(l),o(lt),o(dt),o($),o(it),o(pt),o(rt)),o(y),h(L,e),h(P,e),h(Q,e),h(O),h(Y),h(K),h(ee),h(te),h(re),h(ae),h(ne),h(H),h(se),h(oe),h(le),h(de),h(ie,e),h(pe),h(ue),h(ce),h(me),h(ge),h(fe),h(he,e)}}}const oa='{"title":"Tuners","local":"tuners","sections":[{"title":"BaseTuner","local":"peft.tuners.tuners_utils.BaseTuner","sections":[],"depth":2},{"title":"BaseTunerLayer","local":"peft.tuners.tuners_utils.BaseTunerLayer","sections":[],"depth":2}],"depth":1}';function la(at){return zr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ga extends Or{constructor(y){super(),Yr(this,y,la,sa,Xr,{})}}export{ga as component};
