import{s as R,o as X,n as D}from"../chunks/scheduler.182ea377.js";import{S as Z,i as K,g as c,s as i,r as F,A as N,h as u,f as s,c as m,j,u as k,x as w,k as B,y as O,a as r,v as z,d as I,t as A,w as E}from"../chunks/index.abf12888.js";import{T as W}from"../chunks/Tip.230e2334.js";import{C as Q}from"../chunks/CodeBlock.57fe6e13.js";import{H as V}from"../chunks/Heading.16916d63.js";function Y(g){let n,a='The xFormers <code>pip</code> package requires the latest version of PyTorch. If you need to use a previous version of PyTorch, then we recommend <a href="https://github.com/facebookresearch/xformers#installing-xformers" rel="nofollow">installing xFormers from the source</a>.';return{c(){n=c("p"),n.innerHTML=a},l(o){n=u(o,"P",{"data-svelte-h":!0}),w(n)!=="svelte-1br1kjr"&&(n.innerHTML=a)},m(o,l){r(o,n,l)},p:D,d(o){o&&s(n)}}}function ee(g){let n,a='According to this <a href="https://github.com/huggingface/diffusers/issues/2234#issuecomment-1416931212" rel="nofollow">issue</a>, xFormers <code>v0.0.16</code> cannot be used for training (fine-tune or DreamBooth) in some GPUs. If you observe this problem, please install a development version as indicated in the issue comments.';return{c(){n=c("p"),n.innerHTML=a},l(o){n=u(o,"P",{"data-svelte-h":!0}),w(n)!=="svelte-b92wts"&&(n.innerHTML=a)},m(o,l){r(o,n,l)},p:D,d(o){o&&s(n)}}}function te(g){let n,a,o,l,$,b,h,q='We recommend <a href="https://github.com/facebookresearch/xformers" rel="nofollow">xFormers</a> for both inference and training. In our tests, the optimizations performed in the attention blocks allow for both faster speed and reduced memory consumption.',T,d,G="Install xFormers from <code>pip</code>:",P,_,H,f,M,x,J='After xFormers is installed, you can use <code>enable_xformers_memory_efficient_attention()</code> for faster inference and reduced memory consumption as shown in this <a href="memory#memory-efficient-attention">section</a>.',y,p,L,v,C;return $=new V({props:{title:"xFormers",local:"xformers",headingTag:"h1"}}),_=new Q({props:{code:"cGlwJTIwaW5zdGFsbCUyMHhmb3JtZXJz",highlighted:"pip install xformers",wrap:!1}}),f=new W({props:{$$slots:{default:[Y]},$$scope:{ctx:g}}}),p=new W({props:{warning:!0,$$slots:{default:[ee]},$$scope:{ctx:g}}}),{c(){n=c("meta"),a=i(),o=c("p"),l=i(),F($.$$.fragment),b=i(),h=c("p"),h.innerHTML=q,T=i(),d=c("p"),d.innerHTML=G,P=i(),F(_.$$.fragment),H=i(),F(f.$$.fragment),M=i(),x=c("p"),x.innerHTML=J,y=i(),F(p.$$.fragment),L=i(),v=c("p"),this.h()},l(e){const t=N("svelte-u9bgzb",document.head);n=u(t,"META",{name:!0,content:!0}),t.forEach(s),a=m(e),o=u(e,"P",{}),j(o).forEach(s),l=m(e),k($.$$.fragment,e),b=m(e),h=u(e,"P",{"data-svelte-h":!0}),w(h)!=="svelte-oz1ps0"&&(h.innerHTML=q),T=m(e),d=u(e,"P",{"data-svelte-h":!0}),w(d)!=="svelte-18m1qmn"&&(d.innerHTML=G),P=m(e),k(_.$$.fragment,e),H=m(e),k(f.$$.fragment,e),M=m(e),x=u(e,"P",{"data-svelte-h":!0}),w(x)!=="svelte-1p2fcxh"&&(x.innerHTML=J),y=m(e),k(p.$$.fragment,e),L=m(e),v=u(e,"P",{}),j(v).forEach(s),this.h()},h(){B(n,"name","hf:doc:metadata"),B(n,"content",ne)},m(e,t){O(document.head,n),r(e,a,t),r(e,o,t),r(e,l,t),z($,e,t),r(e,b,t),r(e,h,t),r(e,T,t),r(e,d,t),r(e,P,t),z(_,e,t),r(e,H,t),z(f,e,t),r(e,M,t),r(e,x,t),r(e,y,t),z(p,e,t),r(e,L,t),r(e,v,t),C=!0},p(e,[t]){const S={};t&2&&(S.$$scope={dirty:t,ctx:e}),f.$set(S);const U={};t&2&&(U.$$scope={dirty:t,ctx:e}),p.$set(U)},i(e){C||(I($.$$.fragment,e),I(_.$$.fragment,e),I(f.$$.fragment,e),I(p.$$.fragment,e),C=!0)},o(e){A($.$$.fragment,e),A(_.$$.fragment,e),A(f.$$.fragment,e),A(p.$$.fragment,e),C=!1},d(e){e&&(s(a),s(o),s(l),s(b),s(h),s(T),s(d),s(P),s(H),s(M),s(x),s(y),s(L),s(v)),s(n),E($,e),E(_,e),E(f,e),E(p,e)}}}const ne='{"title":"xFormers","local":"xformers","sections":[],"depth":1}';function se(g){return X(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class le extends Z{constructor(n){super(),K(this,n,se,te,R,{})}}export{le as component};
