import{S as _t,i as vt,s as bt,e as i,k as h,w as j,t as n,M as xt,c as s,d as o,m as u,a,x as K,h as r,b as f,G as e,g as C,y as Q,q as X,o as Y,B as Z,v as $t}from"../../chunks/vendor-hf-doc-builder.js";import{T as mt}from"../../chunks/Tip-hf-doc-builder.js";import{D as Jo}from"../../chunks/Docstring-hf-doc-builder.js";import{I as pt}from"../../chunks/IconCopyLink-hf-doc-builder.js";function wt(ee){let l,w,d,_,x,c,v,y;return{c(){l=i("p"),w=n("It is required to be logged in ("),d=i("code"),_=n("huggingface-cli login"),x=n(") when you want to use private or "),c=i("a"),v=n(`gated
models`),y=n("."),this.h()},l(P){l=s(P,"P",{});var $=a(l);w=r($,"It is required to be logged in ("),d=s($,"CODE",{});var p=a(d);_=r(p,"huggingface-cli login"),p.forEach(o),x=r($,") when you want to use private or "),c=s($,"A",{href:!0,rel:!0});var oe=a(c);v=r(oe,`gated
models`),oe.forEach(o),y=r($,"."),$.forEach(o),this.h()},h(){f(c,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),f(c,"rel","nofollow")},m(P,$){C(P,l,$),e(l,w),e(l,d),e(d,_),e(l,x),e(l,c),e(c,v),e(l,y)},d(P){P&&o(l)}}}function yt(ee){let l,w,d,_,x;return{c(){l=i("p"),w=n("Activate the special "),d=i("a"),_=n("\u201Coffline-mode\u201D"),x=n(` to
use this method in a firewalled environment.`),this.h()},l(c){l=s(c,"P",{});var v=a(l);w=r(v,"Activate the special "),d=s(v,"A",{href:!0,rel:!0});var y=a(d);_=r(y,"\u201Coffline-mode\u201D"),y.forEach(o),x=r(v,` to
use this method in a firewalled environment.`),v.forEach(o),this.h()},h(){f(d,"href","https://huggingface.co/transformers/installation.html#offline-mode"),f(d,"rel","nofollow")},m(c,v){C(c,l,v),e(l,w),e(l,d),e(d,_),e(l,x)},d(c){c&&o(l)}}}function Et(ee){let l,w,d,_,x,c,v,y,P,$,p,oe,te,ze,Je,ne,Ue,Ve,re,We,Ge,ge,Re,Be,Le,ie,He,Oe,S,I,me,J,je,pe,Ke,Ie,g,U,Qe,D,Xe,_e,Ye,Ze,se,eo,oo,to,V,ve,ae,no,ro,be,le,io,so,xe,ao,lo,L,M,$e,fo,co,we,ho,uo,fe,go,mo,po,T,ye,_o,vo,Ee,bo,xo,$o,A,Ce,wo,yo,Me,Eo,Co,Ae,Mo,Ao,ko,E,W,Po,ke,So,Do,N,Lo,q,Oo,F,G,Io,O,To,Pe,No,qo,de,Fo,zo,Te;return c=new pt({}),J=new pt({}),U=new Jo({props:{name:"class diffusers.ConfigMixin",anchor:"diffusers.ConfigMixin",parameters:[],source:"https://github.com/huggingface/diffusers/blob/vr_1190/src/diffusers/configuration_utils.py#L40"}}),W=new Jo({props:{name:"from_config",anchor:"diffusers.ConfigMixin.from_config",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, os.PathLike]"},{name:"return_unused_kwargs",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.ConfigMixin.from_config.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>, <em>optional</em>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a model repo on huggingface.co. Valid model ids should have an
organization name, like <code>google/ddpm-celebahq-256</code>.</li>
<li>A path to a <em>directory</em> containing model weights saved using <a href="/docs/diffusers/pr_1190/en/using-diffusers/configuration#diffusers.ConfigMixin.save_config">save_config()</a>, e.g.,
<code>./my_model_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.ConfigMixin.from_config.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"diffusers.ConfigMixin.from_config.ignore_mismatched_sizes",description:`<strong>ignore_mismatched_sizes</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to raise an error if some of the weights from the checkpoint do not have the same size
as the weights of the model (if for instance, you are instantiating a model with 10 labels from a
checkpoint with 3 labels).`,name:"ignore_mismatched_sizes"},{anchor:"diffusers.ConfigMixin.from_config.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.ConfigMixin.from_config.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.ConfigMixin.from_config.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.ConfigMixin.from_config.output_loading_info(bool,",description:`<strong>output_loading_info(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.`,name:"output_loading_info(bool,"},{anchor:"diffusers.ConfigMixin.from_config.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.ConfigMixin.from_config.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>transformers-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"diffusers.ConfigMixin.from_config.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.ConfigMixin.from_config.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"}],source:"https://github.com/huggingface/diffusers/blob/vr_1190/src/diffusers/configuration_utils.py#L106"}}),N=new mt({props:{$$slots:{default:[wt]},$$scope:{ctx:ee}}}),q=new mt({props:{$$slots:{default:[yt]},$$scope:{ctx:ee}}}),G=new Jo({props:{name:"save_config",anchor:"diffusers.ConfigMixin.save_config",parameters:[{name:"save_directory",val:": typing.Union[str, os.PathLike]"},{name:"push_to_hub",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.ConfigMixin.save_config.save_directory",description:`<strong>save_directory</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
Directory where the configuration JSON file will be saved (will be created if it does not exist).`,name:"save_directory"}],source:"https://github.com/huggingface/diffusers/blob/vr_1190/src/diffusers/configuration_utils.py#L86"}}),{c(){l=i("meta"),w=h(),d=i("h1"),_=i("a"),x=i("span"),j(c.$$.fragment),v=h(),y=i("span"),P=n("Configuration"),$=h(),p=i("p"),oe=n("In Diffusers, schedulers of type "),te=i("a"),ze=n("schedulers.scheduling_utils.SchedulerMixin"),Je=n(", and models of type "),ne=i("a"),Ue=n("ModelMixin"),Ve=n(" inherit from "),re=i("a"),We=n("ConfigMixin"),Ge=n(` which conveniently takes care of storing all parameters that are
passed to the respective `),ge=i("code"),Re=n("__init__"),Be=n(" methods in a JSON-configuration file."),Le=h(),ie=i("p"),He=n("TODO(PVP) - add example and better info here"),Oe=h(),S=i("h2"),I=i("a"),me=i("span"),j(J.$$.fragment),je=h(),pe=i("span"),Ke=n("ConfigMixin"),Ie=h(),g=i("div"),j(U.$$.fragment),Qe=h(),D=i("p"),Xe=n("Base class for all configuration classes. Stores all configuration parameters under "),_e=i("code"),Ye=n("self.config"),Ze=n(` Also handles all
methods for loading/downloading/saving classes inheriting from `),se=i("a"),eo=n("ConfigMixin"),oo=n(" with"),to=h(),V=i("ul"),ve=i("li"),ae=i("a"),no=n("from_config()"),ro=h(),be=i("li"),le=i("a"),io=n("save_config()"),so=h(),xe=i("p"),ao=n("Class attributes:"),lo=h(),L=i("ul"),M=i("li"),$e=i("strong"),fo=n("config_name"),co=n(" ("),we=i("code"),ho=n("str"),uo=n(`) \u2014 A filename under which the config should stored when calling
`),fe=i("a"),go=n("save_config()"),mo=n(" (should be overridden by parent class)."),po=h(),T=i("li"),ye=i("strong"),_o=n("ignore_for_config"),vo=n(" ("),Ee=i("code"),bo=n("List[str]"),xo=n(`) \u2014 A list of attributes that should not be saved in the config (should be
overridden by parent class).`),$o=h(),A=i("li"),Ce=i("strong"),wo=n("_compatible_classes"),yo=n(" ("),Me=i("code"),Eo=n("List[str]"),Co=n(`) \u2014 A list of classes that are compatible with the parent class, so that
`),Ae=i("code"),Mo=n("from_config"),Ao=n(` can be used from a class different than the one used to save the config (should be overridden
by parent class).`),ko=h(),E=i("div"),j(W.$$.fragment),Po=h(),ke=i("p"),So=n("Instantiate a Python class from a pre-defined JSON-file."),Do=h(),j(N.$$.fragment),Lo=h(),j(q.$$.fragment),Oo=h(),F=i("div"),j(G.$$.fragment),Io=h(),O=i("p"),To=n("Save a configuration object to the directory "),Pe=i("code"),No=n("save_directory"),qo=n(`, so that it can be re-loaded using the
`),de=i("a"),Fo=n("from_config()"),zo=n(" class method."),this.h()},l(t){const m=xt('[data-svelte="svelte-1phssyn"]',document.head);l=s(m,"META",{name:!0,content:!0}),m.forEach(o),w=u(t),d=s(t,"H1",{class:!0});var R=a(d);_=s(R,"A",{id:!0,class:!0,href:!0});var Se=a(_);x=s(Se,"SPAN",{});var Uo=a(x);K(c.$$.fragment,Uo),Uo.forEach(o),Se.forEach(o),v=u(R),y=s(R,"SPAN",{});var Vo=a(y);P=r(Vo,"Configuration"),Vo.forEach(o),R.forEach(o),$=u(t),p=s(t,"P",{});var k=a(p);oe=r(k,"In Diffusers, schedulers of type "),te=s(k,"A",{href:!0});var Wo=a(te);ze=r(Wo,"schedulers.scheduling_utils.SchedulerMixin"),Wo.forEach(o),Je=r(k,", and models of type "),ne=s(k,"A",{href:!0});var Go=a(ne);Ue=r(Go,"ModelMixin"),Go.forEach(o),Ve=r(k," inherit from "),re=s(k,"A",{href:!0});var Ro=a(re);We=r(Ro,"ConfigMixin"),Ro.forEach(o),Ge=r(k,` which conveniently takes care of storing all parameters that are
passed to the respective `),ge=s(k,"CODE",{});var Bo=a(ge);Re=r(Bo,"__init__"),Bo.forEach(o),Be=r(k," methods in a JSON-configuration file."),k.forEach(o),Le=u(t),ie=s(t,"P",{});var Ho=a(ie);He=r(Ho,"TODO(PVP) - add example and better info here"),Ho.forEach(o),Oe=u(t),S=s(t,"H2",{class:!0});var Ne=a(S);I=s(Ne,"A",{id:!0,class:!0,href:!0});var jo=a(I);me=s(jo,"SPAN",{});var Ko=a(me);K(J.$$.fragment,Ko),Ko.forEach(o),jo.forEach(o),je=u(Ne),pe=s(Ne,"SPAN",{});var Qo=a(pe);Ke=r(Qo,"ConfigMixin"),Qo.forEach(o),Ne.forEach(o),Ie=u(t),g=s(t,"DIV",{class:!0});var b=a(g);K(U.$$.fragment,b),Qe=u(b),D=s(b,"P",{});var ce=a(D);Xe=r(ce,"Base class for all configuration classes. Stores all configuration parameters under "),_e=s(ce,"CODE",{});var Xo=a(_e);Ye=r(Xo,"self.config"),Xo.forEach(o),Ze=r(ce,` Also handles all
methods for loading/downloading/saving classes inheriting from `),se=s(ce,"A",{href:!0});var Yo=a(se);eo=r(Yo,"ConfigMixin"),Yo.forEach(o),oo=r(ce," with"),ce.forEach(o),to=u(b),V=s(b,"UL",{});var qe=a(V);ve=s(qe,"LI",{});var Zo=a(ve);ae=s(Zo,"A",{href:!0});var et=a(ae);no=r(et,"from_config()"),et.forEach(o),Zo.forEach(o),ro=u(qe),be=s(qe,"LI",{});var ot=a(be);le=s(ot,"A",{href:!0});var tt=a(le);io=r(tt,"save_config()"),tt.forEach(o),ot.forEach(o),qe.forEach(o),so=u(b),xe=s(b,"P",{});var nt=a(xe);ao=r(nt,"Class attributes:"),nt.forEach(o),lo=u(b),L=s(b,"UL",{});var he=a(L);M=s(he,"LI",{});var B=a(M);$e=s(B,"STRONG",{});var rt=a($e);fo=r(rt,"config_name"),rt.forEach(o),co=r(B," ("),we=s(B,"CODE",{});var it=a(we);ho=r(it,"str"),it.forEach(o),uo=r(B,`) \u2014 A filename under which the config should stored when calling
`),fe=s(B,"A",{href:!0});var st=a(fe);go=r(st,"save_config()"),st.forEach(o),mo=r(B," (should be overridden by parent class)."),B.forEach(o),po=u(he),T=s(he,"LI",{});var De=a(T);ye=s(De,"STRONG",{});var at=a(ye);_o=r(at,"ignore_for_config"),at.forEach(o),vo=r(De," ("),Ee=s(De,"CODE",{});var lt=a(Ee);bo=r(lt,"List[str]"),lt.forEach(o),xo=r(De,`) \u2014 A list of attributes that should not be saved in the config (should be
overridden by parent class).`),De.forEach(o),$o=u(he),A=s(he,"LI",{});var H=a(A);Ce=s(H,"STRONG",{});var ft=a(Ce);wo=r(ft,"_compatible_classes"),ft.forEach(o),yo=r(H," ("),Me=s(H,"CODE",{});var dt=a(Me);Eo=r(dt,"List[str]"),dt.forEach(o),Co=r(H,`) \u2014 A list of classes that are compatible with the parent class, so that
`),Ae=s(H,"CODE",{});var ct=a(Ae);Mo=r(ct,"from_config"),ct.forEach(o),Ao=r(H,` can be used from a class different than the one used to save the config (should be overridden
by parent class).`),H.forEach(o),he.forEach(o),ko=u(b),E=s(b,"DIV",{class:!0});var z=a(E);K(W.$$.fragment,z),Po=u(z),ke=s(z,"P",{});var ht=a(ke);So=r(ht,"Instantiate a Python class from a pre-defined JSON-file."),ht.forEach(o),Do=u(z),K(N.$$.fragment,z),Lo=u(z),K(q.$$.fragment,z),z.forEach(o),Oo=u(b),F=s(b,"DIV",{class:!0});var Fe=a(F);K(G.$$.fragment,Fe),Io=u(Fe),O=s(Fe,"P",{});var ue=a(O);To=r(ue,"Save a configuration object to the directory "),Pe=s(ue,"CODE",{});var ut=a(Pe);No=r(ut,"save_directory"),ut.forEach(o),qo=r(ue,`, so that it can be re-loaded using the
`),de=s(ue,"A",{href:!0});var gt=a(de);Fo=r(gt,"from_config()"),gt.forEach(o),zo=r(ue," class method."),ue.forEach(o),Fe.forEach(o),b.forEach(o),this.h()},h(){f(l,"name","hf:doc:metadata"),f(l,"content",JSON.stringify(Ct)),f(_,"id","configuration"),f(_,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(_,"href","#configuration"),f(d,"class","relative group"),f(te,"href","/docs/diffusers/pr_1190/en/api/schedulers#diffusers.SchedulerMixin"),f(ne,"href","/docs/diffusers/pr_1190/en/using-diffusers/loading#diffusers.ModelMixin"),f(re,"href","/docs/diffusers/pr_1190/en/using-diffusers/configuration#diffusers.ConfigMixin"),f(I,"id","diffusers.ConfigMixin"),f(I,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(I,"href","#diffusers.ConfigMixin"),f(S,"class","relative group"),f(se,"href","/docs/diffusers/pr_1190/en/using-diffusers/configuration#diffusers.ConfigMixin"),f(ae,"href","/docs/diffusers/pr_1190/en/using-diffusers/configuration#diffusers.ConfigMixin.from_config"),f(le,"href","/docs/diffusers/pr_1190/en/using-diffusers/configuration#diffusers.ConfigMixin.save_config"),f(fe,"href","/docs/diffusers/pr_1190/en/using-diffusers/configuration#diffusers.ConfigMixin.save_config"),f(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(de,"href","/docs/diffusers/pr_1190/en/using-diffusers/configuration#diffusers.ConfigMixin.from_config"),f(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,m){e(document.head,l),C(t,w,m),C(t,d,m),e(d,_),e(_,x),Q(c,x,null),e(d,v),e(d,y),e(y,P),C(t,$,m),C(t,p,m),e(p,oe),e(p,te),e(te,ze),e(p,Je),e(p,ne),e(ne,Ue),e(p,Ve),e(p,re),e(re,We),e(p,Ge),e(p,ge),e(ge,Re),e(p,Be),C(t,Le,m),C(t,ie,m),e(ie,He),C(t,Oe,m),C(t,S,m),e(S,I),e(I,me),Q(J,me,null),e(S,je),e(S,pe),e(pe,Ke),C(t,Ie,m),C(t,g,m),Q(U,g,null),e(g,Qe),e(g,D),e(D,Xe),e(D,_e),e(_e,Ye),e(D,Ze),e(D,se),e(se,eo),e(D,oo),e(g,to),e(g,V),e(V,ve),e(ve,ae),e(ae,no),e(V,ro),e(V,be),e(be,le),e(le,io),e(g,so),e(g,xe),e(xe,ao),e(g,lo),e(g,L),e(L,M),e(M,$e),e($e,fo),e(M,co),e(M,we),e(we,ho),e(M,uo),e(M,fe),e(fe,go),e(M,mo),e(L,po),e(L,T),e(T,ye),e(ye,_o),e(T,vo),e(T,Ee),e(Ee,bo),e(T,xo),e(L,$o),e(L,A),e(A,Ce),e(Ce,wo),e(A,yo),e(A,Me),e(Me,Eo),e(A,Co),e(A,Ae),e(Ae,Mo),e(A,Ao),e(g,ko),e(g,E),Q(W,E,null),e(E,Po),e(E,ke),e(ke,So),e(E,Do),Q(N,E,null),e(E,Lo),Q(q,E,null),e(g,Oo),e(g,F),Q(G,F,null),e(F,Io),e(F,O),e(O,To),e(O,Pe),e(Pe,No),e(O,qo),e(O,de),e(de,Fo),e(O,zo),Te=!0},p(t,[m]){const R={};m&2&&(R.$$scope={dirty:m,ctx:t}),N.$set(R);const Se={};m&2&&(Se.$$scope={dirty:m,ctx:t}),q.$set(Se)},i(t){Te||(X(c.$$.fragment,t),X(J.$$.fragment,t),X(U.$$.fragment,t),X(W.$$.fragment,t),X(N.$$.fragment,t),X(q.$$.fragment,t),X(G.$$.fragment,t),Te=!0)},o(t){Y(c.$$.fragment,t),Y(J.$$.fragment,t),Y(U.$$.fragment,t),Y(W.$$.fragment,t),Y(N.$$.fragment,t),Y(q.$$.fragment,t),Y(G.$$.fragment,t),Te=!1},d(t){o(l),t&&o(w),t&&o(d),Z(c),t&&o($),t&&o(p),t&&o(Le),t&&o(ie),t&&o(Oe),t&&o(S),Z(J),t&&o(Ie),t&&o(g),Z(U),Z(W),Z(N),Z(q),Z(G)}}}const Ct={local:"configuration",sections:[{local:"diffusers.ConfigMixin",title:"ConfigMixin"}],title:"Configuration"};function Mt(ee){return $t(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Dt extends _t{constructor(l){super();vt(this,l,Mt,Et,bt,{})}}export{Dt as default,Ct as metadata};
