import{s as Ce,n as xe,o as we}from"../chunks/scheduler.78382b47.js";import{S as Te,i as Oe,e as i,s as a,c as m,h as ke,a as l,d as r,b as n,f as S,g as c,j as V,k as M,l as s,m as o,n as f,t as d,o as u,p as g}from"../chunks/index.6dd35eb6.js";import{C as Ne,H as le,E as Pe}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.fed9dfe4.js";import{D as j}from"../chunks/Docstring.32e826ec.js";function Ie(ye){let y,G,q,K,v,Y,C,B,x,he='<a href="https://hf.co/papers/2309.14859" rel="nofollow">LyCORIS</a> (Lora beYond Conventional methods, Other Rank adaptation Implementations for Stable diffusion) are LoRA-like matrix decomposition adapters that modify the cross-attention layer of the UNet. The <a href="loha">LoHa</a> and <a href="lokr">LoKr</a> methods inherit from the <code>Lycoris</code> classes here.',J,w,Q,h,T,pe,R,_e="A base config for LyCORIS like adapters",W,O,X,p,k,me,U,$e="A base layer for LyCORIS like adapters",ce,$,N,fe,A,be="Merge the active adapter weights into the base weights",de,b,P,ue,F,Le="This method unmerges all merged adapter layers from the base weights.",Z,I,ee,_,D,ge,H,ve="A base tuner for LyCORIS like adapters",te,E,re,z,ae;return v=new Ne({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),C=new le({props:{title:"LyCORIS",local:"lycoris",headingTag:"h1"}}),w=new le({props:{title:"LycorisConfig",local:"peft.tuners.lycoris_utils.LycorisConfig",headingTag:"h2"}}),T=new j({props:{name:"class peft.tuners.lycoris_utils.LycorisConfig",anchor:"peft.tuners.lycoris_utils.LycorisConfig",parameters:[{name:"task_type",val:": Optional[Union[str, TaskType]] = None"},{name:"peft_type",val:": Optional[Union[str, PeftType]] = None"},{name:"auto_mapping",val:": Optional[dict] = None"},{name:"peft_version",val:": Optional[str] = None"},{name:"base_model_name_or_path",val:": Optional[str] = None"},{name:"revision",val:": Optional[str] = None"},{name:"inference_mode",val:": bool = False"},{name:"rank_pattern",val:": Optional[dict] = <factory>"},{name:"alpha_pattern",val:": Optional[dict] = <factory>"}],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lycoris_utils.py#L35"}}),O=new le({props:{title:"LycorisLayer",local:"peft.tuners.lycoris_utils.LycorisLayer",headingTag:"h2"}}),k=new j({props:{name:"class peft.tuners.lycoris_utils.LycorisLayer",anchor:"peft.tuners.lycoris_utils.LycorisLayer",parameters:[{name:"base_layer",val:": nn.Module"}],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lycoris_utils.py#L60"}}),N=new j({props:{name:"merge",anchor:"peft.tuners.lycoris_utils.LycorisLayer.merge",parameters:[{name:"safe_merge",val:": bool = False"},{name:"adapter_names",val:": Optional[list[str]] = None"}],parametersDescription:[{anchor:"peft.tuners.lycoris_utils.LycorisLayer.merge.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"},{anchor:"peft.tuners.lycoris_utils.LycorisLayer.merge.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"}],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lycoris_utils.py#L114"}}),P=new j({props:{name:"unmerge",anchor:"peft.tuners.lycoris_utils.LycorisLayer.unmerge",parameters:[],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lycoris_utils.py#L168"}}),I=new le({props:{title:"LycorisTuner",local:"peft.tuners.lycoris_utils.LycorisTuner",headingTag:"h2"}}),D=new j({props:{name:"class peft.tuners.lycoris_utils.LycorisTuner",anchor:"peft.tuners.lycoris_utils.LycorisTuner",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.lycoris_utils.LycorisTuner.model",description:"<strong>model</strong> (<code>torch.nn.Module</code>) &#x2014; The model to be adapted.",name:"model"},{anchor:"peft.tuners.lycoris_utils.LycorisTuner.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.tuners.lycoris_utils.LycorisTuner.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"},{anchor:"peft.tuners.lycoris_utils.LycorisTuner.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"}],source:"https://github.com/huggingface/peft/blob/main/src/peft/tuners/lycoris_utils.py#L194"}}),E=new Pe({props:{source:"https://github.com/huggingface/peft/blob/main/docs/source/package_reference/adapter_utils.md"}}),{c(){y=i("meta"),G=a(),q=i("p"),K=a(),m(v.$$.fragment),Y=a(),m(C.$$.fragment),B=a(),x=i("p"),x.innerHTML=he,J=a(),m(w.$$.fragment),Q=a(),h=i("div"),m(T.$$.fragment),pe=a(),R=i("p"),R.textContent=_e,W=a(),m(O.$$.fragment),X=a(),p=i("div"),m(k.$$.fragment),me=a(),U=i("p"),U.textContent=$e,ce=a(),$=i("div"),m(N.$$.fragment),fe=a(),A=i("p"),A.textContent=be,de=a(),b=i("div"),m(P.$$.fragment),ue=a(),F=i("p"),F.textContent=Le,Z=a(),m(I.$$.fragment),ee=a(),_=i("div"),m(D.$$.fragment),ge=a(),H=i("p"),H.textContent=ve,te=a(),m(E.$$.fragment),re=a(),z=i("p"),this.h()},l(e){const t=ke("svelte-u9bgzb",document.head);y=l(t,"META",{name:!0,content:!0}),t.forEach(r),G=n(e),q=l(e,"P",{}),S(q).forEach(r),K=n(e),c(v.$$.fragment,e),Y=n(e),c(C.$$.fragment,e),B=n(e),x=l(e,"P",{"data-svelte-h":!0}),V(x)!=="svelte-u1n5we"&&(x.innerHTML=he),J=n(e),c(w.$$.fragment,e),Q=n(e),h=l(e,"DIV",{class:!0});var ne=S(h);c(T.$$.fragment,ne),pe=n(ne),R=l(ne,"P",{"data-svelte-h":!0}),V(R)!=="svelte-lekccd"&&(R.textContent=_e),ne.forEach(r),W=n(e),c(O.$$.fragment,e),X=n(e),p=l(e,"DIV",{class:!0});var L=S(p);c(k.$$.fragment,L),me=n(L),U=l(L,"P",{"data-svelte-h":!0}),V(U)!=="svelte-n4c8qe"&&(U.textContent=$e),ce=n(L),$=l(L,"DIV",{class:!0});var oe=S($);c(N.$$.fragment,oe),fe=n(oe),A=l(oe,"P",{"data-svelte-h":!0}),V(A)!=="svelte-12t0sju"&&(A.textContent=be),oe.forEach(r),de=n(L),b=l(L,"DIV",{class:!0});var se=S(b);c(P.$$.fragment,se),ue=n(se),F=l(se,"P",{"data-svelte-h":!0}),V(F)!=="svelte-ukua1i"&&(F.textContent=Le),se.forEach(r),L.forEach(r),Z=n(e),c(I.$$.fragment,e),ee=n(e),_=l(e,"DIV",{class:!0});var ie=S(_);c(D.$$.fragment,ie),ge=n(ie),H=l(ie,"P",{"data-svelte-h":!0}),V(H)!=="svelte-uzavf9"&&(H.textContent=ve),ie.forEach(r),te=n(e),c(E.$$.fragment,e),re=n(e),z=l(e,"P",{}),S(z).forEach(r),this.h()},h(){M(y,"name","hf:doc:metadata"),M(y,"content",De),M(h,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(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(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(_,"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,t){s(document.head,y),o(e,G,t),o(e,q,t),o(e,K,t),f(v,e,t),o(e,Y,t),f(C,e,t),o(e,B,t),o(e,x,t),o(e,J,t),f(w,e,t),o(e,Q,t),o(e,h,t),f(T,h,null),s(h,pe),s(h,R),o(e,W,t),f(O,e,t),o(e,X,t),o(e,p,t),f(k,p,null),s(p,me),s(p,U),s(p,ce),s(p,$),f(N,$,null),s($,fe),s($,A),s(p,de),s(p,b),f(P,b,null),s(b,ue),s(b,F),o(e,Z,t),f(I,e,t),o(e,ee,t),o(e,_,t),f(D,_,null),s(_,ge),s(_,H),o(e,te,t),f(E,e,t),o(e,re,t),o(e,z,t),ae=!0},p:xe,i(e){ae||(d(v.$$.fragment,e),d(C.$$.fragment,e),d(w.$$.fragment,e),d(T.$$.fragment,e),d(O.$$.fragment,e),d(k.$$.fragment,e),d(N.$$.fragment,e),d(P.$$.fragment,e),d(I.$$.fragment,e),d(D.$$.fragment,e),d(E.$$.fragment,e),ae=!0)},o(e){u(v.$$.fragment,e),u(C.$$.fragment,e),u(w.$$.fragment,e),u(T.$$.fragment,e),u(O.$$.fragment,e),u(k.$$.fragment,e),u(N.$$.fragment,e),u(P.$$.fragment,e),u(I.$$.fragment,e),u(D.$$.fragment,e),u(E.$$.fragment,e),ae=!1},d(e){e&&(r(G),r(q),r(K),r(Y),r(B),r(x),r(J),r(Q),r(h),r(W),r(X),r(p),r(Z),r(ee),r(_),r(te),r(re),r(z)),r(y),g(v,e),g(C,e),g(w,e),g(T),g(O,e),g(k),g(N),g(P),g(I,e),g(D),g(E,e)}}}const De='{"title":"LyCORIS","local":"lycoris","sections":[{"title":"LycorisConfig","local":"peft.tuners.lycoris_utils.LycorisConfig","sections":[],"depth":2},{"title":"LycorisLayer","local":"peft.tuners.lycoris_utils.LycorisLayer","sections":[],"depth":2},{"title":"LycorisTuner","local":"peft.tuners.lycoris_utils.LycorisTuner","sections":[],"depth":2}],"depth":1}';function Ee(ye){return we(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ae extends Te{constructor(y){super(),Oe(this,y,Ee,Ie,Ce,{})}}export{Ae as component};
