import{s as O,o as B,n as G}from"../chunks/scheduler.8c3d61f6.js";import{S as J,i as K,g as d,s as m,r as b,A as N,h as $,f as a,c as p,j,u as q,x as L,k as R,y as V,a as i,v as T,d as x,t as y,w as C}from"../chunks/index.da70eac4.js";import{T as U}from"../chunks/Tip.1d9b8c37.js";import{H as W,E as X}from"../chunks/EditOnGithub.1e64e623.js";function Y(v){let n,u='Interested in adding a new quantization method to Transformers? Refer to the <a href="https://huggingface.co/docs/transformers/main/en/quantization/contribute" rel="nofollow">Contribute new quantization method guide</a> to learn more about adding a new quantization method.';return{c(){n=d("p"),n.innerHTML=u},l(o){n=$(o,"P",{"data-svelte-h":!0}),L(n)!=="svelte-iot2ot"&&(n.innerHTML=u)},m(o,s){i(o,n,s)},p:G,d(o){o&&a(n)}}}function Z(v){let n,u="If you are new to the quantization field, we recommend you to check out these beginner-friendly courses about quantization in collaboration with DeepLearning.AI:",o,s,f='<li><a href="https://www.deeplearning.ai/short-courses/quantization-fundamentals-with-hugging-face/" rel="nofollow">Quantization Fundamentals with Hugging Face</a></li> <li><a href="https://www.deeplearning.ai/short-courses/quantization-in-depth/" rel="nofollow">Quantization in Depth</a></li>';return{c(){n=d("p"),n.textContent=u,o=m(),s=d("ul"),s.innerHTML=f},l(r){n=$(r,"P",{"data-svelte-h":!0}),L(n)!=="svelte-lvs4zq"&&(n.textContent=u),o=p(r),s=$(r,"UL",{"data-svelte-h":!0}),L(s)!=="svelte-tsydsg"&&(s.innerHTML=f)},m(r,l){i(r,n,l),i(r,o,l),i(r,s,l)},p:G,d(r){r&&(a(n),a(o),a(s))}}}function tt(v){let n,u,o,s,f,r,l,D="Quantization techniques focus on representing data with less information while also trying to not lose too much accuracy. This often means converting a data type to represent the same information with fewer bits. For example, if your model weights are stored as 32-bit floating points and they’re quantized to 16-bit floating points, this halves the model size which makes it easier to store and reduces memory-usage. Lower precision can also speedup inference because it takes less time to perform calculations with fewer bits.",P,h,H,c,M,w,k,g,F='This section will be expanded once Diffusers has multiple quantization backends. Currently, we only support <code>bitsandbytes</code>. <a href="https://huggingface.co/docs/transformers/main/en/quantization/overview#when-to-use-what" rel="nofollow">This resource</a> provides a good overview of the pros and cons of different quantization techniques.',E,_,Q,z,A;return f=new W({props:{title:"Quantization",local:"quantization",headingTag:"h1"}}),h=new U({props:{$$slots:{default:[Y]},$$scope:{ctx:v}}}),c=new U({props:{$$slots:{default:[Z]},$$scope:{ctx:v}}}),w=new W({props:{title:"When to use what?",local:"when-to-use-what",headingTag:"h2"}}),_=new X({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/quantization/overview.md"}}),{c(){n=d("meta"),u=m(),o=d("p"),s=m(),b(f.$$.fragment),r=m(),l=d("p"),l.textContent=D,P=m(),b(h.$$.fragment),H=m(),b(c.$$.fragment),M=m(),b(w.$$.fragment),k=m(),g=d("p"),g.innerHTML=F,E=m(),b(_.$$.fragment),Q=m(),z=d("p"),this.h()},l(t){const e=N("svelte-u9bgzb",document.head);n=$(e,"META",{name:!0,content:!0}),e.forEach(a),u=p(t),o=$(t,"P",{}),j(o).forEach(a),s=p(t),q(f.$$.fragment,t),r=p(t),l=$(t,"P",{"data-svelte-h":!0}),L(l)!=="svelte-1euzkei"&&(l.textContent=D),P=p(t),q(h.$$.fragment,t),H=p(t),q(c.$$.fragment,t),M=p(t),q(w.$$.fragment,t),k=p(t),g=$(t,"P",{"data-svelte-h":!0}),L(g)!=="svelte-q3drwj"&&(g.innerHTML=F),E=p(t),q(_.$$.fragment,t),Q=p(t),z=$(t,"P",{}),j(z).forEach(a),this.h()},h(){R(n,"name","hf:doc:metadata"),R(n,"content",et)},m(t,e){V(document.head,n),i(t,u,e),i(t,o,e),i(t,s,e),T(f,t,e),i(t,r,e),i(t,l,e),i(t,P,e),T(h,t,e),i(t,H,e),T(c,t,e),i(t,M,e),T(w,t,e),i(t,k,e),i(t,g,e),i(t,E,e),T(_,t,e),i(t,Q,e),i(t,z,e),A=!0},p(t,[e]){const I={};e&2&&(I.$$scope={dirty:e,ctx:t}),h.$set(I);const S={};e&2&&(S.$$scope={dirty:e,ctx:t}),c.$set(S)},i(t){A||(x(f.$$.fragment,t),x(h.$$.fragment,t),x(c.$$.fragment,t),x(w.$$.fragment,t),x(_.$$.fragment,t),A=!0)},o(t){y(f.$$.fragment,t),y(h.$$.fragment,t),y(c.$$.fragment,t),y(w.$$.fragment,t),y(_.$$.fragment,t),A=!1},d(t){t&&(a(u),a(o),a(s),a(r),a(l),a(P),a(H),a(M),a(k),a(g),a(E),a(Q),a(z)),a(n),C(f,t),C(h,t),C(c,t),C(w,t),C(_,t)}}}const et='{"title":"Quantization","local":"quantization","sections":[{"title":"When to use what?","local":"when-to-use-what","sections":[],"depth":2}],"depth":1}';function nt(v){return B(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class rt extends J{constructor(n){super(),K(this,n,nt,tt,O,{})}}export{rt as component};
