Buckets:

rtrm's picture
download
raw
45.7 kB
import{s as da,o as pa,n as tt}from"../chunks/scheduler.c57aa7ef.js";import{S as ca,i as ma,g as o,s as a,r as h,A as fa,h as s,f as l,c as n,j as x,u as g,x as f,k as C,y as t,a as u,v as _,d as b,t as y,w as M}from"../chunks/index.c50cb18e.js";import{D as J}from"../chunks/Docstring.66f18243.js";import{C as at}from"../chunks/CodeBlock.34f0a53d.js";import{E as Ke}from"../chunks/ExampleCodeBlock.b5ddd071.js";import{H as et,E as ha}from"../chunks/EditOnGithub.958a8a49.js";function ga(U){let r,w="Example:",d,v,T;return v=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTSUwQWZyb20lMjBwZWZ0JTIwaW1wb3J0JTIwTG9yYU1vZGVsJTJDJTIwTG9yYUNvbmZpZyUwQSUwQWNvbmZpZyUyMCUzRCUyMExvcmFDb25maWcoJTBBJTIwJTIwJTIwJTIwdGFza190eXBlJTNEJTIyU0VRXzJfU0VRX0xNJTIyJTJDJTBBJTIwJTIwJTIwJTIwciUzRDglMkMlMEElMjAlMjAlMjAlMjBsb3JhX2FscGhhJTNEMzIlMkMlMEElMjAlMjAlMjAlMjB0YXJnZXRfbW9kdWxlcyUzRCU1QiUyMnElMjIlMkMlMjAlMjJ2JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwbG9yYV9kcm9wb3V0JTNEMC4wMSUyQyUwQSklMEElMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclNlcTJTZXFMTS5mcm9tX3ByZXRyYWluZWQoJTIydDUtYmFzZSUyMiklMEFsb3JhX21vZGVsJTIwJTNEJTIwTG9yYU1vZGVsKG1vZGVsJTJDJTIwY29uZmlnJTJDJTIwJTIyZGVmYXVsdCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSeq2SeqLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> peft <span class="hljs-keyword">import</span> LoraModel, LoraConfig
<span class="hljs-meta">&gt;&gt;&gt; </span>config = LoraConfig(
<span class="hljs-meta">... </span> task_type=<span class="hljs-string">&quot;SEQ_2_SEQ_LM&quot;</span>,
<span class="hljs-meta">... </span> r=<span class="hljs-number">8</span>,
<span class="hljs-meta">... </span> lora_alpha=<span class="hljs-number">32</span>,
<span class="hljs-meta">... </span> target_modules=[<span class="hljs-string">&quot;q&quot;</span>, <span class="hljs-string">&quot;v&quot;</span>],
<span class="hljs-meta">... </span> lora_dropout=<span class="hljs-number">0.01</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSeq2SeqLM.from_pretrained(<span class="hljs-string">&quot;t5-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>lora_model = LoraModel(model, config, <span class="hljs-string">&quot;default&quot;</span>)`,wrap:!1}}),{c(){r=o("p"),r.textContent=w,d=a(),h(v.$$.fragment)},l(c){r=s(c,"P",{"data-svelte-h":!0}),f(r)!=="svelte-11lpom8"&&(r.textContent=w),d=n(c),g(v.$$.fragment,c)},m(c,$){u(c,r,$),u(c,d,$),_(v,c,$),T=!0},p:tt,i(c){T||(b(v.$$.fragment,c),T=!0)},o(c){y(v.$$.fragment,c),T=!1},d(c){c&&(l(r),l(d)),M(v,c)}}}function ua(U){let r,w;return r=new at({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0cmFuc2Zvcm1lcnMlMEFmcm9tJTIwcGVmdCUyMGltcG9ydCUyMExvcmFDb25maWclMkMlMjBQZWZ0TW9kZWwlMkMlMjBnZXRfcGVmdF9tb2RlbCUyQyUyMHByZXBhcmVfbW9kZWxfZm9yX2tiaXRfdHJhaW5pbmclMEElMEFyYW5rJTIwJTNEJTIwLi4uJTBBdGFyZ2V0X21vZHVsZXMlMjAlM0QlMjAlNUIlMjJxX3Byb2olMjIlMkMlMjAlMjJrX3Byb2olMjIlMkMlMjAlMjJ2X3Byb2olMjIlMkMlMjAlMjJvdXRfcHJvaiUyMiUyQyUyMCUyMmZjX2luJTIyJTJDJTIwJTIyZmNfb3V0JTIyJTJDJTIwJTIyd3RlJTIyJTVEJTBBY29uZmlnJTIwJTNEJTIwTG9yYUNvbmZpZyglMEElMjAlMjAlMjAlMjByJTNENCUyQyUyMGxvcmFfYWxwaGElM0QxNiUyQyUyMHRhcmdldF9tb2R1bGVzJTNEdGFyZ2V0X21vZHVsZXMlMkMlMjBsb3JhX2Ryb3BvdXQlM0QwLjElMkMlMjBiaWFzJTNEJTIybm9uZSUyMiUyQyUyMHRhc2tfdHlwZSUzRCUyMkNBVVNBTF9MTSUyMiUwQSklMEFxdWFudGl6YXRpb25fY29uZmlnJTIwJTNEJTIwdHJhbnNmb3JtZXJzLkJpdHNBbmRCeXRlc0NvbmZpZyhsb2FkX2luXzhiaXQlM0RUcnVlKSUwQSUwQXRva2VuaXplciUyMCUzRCUyMHRyYW5zZm9ybWVycy5BdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYWthb2JyYWluJTJGa29ncHQlMjIlMkMlMEElMjAlMjAlMjAlMjByZXZpc2lvbiUzRCUyMktvR1BUNkItcnlhbjEuNWItZmxvYXQxNiUyMiUyQyUyMCUyMCUyMyUyMG9yJTIwZmxvYXQzMiUyMHZlcnNpb24lM0ElMjByZXZpc2lvbiUzREtvR1BUNkItcnlhbjEuNWIlMEElMjAlMjAlMjAlMjBib3NfdG9rZW4lM0QlMjIlNUJCT1MlNUQlMjIlMkMlMEElMjAlMjAlMjAlMjBlb3NfdG9rZW4lM0QlMjIlNUJFT1MlNUQlMjIlMkMlMEElMjAlMjAlMjAlMjB1bmtfdG9rZW4lM0QlMjIlNUJVTkslNUQlMjIlMkMlMEElMjAlMjAlMjAlMjBwYWRfdG9rZW4lM0QlMjIlNUJQQUQlNUQlMjIlMkMlMEElMjAlMjAlMjAlMjBtYXNrX3Rva2VuJTNEJTIyJTVCTUFTSyU1RCUyMiUyQyUwQSklMEFtb2RlbCUyMCUzRCUyMHRyYW5zZm9ybWVycy5HUFRKRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmtha2FvYnJhaW4lMkZrb2dwdCUyMiUyQyUwQSUyMCUyMCUyMCUyMHJldmlzaW9uJTNEJTIyS29HUFQ2Qi1yeWFuMS41Yi1mbG9hdDE2JTIyJTJDJTIwJTIwJTIzJTIwb3IlMjBmbG9hdDMyJTIwdmVyc2lvbiUzQSUyMHJldmlzaW9uJTNES29HUFQ2Qi1yeWFuMS41YiUwQSUyMCUyMCUyMCUyMHBhZF90b2tlbl9pZCUzRHRva2VuaXplci5lb3NfdG9rZW5faWQlMkMlMEElMjAlMjAlMjAlMjB1c2VfY2FjaGUlM0RGYWxzZSUyQyUwQSUyMCUyMCUyMCUyMGRldmljZV9tYXAlM0QlN0IlMjIlMjIlM0ElMjByYW5rJTdEJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwcXVhbnRpemF0aW9uX2NvbmZpZyUzRHF1YW50aXphdGlvbl9jb25maWclMkMlMEEpJTBBbW9kZWwlMjAlM0QlMjBwcmVwYXJlX21vZGVsX2Zvcl9rYml0X3RyYWluaW5nKG1vZGVsKSUwQWxvcmFfbW9kZWwlMjAlM0QlMjBnZXRfcGVmdF9tb2RlbChtb2RlbCUyQyUyMGNvbmZpZyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> transformers
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> peft <span class="hljs-keyword">import</span> LoraConfig, PeftModel, get_peft_model, prepare_model_for_kbit_training
<span class="hljs-meta">&gt;&gt;&gt; </span>rank = ...
<span class="hljs-meta">&gt;&gt;&gt; </span>target_modules = [<span class="hljs-string">&quot;q_proj&quot;</span>, <span class="hljs-string">&quot;k_proj&quot;</span>, <span class="hljs-string">&quot;v_proj&quot;</span>, <span class="hljs-string">&quot;out_proj&quot;</span>, <span class="hljs-string">&quot;fc_in&quot;</span>, <span class="hljs-string">&quot;fc_out&quot;</span>, <span class="hljs-string">&quot;wte&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>config = LoraConfig(
<span class="hljs-meta">... </span> r=<span class="hljs-number">4</span>, lora_alpha=<span class="hljs-number">16</span>, target_modules=target_modules, lora_dropout=<span class="hljs-number">0.1</span>, bias=<span class="hljs-string">&quot;none&quot;</span>, task_type=<span class="hljs-string">&quot;CAUSAL_LM&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>quantization_config = transformers.BitsAndBytesConfig(load_in_8bit=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = transformers.AutoTokenizer.from_pretrained(
<span class="hljs-meta">... </span> <span class="hljs-string">&quot;kakaobrain/kogpt&quot;</span>,
<span class="hljs-meta">... </span> revision=<span class="hljs-string">&quot;KoGPT6B-ryan1.5b-float16&quot;</span>, <span class="hljs-comment"># or float32 version: revision=KoGPT6B-ryan1.5b</span>
<span class="hljs-meta">... </span> bos_token=<span class="hljs-string">&quot;[BOS]&quot;</span>,
<span class="hljs-meta">... </span> eos_token=<span class="hljs-string">&quot;[EOS]&quot;</span>,
<span class="hljs-meta">... </span> unk_token=<span class="hljs-string">&quot;[UNK]&quot;</span>,
<span class="hljs-meta">... </span> pad_token=<span class="hljs-string">&quot;[PAD]&quot;</span>,
<span class="hljs-meta">... </span> mask_token=<span class="hljs-string">&quot;[MASK]&quot;</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = transformers.GPTJForCausalLM.from_pretrained(
<span class="hljs-meta">... </span> <span class="hljs-string">&quot;kakaobrain/kogpt&quot;</span>,
<span class="hljs-meta">... </span> revision=<span class="hljs-string">&quot;KoGPT6B-ryan1.5b-float16&quot;</span>, <span class="hljs-comment"># or float32 version: revision=KoGPT6B-ryan1.5b</span>
<span class="hljs-meta">... </span> pad_token_id=tokenizer.eos_token_id,
<span class="hljs-meta">... </span> use_cache=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span> device_map={<span class="hljs-string">&quot;&quot;</span>: rank},
<span class="hljs-meta">... </span> torch_dtype=torch.float16,
<span class="hljs-meta">... </span> quantization_config=quantization_config,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = prepare_model_for_kbit_training(model)
<span class="hljs-meta">&gt;&gt;&gt; </span>lora_model = get_peft_model(model, config)`,wrap:!1}}),{c(){h(r.$$.fragment)},l(d){g(r.$$.fragment,d)},m(d,v){_(r,d,v),w=!0},p:tt,i(d){w||(b(r.$$.fragment,d),w=!0)},o(d){y(r.$$.fragment,d),w=!1},d(d){M(r,d)}}}function _a(U){let r,w="Example:",d,v,T;return v=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTBBZnJvbSUyMHBlZnQlMjBpbXBvcnQlMjBQZWZ0TW9kZWwlMEElMEFiYXNlX21vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMnRpaXVhZSUyRmZhbGNvbi00MGIlMjIpJTBBcGVmdF9tb2RlbF9pZCUyMCUzRCUyMCUyMnNtYW5ncnVsJTJGZmFsY29uLTQwQi1pbnQ0LXBlZnQtbG9yYS1zZnR0cmFpbmVyLXNhbXBsZSUyMiUwQW1vZGVsJTIwJTNEJTIwUGVmdE1vZGVsLmZyb21fcHJldHJhaW5lZChiYXNlX21vZGVsJTJDJTIwcGVmdF9tb2RlbF9pZCklMEFtZXJnZWRfbW9kZWwlMjAlM0QlMjBtb2RlbC5tZXJnZV9hbmRfdW5sb2FkKCk=",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>base_model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;tiiuae/falcon-40b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>peft_model_id = <span class="hljs-string">&quot;smangrul/falcon-40B-int4-peft-lora-sfttrainer-sample&quot;</span>
<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(){r=o("p"),r.textContent=w,d=a(),h(v.$$.fragment)},l(c){r=s(c,"P",{"data-svelte-h":!0}),f(r)!=="svelte-11lpom8"&&(r.textContent=w),d=n(c),g(v.$$.fragment,c)},m(c,$){u(c,r,$),u(c,d,$),_(v,c,$),T=!0},p:tt,i(c){T||(b(v.$$.fragment,c),T=!0)},o(c){y(v.$$.fragment,c),T=!1},d(c){c&&(l(r),l(d)),M(v,c)}}}function ba(U){let r,w;return r=new at({props:{code:"Zm9yJTIwbmFtZSUyQyUyMHBhcmFtJTIwaW4lMjBtb2RlbF9wZWZ0Lm5hbWVkX3BhcmFtZXRlcnMoKSUzQSUwQSUyMCUyMCUyMCUyMGlmJTIwLi4uJTNBJTIwJTIwJTIzJTIwc29tZSUyMGNoZWNrJTIwb24lMjBuYW1lJTIwKGV4LiUyMGlmJTIwJ2xvcmEnJTIwaW4lMjBuYW1lKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHBhcmFtLnJlcXVpcmVzX2dyYWQlMjAlM0QlMjBGYWxzZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> name, param <span class="hljs-keyword">in</span> model_peft.named_parameters():
<span class="hljs-meta">... </span> <span class="hljs-keyword">if</span> ...: <span class="hljs-comment"># some check on name (ex. if &#x27;lora&#x27; in name)</span>
<span class="hljs-meta">... </span> param.requires_grad = <span class="hljs-literal">False</span>`,wrap:!1}}),{c(){h(r.$$.fragment)},l(d){g(r.$$.fragment,d)},m(d,v){_(r,d,v),w=!0},p:tt,i(d){w||(b(r.$$.fragment,d),w=!0)},o(d){y(r.$$.fragment,d),w=!1},d(d){M(r,d)}}}function ya(U){let r,w,d,v,T,c,$,Nt='Low-Rank Adaptation (<a href="https://huggingface.co/papers/2309.15223" rel="nofollow">LoRA</a>) is a PEFT method that decomposes a large matrix into two smaller low-rank matrices in the attention layers. This drastically reduces the number of parameters that need to be fine-tuned.',Be,D,Bt="The abstract from the paper is:",We,P,Wt="<em>We propose a neural language modeling system based on low-rank adaptation (LoRA) for speech recognition output rescoring. Although pretrained language models (LMs) like BERT have shown superior performance in second-pass rescoring, the high computational cost of scaling up the pretraining stage and adapting the pretrained models to specific domains limit their practical use in rescoring. Here we present a method based on low-rank decomposition to train a rescoring BERT model and adapt it to new domains using only a fraction (0.08%) of the pretrained parameters. These inserted matrices are optimized through a discriminative training objective along with a correlation-based regularization loss. The proposed low-rank adaptation Rescore-BERT (LoRB) architecture is evaluated on LibriSpeech and internal datasets with decreased training times by factors between 5.4 and 3.6.</em>.",Qe,H,Ve,k,Y,nt,fe,Qt='This is the configuration class to store the configuration of a <a href="/docs/peft/main/en/package_reference/lora#peft.LoraModel">LoraModel</a>.',ot,B,O,st,he,Vt="Returns the configuration for your adapter model as a dictionary. Removes runtime configurations.",Fe,K,Se,p,ee,rt,ge,Ft="Creates Low Rank Adapter (LoRA) model from a pretrained transformers model.",lt,ue,St='The method is described in detail in <a href="https://arxiv.org/abs/2106.09685" rel="nofollow">https://arxiv.org/abs/2106.09685</a>.',it,W,dt,Q,pt,_e,Gt="<strong>Attributes</strong>:",ct,be,zt='<li><strong>model</strong> (<a href="https://huggingface.co/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel" rel="nofollow">PreTrainedModel</a>) — The model to be adapted.</li> <li><strong>peft_config</strong> (<a href="/docs/peft/main/en/package_reference/lora#peft.LoraConfig">LoraConfig</a>): The configuration of the Lora model.</li>',mt,I,te,ft,ye,Xt="This method adds a new adapter by merging the given adapters with the given weights.",ht,Me,Dt=`When using the <code>cat</code> combination_type you should be aware that rank of the resulting adapter will be equal to
the sum of all adapters ranks. So it’s possible that the mixed adapter may become too big and result in OOM
errors.`,gt,V,ae,ut,ve,Pt="Deletes an existing adapter.",_t,q,ne,bt,we,Ht="Disable all adapters.",yt,Te,Yt="When disabling all adapters, the model output corresponds to the output of the base model.",Mt,Z,oe,vt,$e,Ot="Enable all adapters.",wt,je,Kt="Call this if you have previously disabled all adapters and want to re-enable them.",Tt,R,se,$t,xe,ea=`This method merges the LoRa layers into the base model. This is needed if someone wants to use the base model
as a standalone model.`,jt,F,xt,L,re,Ct,Ce,ta="Set the active adapter(s).",Lt,Le,aa=`Additionally, this function will set the specified adapters to trainable (i.e., requires_grad=True). If this is
not desired, use the following code.`,Jt,S,kt,G,le,Ut,Je,na=`This function can calculate the updates of the [PiSSA | OLoRA] by comparing the parameters of the [PiSSA |
OLoRA] adapter in <code>output_state_dict</code> with the initial values of [PiSSA | OLoRA] in <code>adapter_name</code>, thus
converting [PiSSA | OLoRA] to LoRA.`,It,z,ie,qt,ke,oa=`Gets back the base model by removing all the lora modules without merging. This gives back the original base
model.`,Ge,de,ze,j,pe,Zt,Ue,sa="Replace the LoRA weights of a model quantized with bitsandbytes, using the LoftQ technique.",Rt,Ie,ra=`The replacement is done on the fly by loading in the non-quantized weights from a locally stored safetensors model
file and initializing the LoRA weights such that the quantization error between the original and quantized weights
is minimized.`,Et,qe,la="As lazy loading is not possible with pickle, normal PyTorch checkpoint files cannot be supported.",At,Ze,ia="Depending on the model size, calling this function may take some time to finish.",Xe,ce,De,Ne,Pe;return T=new et({props:{title:"LoRA",local:"lora",headingTag:"h1"}}),H=new et({props:{title:"LoraConfig",local:"peft.LoraConfig",headingTag:"h2"}}),Y=new J({props:{name:"class peft.LoraConfig",anchor:"peft.LoraConfig",parameters:[{name:"peft_type",val:": Union = None"},{name:"auto_mapping",val:": Optional = None"},{name:"base_model_name_or_path",val:": Optional = None"},{name:"revision",val:": Optional = None"},{name:"task_type",val:": Union = None"},{name:"inference_mode",val:": bool = False"},{name:"r",val:": int = 8"},{name:"target_modules",val:": Optional[Union[list[str], str]] = None"},{name:"lora_alpha",val:": int = 8"},{name:"lora_dropout",val:": float = 0.0"},{name:"fan_in_fan_out",val:": bool = False"},{name:"bias",val:": Literal['none', 'all', 'lora_only'] = 'none'"},{name:"use_rslora",val:": bool = False"},{name:"modules_to_save",val:": Optional[list[str]] = None"},{name:"init_lora_weights",val:": bool | Literal['gaussian', 'olora', 'pissa', 'pissa_niter_[number of iters]', 'loftq'] = True"},{name:"layers_to_transform",val:": Optional[Union[list[int], int]] = None"},{name:"layers_pattern",val:": Optional[Union[list[str], str]] = None"},{name:"rank_pattern",val:": Optional[dict] = <factory>"},{name:"alpha_pattern",val:": Optional[dict] = <factory>"},{name:"megatron_config",val:": Optional[dict] = None"},{name:"megatron_core",val:": Optional[str] = 'megatron.core'"},{name:"loftq_config",val:": Union[LoftQConfig, dict] = <factory>"},{name:"use_dora",val:": bool = False"},{name:"layer_replication",val:": Optional[list[tuple[int, int]]] = None"},{name:"runtime_config",val:": LoraRuntimeConfig = <factory>"}],parametersDescription:[{anchor:"peft.LoraConfig.r",description:`<strong>r</strong> (<code>int</code>) &#x2014;
Lora attention dimension (the &#x201C;rank&#x201D;).`,name:"r"},{anchor:"peft.LoraConfig.target_modules",description:`<strong>target_modules</strong> (<code>Optional[Union[List[str], str]]</code>) &#x2014;
The names of the modules to apply the adapter to. If this is specified, only the modules with the specified
names will be replaced. When passing a string, a regex match will be performed. When passing a list of
strings, either an exact match will be performed or it is checked if the name of the module ends with any
of the passed strings. If this is specified as &#x2018;all-linear&#x2019;, then all linear/Conv1D modules are chosen,
excluding the output layer. If this is not specified, modules will be chosen according to the model
architecture. If the architecture is not known, an error will be raised &#x2014; in this case, you should specify
the target modules manually.`,name:"target_modules"},{anchor:"peft.LoraConfig.lora_alpha",description:`<strong>lora_alpha</strong> (<code>int</code>) &#x2014;
The alpha parameter for Lora scaling.`,name:"lora_alpha"},{anchor:"peft.LoraConfig.lora_dropout",description:`<strong>lora_dropout</strong> (<code>float</code>) &#x2014;
The dropout probability for Lora layers.`,name:"lora_dropout"},{anchor:"peft.LoraConfig.fan_in_fan_out",description:`<strong>fan_in_fan_out</strong> (<code>bool</code>) &#x2014;
Set this to True if the layer to replace stores weight like (fan_in, fan_out). For example, gpt-2 uses
<code>Conv1D</code> which stores weights like (fan_in, fan_out) and hence this should be set to <code>True</code>.`,name:"fan_in_fan_out"},{anchor:"peft.LoraConfig.bias",description:`<strong>bias</strong> (<code>str</code>) &#x2014;
Bias type for LoRA. Can be &#x2018;none&#x2019;, &#x2018;all&#x2019; or &#x2018;lora_only&#x2019;. If &#x2018;all&#x2019; or &#x2018;lora_only&#x2019;, the corresponding biases
will be updated during training. Be aware that this means that, even when disabling the adapters, the model
will not produce the same output as the base model would have without adaptation.`,name:"bias"},{anchor:"peft.LoraConfig.use_rslora",description:`<strong>use_rslora</strong> (<code>bool</code>) &#x2014;
When set to True, uses <a href="https://doi.org/10.48550/arXiv.2312.03732">Rank-Stabilized LoRA</a> which
sets the adapter scaling factor to <code>lora_alpha/math.sqrt(r)</code>, since it was proven to work better.
Otherwise, it will use the original default value of <code>lora_alpha/r</code>.`,name:"use_rslora"},{anchor:"peft.LoraConfig.modules_to_save",description:`<strong>modules_to_save</strong> (<code>List[str]</code>) &#x2014;
List of modules apart from adapter layers to be set as trainable and saved in the final checkpoint.`,name:"modules_to_save"},{anchor:"peft.LoraConfig.init_lora_weights",description:`<strong>init_lora_weights</strong> (<code>bool</code> | <code>Literal[&quot;gaussian&quot;, &quot;olora&quot;, &quot;pissa&quot;, &quot;pissa_niter_[number of iters]&quot;, &quot;loftq&quot;]</code>) &#x2014;
How to initialize the weights of the adapter layers. Passing True (default) results in the default
initialization from the reference implementation from Microsoft. Passing &#x2018;gaussian&#x2019; results in Gaussian
initialization scaled by the LoRA rank for linear and layers. Setting the initialization to False leads to
completely random initialization and is discouraged. Pass <code>&apos;loftq&apos;</code> to use LoftQ initialization. Pass
<code>&apos;olora&apos;</code> to use OLoRA initialization. Passing <code>&apos;pissa&apos;</code> results in the initialization of <a href="https://arxiv.org/abs/2404.02948">Principal Singular values and Singular vectors Adaptation
(PiSSA)</a>, which converges more rapidly than LoRA and ultimately achieves superior performance. Moreover,
PiSSA reduces the quantization error compared to QLoRA, leading to further enhancements. Passing
<code>&apos;pissa_niter_[number of iters]&apos;</code> initiates Fast-SVD-based PiSSA initialization, where <code>[number of iters]</code>
indicates the number of subspace iterations to perform FSVD, and must be a nonnegative integer. When
<code>[number of iters]</code> is set to 16, it can complete the initialization of a 7B model within seconds, and the
training effect is approximately equivalent to using SVD.`,name:"init_lora_weights"},{anchor:"peft.LoraConfig.layers_to_transform",description:`<strong>layers_to_transform</strong> (<code>Union[List[int], int]</code>) &#x2014;
The layer indices to transform. If a list of ints is passed, it will apply the adapter to the layer indices
that are specified in this list. If a single integer is passed, it will apply the transformations on the
layer at this index.`,name:"layers_to_transform"},{anchor:"peft.LoraConfig.layers_pattern",description:`<strong>layers_pattern</strong> (<code>str</code>) &#x2014;
The layer pattern name, used only if <code>layers_to_transform</code> is different from <code>None</code>.`,name:"layers_pattern"},{anchor:"peft.LoraConfig.rank_pattern",description:`<strong>rank_pattern</strong> (<code>dict</code>) &#x2014;
The mapping from layer names or regexp expression to ranks which are different from the default rank
specified by <code>r</code>.`,name:"rank_pattern"},{anchor:"peft.LoraConfig.alpha_pattern",description:`<strong>alpha_pattern</strong> (<code>dict</code>) &#x2014;
The mapping from layer names or regexp expression to alphas which are different from the default alpha
specified by <code>lora_alpha</code>.`,name:"alpha_pattern"},{anchor:"peft.LoraConfig.megatron_config",description:`<strong>megatron_config</strong> (<code>Optional[dict]</code>) &#x2014;
The TransformerConfig arguments for Megatron. It is used to create LoRA&#x2019;s parallel linear layer. You can
get it like this, <code>core_transformer_config_from_args(get_args())</code>, these two functions being from Megatron.
The arguments will be used to initialize the TransformerConfig of Megatron. You need to specify this
parameter when you want to apply LoRA to the ColumnParallelLinear and RowParallelLinear layers of megatron.`,name:"megatron_config"},{anchor:"peft.LoraConfig.megatron_core",description:`<strong>megatron_core</strong> (<code>Optional[str]</code>) &#x2014;
The core module from Megatron to use, defaults to <code>&quot;megatron.core&quot;</code>.`,name:"megatron_core"},{anchor:"peft.LoraConfig.loftq_config",description:`<strong>loftq_config</strong> (<code>Optional[LoftQConfig]</code>) &#x2014;
The configuration of LoftQ. If this is not None, then LoftQ will be used to quantize the backbone weights
and initialize Lora layers. Also pass <code>init_lora_weights=&apos;loftq&apos;</code>. Note that you should not pass a
quantized model in this case, as LoftQ will quantize the model itself.`,name:"loftq_config"},{anchor:"peft.LoraConfig.use_dora",description:`<strong>use_dora</strong> (<code>bool</code>) &#x2014;
Enable &#x2018;Weight-Decomposed Low-Rank Adaptation&#x2019; (DoRA). This technique decomposes the updates of the weights
into two parts, magnitude and direction. Direction is handled by normal LoRA, whereas the magnitude is
handled by a separate learnable parameter. This can improve the performance of LoRA especially at low
ranks. Right now, DoRA only supports linear and Conv2D layers. DoRA introduces a bigger overhead than pure
LoRA, so it is recommended to merge weights for inference. For more information, see
<a href="https://arxiv.org/abs/2402.09353" rel="nofollow">https://arxiv.org/abs/2402.09353</a>.`,name:"use_dora"},{anchor:"peft.LoraConfig.layer_replication",description:`<strong>layer_replication</strong> (<code>List[Tuple[int, int]]</code>) &#x2014;
Build a new stack of layers by stacking the original model layers according to the ranges specified. This
allows expanding (or shrinking) the model without duplicating the base model weights. The new layers will
all have separate LoRA adapters attached to them.`,name:"layer_replication"},{anchor:"peft.LoraConfig.runtime_config",description:`<strong>runtime_config</strong> (<code>LoraRuntimeConfig</code>) &#x2014;
Runtime configurations (which are not saved or restored).`,name:"runtime_config"}],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lora/config.py#L72"}}),O=new J({props:{name:"to_dict",anchor:"peft.LoraConfig.to_dict",parameters:[],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lora/config.py#L317"}}),K=new et({props:{title:"LoraModel",local:"peft.LoraModel",headingTag:"h2"}}),ee=new J({props:{name:"class peft.LoraModel",anchor:"peft.LoraModel",parameters:[{name:"model",val:""},{name:"config",val:""},{name:"adapter_name",val:""}],parametersDescription:[{anchor:"peft.LoraModel.model",description:"<strong>model</strong> (<code>torch.nn.Module</code>) &#x2014; The model to be adapted.",name:"model"},{anchor:"peft.LoraModel.config",description:'<strong>config</strong> (<a href="/docs/peft/main/en/package_reference/lora#peft.LoraConfig">LoraConfig</a>) &#x2014; The configuration of the Lora model.',name:"config"},{anchor:"peft.LoraModel.adapter_name",description:"<strong>adapter_name</strong> (<code>str</code>) &#x2014; The name of the adapter, defaults to <code>&quot;default&quot;</code>.",name:"adapter_name"}],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lora/model.py#L65",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The Lora model.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>torch.nn.Module</code></p>
`}}),W=new Ke({props:{anchor:"peft.LoraModel.example",$$slots:{default:[ga]},$$scope:{ctx:U}}}),Q=new Ke({props:{anchor:"peft.LoraModel.example-2",$$slots:{default:[ua]},$$scope:{ctx:U}}}),te=new J({props:{name:"add_weighted_adapter",anchor:"peft.LoraModel.add_weighted_adapter",parameters:[{name:"adapters",val:": list[str]"},{name:"weights",val:": list[float]"},{name:"adapter_name",val:": str"},{name:"combination_type",val:": str = 'svd'"},{name:"svd_rank",val:": int | None = None"},{name:"svd_clamp",val:": int | None = None"},{name:"svd_full_matrices",val:": bool = True"},{name:"svd_driver",val:": str | None = None"},{name:"density",val:": float | None = None"},{name:"majority_sign_method",val:": Literal['total', 'frequency'] = 'total'"}],parametersDescription:[{anchor:"peft.LoraModel.add_weighted_adapter.adapters",description:`<strong>adapters</strong> (<code>list</code>) &#x2014;
List of adapter names to be merged.`,name:"adapters"},{anchor:"peft.LoraModel.add_weighted_adapter.weights",description:`<strong>weights</strong> (<code>list</code>) &#x2014;
List of weights for each adapter.`,name:"weights"},{anchor:"peft.LoraModel.add_weighted_adapter.adapter_name",description:`<strong>adapter_name</strong> (<code>str</code>) &#x2014;
Name of the new adapter.`,name:"adapter_name"},{anchor:"peft.LoraModel.add_weighted_adapter.combination_type",description:`<strong>combination_type</strong> (<code>str</code>) &#x2014;
The merging type can be one of [<code>svd</code>, <code>linear</code>, <code>cat</code>, <code>ties</code>, <code>ties_svd</code>, <code>dare_ties</code>, <code>dare_linear</code>,
<code>dare_ties_svd</code>, <code>dare_linear_svd</code>, <code>magnitude_prune</code>, <code>magnitude_prune_svd</code>]. When using the <code>cat</code>
combination_type, the rank of the resulting adapter is equal to the sum of all adapters ranks (the
mixed adapter may be too big and result in OOM errors).`,name:"combination_type"},{anchor:"peft.LoraModel.add_weighted_adapter.svd_rank",description:`<strong>svd_rank</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Rank of output adapter for svd. If None provided, will use max rank of merging adapters.`,name:"svd_rank"},{anchor:"peft.LoraModel.add_weighted_adapter.svd_clamp",description:`<strong>svd_clamp</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A quantile threshold for clamping SVD decomposition output. If None is provided, do not perform
clamping. Defaults to None.`,name:"svd_clamp"},{anchor:"peft.LoraModel.add_weighted_adapter.svd_full_matrices",description:`<strong>svd_full_matrices</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Controls whether to compute the full or reduced SVD, and consequently, the shape of the returned
tensors U and Vh. Defaults to True.`,name:"svd_full_matrices"},{anchor:"peft.LoraModel.add_weighted_adapter.svd_driver",description:`<strong>svd_driver</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of the cuSOLVER method to be used. This keyword argument only works when merging on CUDA. Can be
one of [None, <code>gesvd</code>, <code>gesvdj</code>, <code>gesvda</code>]. For more info please refer to <code>torch.linalg.svd</code>
documentation. Defaults to None.`,name:"svd_driver"},{anchor:"peft.LoraModel.add_weighted_adapter.density",description:`<strong>density</strong> (<code>float</code>, <em>optional</em>) &#x2014;
Value between 0 and 1. 0 means all values are pruned and 1 means no values are pruned. Should be used
with [<code>ties</code>, <code>ties_svd</code>, <code>dare_ties</code>, <code>dare_linear</code>, <code>dare_ties_svd</code>, <code>dare_linear_svd</code>,
<code>magnintude_prune</code>, <code>magnitude_prune_svd</code>]`,name:"density"},{anchor:"peft.LoraModel.add_weighted_adapter.majority_sign_method",description:`<strong>majority_sign_method</strong> (<code>str</code>) &#x2014;
The method, should be one of [&#x201C;total&#x201D;, &#x201C;frequency&#x201D;], to use to get the magnitude of the sign values.
Should be used with [<code>ties</code>, <code>ties_svd</code>, <code>dare_ties</code>, <code>dare_ties_svd</code>]`,name:"majority_sign_method"}],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lora/model.py#L568"}}),ae=new J({props:{name:"delete_adapter",anchor:"peft.LoraModel.delete_adapter",parameters:[{name:"adapter_name",val:": str"}],parametersDescription:[{anchor:"peft.LoraModel.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/main/src/peft/tuners/lora/model.py#L814"}}),ne=new J({props:{name:"disable_adapter_layers",anchor:"peft.LoraModel.disable_adapter_layers",parameters:[],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lora/model.py#L383"}}),oe=new J({props:{name:"enable_adapter_layers",anchor:"peft.LoraModel.enable_adapter_layers",parameters:[],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lora/model.py#L376"}}),se=new J({props:{name:"merge_and_unload",anchor:"peft.LoraModel.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.LoraModel.merge_and_unload.progressbar",description:`<strong>progressbar</strong> (<code>bool</code>) &#x2014;
whether to show a progressbar indicating the unload and merge process`,name:"progressbar"},{anchor:"peft.LoraModel.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.LoraModel.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/main/src/peft/tuners/lora/model.py#L836"}}),F=new Ke({props:{anchor:"peft.LoraModel.merge_and_unload.example",$$slots:{default:[_a]},$$scope:{ctx:U}}}),re=new J({props:{name:"set_adapter",anchor:"peft.LoraModel.set_adapter",parameters:[{name:"adapter_name",val:": str | list[str]"}],parametersDescription:[{anchor:"peft.LoraModel.set_adapter.adapter_name",description:"<strong>adapter_name</strong> (<code>str</code> or <code>list[str]</code>) &#x2014; Name of the adapter(s) to be activated.",name:"adapter_name"}],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lora/model.py#L398"}}),S=new Ke({props:{anchor:"peft.LoraModel.set_adapter.example",$$slots:{default:[ba]},$$scope:{ctx:U}}}),le=new J({props:{name:"subtract_mutated_init",anchor:"peft.LoraModel.subtract_mutated_init",parameters:[{name:"output_state_dict",val:": dict[str, torch.Tensor]"},{name:"adapter_name",val:": str"},{name:"kwargs",val:" = None"}],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lora/model.py#L875"}}),ie=new J({props:{name:"unload",anchor:"peft.LoraModel.unload",parameters:[],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lora/model.py#L868"}}),de=new et({props:{title:"Utility",local:"peft.replace_lora_weights_loftq",headingTag:"h2"}}),pe=new J({props:{name:"peft.replace_lora_weights_loftq",anchor:"peft.replace_lora_weights_loftq",parameters:[{name:"peft_model",val:""},{name:"model_path",val:": Optional[str] = None"},{name:"adapter_name",val:": str = 'default'"},{name:"callback",val:": Optional[Callable[[torch.nn.Module, str], bool]] = None"}],parametersDescription:[{anchor:"peft.replace_lora_weights_loftq.peft_model",description:`<strong>peft_model</strong> (<code>PeftModel</code>) &#x2014;
The model to replace the weights of. Must be a quantized PEFT model with LoRA layers.`,name:"peft_model"},{anchor:"peft.replace_lora_weights_loftq.model_path",description:`<strong>model_path</strong> (<code>Optional[str]</code>) &#x2014;
The path to the model safetensors file. If the model is a Hugging Face model, this will be inferred from
the model&#x2019;s config. Otherwise, it must be provided.`,name:"model_path"},{anchor:"peft.replace_lora_weights_loftq.adapter_name",description:`<strong>adapter_name</strong> (<code>str</code>) &#x2014;
The name of the adapter to replace the weights of. The default adapter name is &#x201C;default&#x201D;.`,name:"adapter_name"},{anchor:"peft.replace_lora_weights_loftq.callback",description:`<strong>callback</strong> (<code>Optional[Callable[[PeftModel, str], bool]]</code>) &#x2014;
A callback function that will be called after each module is replaced. The callback function should take
the model and the name of the current module as input and return a boolean indicating whether the
replacement should be kept. If the callback returns False, the replacement will be rolled back. This can be
very useful to confirm that the LoftQ initialization actually decreases the quantization error of the
model. As an example, this callback could generate logits for given input and compare it with the logits
from the original, non-quanitzed model with the same input, and only return <code>True</code> if there is an
improvement. As this is a greedy optimization, it&#x2019;s possible that calling this function multiple times
yields incremental improvements.`,name:"callback"}],source:"https://github.com/huggingface/peft/blob/main/src/peft/utils/loftq_utils.py#L332"}}),ce=new ha({props:{source:"https://github.com/huggingface/peft/blob/main/docs/source/package_reference/lora.md"}}),{c(){r=o("meta"),w=a(),d=o("p"),v=a(),h(T.$$.fragment),c=a(),$=o("p"),$.innerHTML=Nt,Be=a(),D=o("p"),D.textContent=Bt,We=a(),P=o("p"),P.innerHTML=Wt,Qe=a(),h(H.$$.fragment),Ve=a(),k=o("div"),h(Y.$$.fragment),nt=a(),fe=o("p"),fe.innerHTML=Qt,ot=a(),B=o("div"),h(O.$$.fragment),st=a(),he=o("p"),he.textContent=Vt,Fe=a(),h(K.$$.fragment),Se=a(),p=o("div"),h(ee.$$.fragment),rt=a(),ge=o("p"),ge.textContent=Ft,lt=a(),ue=o("p"),ue.innerHTML=St,it=a(),h(W.$$.fragment),dt=a(),h(Q.$$.fragment),pt=a(),_e=o("p"),_e.innerHTML=Gt,ct=a(),be=o("ul"),be.innerHTML=zt,mt=a(),I=o("div"),h(te.$$.fragment),ft=a(),ye=o("p"),ye.textContent=Xt,ht=a(),Me=o("p"),Me.innerHTML=Dt,gt=a(),V=o("div"),h(ae.$$.fragment),ut=a(),ve=o("p"),ve.textContent=Pt,_t=a(),q=o("div"),h(ne.$$.fragment),bt=a(),we=o("p"),we.textContent=Ht,yt=a(),Te=o("p"),Te.textContent=Yt,Mt=a(),Z=o("div"),h(oe.$$.fragment),vt=a(),$e=o("p"),$e.textContent=Ot,wt=a(),je=o("p"),je.textContent=Kt,Tt=a(),R=o("div"),h(se.$$.fragment),$t=a(),xe=o("p"),xe.textContent=ea,jt=a(),h(F.$$.fragment),xt=a(),L=o("div"),h(re.$$.fragment),Ct=a(),Ce=o("p"),Ce.textContent=ta,Lt=a(),Le=o("p"),Le.textContent=aa,Jt=a(),h(S.$$.fragment),kt=a(),G=o("div"),h(le.$$.fragment),Ut=a(),Je=o("p"),Je.innerHTML=na,It=a(),z=o("div"),h(ie.$$.fragment),qt=a(),ke=o("p"),ke.textContent=oa,Ge=a(),h(de.$$.fragment),ze=a(),j=o("div"),h(pe.$$.fragment),Zt=a(),Ue=o("p"),Ue.textContent=sa,Rt=a(),Ie=o("p"),Ie.textContent=ra,Et=a(),qe=o("p"),qe.textContent=la,At=a(),Ze=o("p"),Ze.textContent=ia,Xe=a(),h(ce.$$.fragment),De=a(),Ne=o("p"),this.h()},l(e){const i=fa("svelte-u9bgzb",document.head);r=s(i,"META",{name:!0,content:!0}),i.forEach(l),w=n(e),d=s(e,"P",{}),x(d).forEach(l),v=n(e),g(T.$$.fragment,e),c=n(e),$=s(e,"P",{"data-svelte-h":!0}),f($)!=="svelte-e6qy8f"&&($.innerHTML=Nt),Be=n(e),D=s(e,"P",{"data-svelte-h":!0}),f(D)!=="svelte-1cwsb16"&&(D.textContent=Bt),We=n(e),P=s(e,"P",{"data-svelte-h":!0}),f(P)!=="svelte-p2y1b1"&&(P.innerHTML=Wt),Qe=n(e),g(H.$$.fragment,e),Ve=n(e),k=s(e,"DIV",{class:!0});var A=x(k);g(Y.$$.fragment,A),nt=n(A),fe=s(A,"P",{"data-svelte-h":!0}),f(fe)!=="svelte-o3o25r"&&(fe.innerHTML=Qt),ot=n(A),B=s(A,"DIV",{class:!0});var me=x(B);g(O.$$.fragment,me),st=n(me),he=s(me,"P",{"data-svelte-h":!0}),f(he)!=="svelte-1nggz95"&&(he.textContent=Vt),me.forEach(l),A.forEach(l),Fe=n(e),g(K.$$.fragment,e),Se=n(e),p=s(e,"DIV",{class:!0});var m=x(p);g(ee.$$.fragment,m),rt=n(m),ge=s(m,"P",{"data-svelte-h":!0}),f(ge)!=="svelte-kipsu2"&&(ge.textContent=Ft),lt=n(m),ue=s(m,"P",{"data-svelte-h":!0}),f(ue)!=="svelte-wdv1y1"&&(ue.innerHTML=St),it=n(m),g(W.$$.fragment,m),dt=n(m),g(Q.$$.fragment,m),pt=n(m),_e=s(m,"P",{"data-svelte-h":!0}),f(_e)!=="svelte-1xx6nm4"&&(_e.innerHTML=Gt),ct=n(m),be=s(m,"UL",{"data-svelte-h":!0}),f(be)!=="svelte-3vno46"&&(be.innerHTML=zt),mt=n(m),I=s(m,"DIV",{class:!0});var N=x(I);g(te.$$.fragment,N),ft=n(N),ye=s(N,"P",{"data-svelte-h":!0}),f(ye)!=="svelte-lg9b7q"&&(ye.textContent=Xt),ht=n(N),Me=s(N,"P",{"data-svelte-h":!0}),f(Me)!=="svelte-gmuli4"&&(Me.innerHTML=Dt),N.forEach(l),gt=n(m),V=s(m,"DIV",{class:!0});var He=x(V);g(ae.$$.fragment,He),ut=n(He),ve=s(He,"P",{"data-svelte-h":!0}),f(ve)!=="svelte-1cw64z1"&&(ve.textContent=Pt),He.forEach(l),_t=n(m),q=s(m,"DIV",{class:!0});var Re=x(q);g(ne.$$.fragment,Re),bt=n(Re),we=s(Re,"P",{"data-svelte-h":!0}),f(we)!=="svelte-q60vod"&&(we.textContent=Ht),yt=n(Re),Te=s(Re,"P",{"data-svelte-h":!0}),f(Te)!=="svelte-1ecn6m6"&&(Te.textContent=Yt),Re.forEach(l),Mt=n(m),Z=s(m,"DIV",{class:!0});var Ee=x(Z);g(oe.$$.fragment,Ee),vt=n(Ee),$e=s(Ee,"P",{"data-svelte-h":!0}),f($e)!=="svelte-bv5m7u"&&($e.textContent=Ot),wt=n(Ee),je=s(Ee,"P",{"data-svelte-h":!0}),f(je)!=="svelte-13saw9o"&&(je.textContent=Kt),Ee.forEach(l),Tt=n(m),R=s(m,"DIV",{class:!0});var Ae=x(R);g(se.$$.fragment,Ae),$t=n(Ae),xe=s(Ae,"P",{"data-svelte-h":!0}),f(xe)!=="svelte-ytr2ft"&&(xe.textContent=ea),jt=n(Ae),g(F.$$.fragment,Ae),Ae.forEach(l),xt=n(m),L=s(m,"DIV",{class:!0});var X=x(L);g(re.$$.fragment,X),Ct=n(X),Ce=s(X,"P",{"data-svelte-h":!0}),f(Ce)!=="svelte-8teaja"&&(Ce.textContent=ta),Lt=n(X),Le=s(X,"P",{"data-svelte-h":!0}),f(Le)!=="svelte-1uc1qrl"&&(Le.textContent=aa),Jt=n(X),g(S.$$.fragment,X),X.forEach(l),kt=n(m),G=s(m,"DIV",{class:!0});var Ye=x(G);g(le.$$.fragment,Ye),Ut=n(Ye),Je=s(Ye,"P",{"data-svelte-h":!0}),f(Je)!=="svelte-a4td55"&&(Je.innerHTML=na),Ye.forEach(l),It=n(m),z=s(m,"DIV",{class:!0});var Oe=x(z);g(ie.$$.fragment,Oe),qt=n(Oe),ke=s(Oe,"P",{"data-svelte-h":!0}),f(ke)!=="svelte-ru82pu"&&(ke.textContent=oa),Oe.forEach(l),m.forEach(l),Ge=n(e),g(de.$$.fragment,e),ze=n(e),j=s(e,"DIV",{class:!0});var E=x(j);g(pe.$$.fragment,E),Zt=n(E),Ue=s(E,"P",{"data-svelte-h":!0}),f(Ue)!=="svelte-3ipm59"&&(Ue.textContent=sa),Rt=n(E),Ie=s(E,"P",{"data-svelte-h":!0}),f(Ie)!=="svelte-1c9djg"&&(Ie.textContent=ra),Et=n(E),qe=s(E,"P",{"data-svelte-h":!0}),f(qe)!=="svelte-p9czkf"&&(qe.textContent=la),At=n(E),Ze=s(E,"P",{"data-svelte-h":!0}),f(Ze)!=="svelte-1d7vg8p"&&(Ze.textContent=ia),E.forEach(l),Xe=n(e),g(ce.$$.fragment,e),De=n(e),Ne=s(e,"P",{}),x(Ne).forEach(l),this.h()},h(){C(r,"name","hf:doc:metadata"),C(r,"content",Ma),C(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),C(j,"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,i){t(document.head,r),u(e,w,i),u(e,d,i),u(e,v,i),_(T,e,i),u(e,c,i),u(e,$,i),u(e,Be,i),u(e,D,i),u(e,We,i),u(e,P,i),u(e,Qe,i),_(H,e,i),u(e,Ve,i),u(e,k,i),_(Y,k,null),t(k,nt),t(k,fe),t(k,ot),t(k,B),_(O,B,null),t(B,st),t(B,he),u(e,Fe,i),_(K,e,i),u(e,Se,i),u(e,p,i),_(ee,p,null),t(p,rt),t(p,ge),t(p,lt),t(p,ue),t(p,it),_(W,p,null),t(p,dt),_(Q,p,null),t(p,pt),t(p,_e),t(p,ct),t(p,be),t(p,mt),t(p,I),_(te,I,null),t(I,ft),t(I,ye),t(I,ht),t(I,Me),t(p,gt),t(p,V),_(ae,V,null),t(V,ut),t(V,ve),t(p,_t),t(p,q),_(ne,q,null),t(q,bt),t(q,we),t(q,yt),t(q,Te),t(p,Mt),t(p,Z),_(oe,Z,null),t(Z,vt),t(Z,$e),t(Z,wt),t(Z,je),t(p,Tt),t(p,R),_(se,R,null),t(R,$t),t(R,xe),t(R,jt),_(F,R,null),t(p,xt),t(p,L),_(re,L,null),t(L,Ct),t(L,Ce),t(L,Lt),t(L,Le),t(L,Jt),_(S,L,null),t(p,kt),t(p,G),_(le,G,null),t(G,Ut),t(G,Je),t(p,It),t(p,z),_(ie,z,null),t(z,qt),t(z,ke),u(e,Ge,i),_(de,e,i),u(e,ze,i),u(e,j,i),_(pe,j,null),t(j,Zt),t(j,Ue),t(j,Rt),t(j,Ie),t(j,Et),t(j,qe),t(j,At),t(j,Ze),u(e,Xe,i),_(ce,e,i),u(e,De,i),u(e,Ne,i),Pe=!0},p(e,[i]){const A={};i&2&&(A.$$scope={dirty:i,ctx:e}),W.$set(A);const me={};i&2&&(me.$$scope={dirty:i,ctx:e}),Q.$set(me);const m={};i&2&&(m.$$scope={dirty:i,ctx:e}),F.$set(m);const N={};i&2&&(N.$$scope={dirty:i,ctx:e}),S.$set(N)},i(e){Pe||(b(T.$$.fragment,e),b(H.$$.fragment,e),b(Y.$$.fragment,e),b(O.$$.fragment,e),b(K.$$.fragment,e),b(ee.$$.fragment,e),b(W.$$.fragment,e),b(Q.$$.fragment,e),b(te.$$.fragment,e),b(ae.$$.fragment,e),b(ne.$$.fragment,e),b(oe.$$.fragment,e),b(se.$$.fragment,e),b(F.$$.fragment,e),b(re.$$.fragment,e),b(S.$$.fragment,e),b(le.$$.fragment,e),b(ie.$$.fragment,e),b(de.$$.fragment,e),b(pe.$$.fragment,e),b(ce.$$.fragment,e),Pe=!0)},o(e){y(T.$$.fragment,e),y(H.$$.fragment,e),y(Y.$$.fragment,e),y(O.$$.fragment,e),y(K.$$.fragment,e),y(ee.$$.fragment,e),y(W.$$.fragment,e),y(Q.$$.fragment,e),y(te.$$.fragment,e),y(ae.$$.fragment,e),y(ne.$$.fragment,e),y(oe.$$.fragment,e),y(se.$$.fragment,e),y(F.$$.fragment,e),y(re.$$.fragment,e),y(S.$$.fragment,e),y(le.$$.fragment,e),y(ie.$$.fragment,e),y(de.$$.fragment,e),y(pe.$$.fragment,e),y(ce.$$.fragment,e),Pe=!1},d(e){e&&(l(w),l(d),l(v),l(c),l($),l(Be),l(D),l(We),l(P),l(Qe),l(Ve),l(k),l(Fe),l(Se),l(p),l(Ge),l(ze),l(j),l(Xe),l(De),l(Ne)),l(r),M(T,e),M(H,e),M(Y),M(O),M(K,e),M(ee),M(W),M(Q),M(te),M(ae),M(ne),M(oe),M(se),M(F),M(re),M(S),M(le),M(ie),M(de,e),M(pe),M(ce,e)}}}const Ma='{"title":"LoRA","local":"lora","sections":[{"title":"LoraConfig","local":"peft.LoraConfig","sections":[],"depth":2},{"title":"LoraModel","local":"peft.LoraModel","sections":[],"depth":2},{"title":"Utility","local":"peft.replace_lora_weights_loftq","sections":[],"depth":2}],"depth":1}';function va(U){return pa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class La extends ca{constructor(r){super(),ma(this,r,va,ya,da,{})}}export{La as component};

Xet Storage Details

Size:
45.7 kB
·
Xet hash:
46c02a1c4b73e94f1b682db4f7e78237a220dc1e2e8f44ddd1269eb6f029039a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.