import{S as da,i as Ma,s as ga,e as n,k as p,w as m,t as s,M as ya,c as o,d as t,m as c,a as r,x as d,h as u,b as f,N as Nl,G as l,g as i,y as M,q as g,o as y,B as _,v as _a}from"../../chunks/vendor-hf-doc-builder.js";import{T as wa}from"../../chunks/Tip-hf-doc-builder.js";import{I as Ve}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as A}from"../../chunks/CodeBlock-hf-doc-builder.js";function va(Fe){let h,Z;return{c(){h=n("p"),Z=s("\u{1F4A1} A full training run takes 2 hours on 4xV100 GPUs.")},l(w){h=o(w,"P",{});var U=r(h);Z=u(U,"\u{1F4A1} A full training run takes 2 hours on 4xV100 GPUs."),U.forEach(t)},m(w,U){i(w,h,U),l(h,Z)},d(w){w&&t(h)}}}function Ua(Fe){let h,Z,w,U,Ue,Q,Ct,$e,Zt,Qe,me,Tt,Pe,b,kl,ze,T,Xt,P,Jt,xt,Ie,de,Gt,Le,z,He,X,St,I,Rt,Yt,Be,L,qe,Me,Vt,De,H,Oe,ge,Ft,Ke,B,et,N,J,be,q,Qt,Ee,Pt,tt,ye,zt,lt,D,at,k,x,je,O,It,Ae,Lt,it,_e,Ht,nt,K,ot,E,Bt,Ne,qt,Dt,ke,Ot,Kt,rt,ee,st,W,G,We,te,el,Ce,tl,ut,v,ll,le,al,il,Ze,nl,ol,Te,rl,sl,we,ul,fl,ft,S,pl,Xe,cl,hl,pt,R,ct,Y,ml,ae,dl,Ml,ht,ie,mt,ne,Je,Wl,dt,V,gl,oe,yl,_l,Mt,re,gt,se,xe,Cl,yt,C,F,Ge,ue,wl,Se,vl,_t,$,Re,Ul,$l,fe,bl,El,Ye,jl,Al,wt,pe,vt;return Q=new Ve({}),z=new A({props:{code:"cGlwJTIwaW5zdGFsbCUyMGRpZmZ1c2VycyU1QnRyYWluaW5nJTVEJTIwYWNjZWxlcmF0ZSUyMGRhdGFzZXRz",highlighted:"pip install diffusers[training] accelerate datasets"}}),L=new A({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config"}}),H=new A({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZyUyMGRlZmF1bHQ=",highlighted:"accelerate config default"}}),B=new A({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUudXRpbHMlMjBpbXBvcnQlMjB3cml0ZV9iYXNpY19jb25maWclMEElMEF3cml0ZV9iYXNpY19jb25maWcoKQ==",highlighted:`from accelerate.utils import write_basic_config

write_basic_config()`}}),q=new Ve({}),D=new A({props:{code:"LS1wdXNoX3RvX2h1Yg==",highlighted:"--push_to_hub"}}),O=new Ve({}),K=new A({props:{code:"LS1jaGVja3BvaW50aW5nX3N0ZXBzJTNENTAw",highlighted:"--checkpointing_steps=500"}}),ee=new A({props:{code:"LS1yZXN1bWVfZnJvbV9jaGVja3BvaW50JTNEJTIyY2hlY2twb2ludC0xNTAwJTIy",highlighted:'--resume_from_checkpoint=<span class="hljs-string">&quot;checkpoint-1500&quot;</span>'}}),te=new Ve({}),R=new wa({props:{$$slots:{default:[va]},$$scope:{ctx:Fe}}}),ie=new A({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRyYWluX3VuY29uZGl0aW9uYWwucHklMjAlNUMlMEElMjAlMjAtLWRhdGFzZXRfbmFtZSUzRCUyMmh1Z2dhbiUyRmZsb3dlcnMtMTAyLWNhdGVnb3JpZXMlMjIlMjAlNUMlMEElMjAlMjAtLXJlc29sdXRpb24lM0Q2NCUyMCU1QyUwQSUyMCUyMC0tb3V0cHV0X2RpciUzRCUyMmRkcG0tZW1hLWZsb3dlcnMtNjQlMjIlMjAlNUMlMEElMjAlMjAtLXRyYWluX2JhdGNoX3NpemUlM0QxNiUyMCU1QyUwQSUyMCUyMC0tbnVtX2Vwb2NocyUzRDEwMCUyMCU1QyUwQSUyMCUyMC0tZ3JhZGllbnRfYWNjdW11bGF0aW9uX3N0ZXBzJTNEMSUyMCU1QyUwQSUyMCUyMC0tbGVhcm5pbmdfcmF0ZSUzRDFlLTQlMjAlNUMlMEElMjAlMjAtLWxyX3dhcm11cF9zdGVwcyUzRDUwMCUyMCU1QyUwQSUyMCUyMC0tbWl4ZWRfcHJlY2lzaW9uJTNEbm8lMjAlNUMlMEElMjAlMjAtLXB1c2hfdG9faHVi",highlighted:`accelerate launch train_unconditional.py \\
  --dataset_name=<span class="hljs-string">&quot;huggan/flowers-102-categories&quot;</span> \\
  --resolution=64 \\
  --output_dir=<span class="hljs-string">&quot;ddpm-ema-flowers-64&quot;</span> \\
  --train_batch_size=16 \\
  --num_epochs=100 \\
  --gradient_accumulation_steps=1 \\
  --learning_rate=1e-4 \\
  --lr_warmup_steps=500 \\
  --mixed_precision=no \\
  --push_to_hub`}}),re=new A({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRyYWluX3VuY29uZGl0aW9uYWwucHklMjAlNUMlMEElMjAlMjAtLWRhdGFzZXRfbmFtZSUzRCUyMmh1Z2dhbiUyRnBva2Vtb24lMjIlMjAlNUMlMEElMjAlMjAtLXJlc29sdXRpb24lM0Q2NCUyMCU1QyUwQSUyMCUyMC0tb3V0cHV0X2RpciUzRCUyMmRkcG0tZW1hLXBva2Vtb24tNjQlMjIlMjAlNUMlMEElMjAlMjAtLXRyYWluX2JhdGNoX3NpemUlM0QxNiUyMCU1QyUwQSUyMCUyMC0tbnVtX2Vwb2NocyUzRDEwMCUyMCU1QyUwQSUyMCUyMC0tZ3JhZGllbnRfYWNjdW11bGF0aW9uX3N0ZXBzJTNEMSUyMCU1QyUwQSUyMCUyMC0tbGVhcm5pbmdfcmF0ZSUzRDFlLTQlMjAlNUMlMEElMjAlMjAtLWxyX3dhcm11cF9zdGVwcyUzRDUwMCUyMCU1QyUwQSUyMCUyMC0tbWl4ZWRfcHJlY2lzaW9uJTNEbm8lMjAlNUMlMEElMjAlMjAtLXB1c2hfdG9faHVi",highlighted:`accelerate launch train_unconditional.py \\
  --dataset_name=<span class="hljs-string">&quot;huggan/pokemon&quot;</span> \\
  --resolution=64 \\
  --output_dir=<span class="hljs-string">&quot;ddpm-ema-pokemon-64&quot;</span> \\
  --train_batch_size=16 \\
  --num_epochs=100 \\
  --gradient_accumulation_steps=1 \\
  --learning_rate=1e-4 \\
  --lr_warmup_steps=500 \\
  --mixed_precision=no \\
  --push_to_hub`}}),ue=new Ve({}),pe=new A({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMC0tbWl4ZWRfcHJlY2lzaW9uJTNEJTIyZnAxNiUyMiUyMC0tbXVsdGlfZ3B1JTIwdHJhaW5fdW5jb25kaXRpb25hbC5weSUyMCU1QyUwQSUyMCUyMC0tZGF0YXNldF9uYW1lJTNEJTIyaHVnZ2FuJTJGcG9rZW1vbiUyMiUyMCU1QyUwQSUyMCUyMC0tcmVzb2x1dGlvbiUzRDY0JTIwLS1jZW50ZXJfY3JvcCUyMC0tcmFuZG9tX2ZsaXAlMjAlNUMlMEElMjAlMjAtLW91dHB1dF9kaXIlM0QlMjJkZHBtLWVtYS1wb2tlbW9uLTY0JTIyJTIwJTVDJTBBJTIwJTIwLS10cmFpbl9iYXRjaF9zaXplJTNEMTYlMjAlNUMlMEElMjAlMjAtLW51bV9lcG9jaHMlM0QxMDAlMjAlNUMlMEElMjAlMjAtLWdyYWRpZW50X2FjY3VtdWxhdGlvbl9zdGVwcyUzRDElMjAlNUMlMEElMjAlMjAtLXVzZV9lbWElMjAlNUMlMEElMjAlMjAtLWxlYXJuaW5nX3JhdGUlM0QxZS00JTIwJTVDJTBBJTIwJTIwLS1scl93YXJtdXBfc3RlcHMlM0Q1MDAlMjAlNUMlMEElMjAlMjAtLW1peGVkX3ByZWNpc2lvbiUzRCUyMmZwMTYlMjIlMjAlNUMlMEElMjAlMjAtLWxvZ2dlciUzRCUyMndhbmRiJTIyJTIwJTVDJTBBJTIwJTIwLS1wdXNoX3RvX2h1Yg==",highlighted:`accelerate launch --mixed_precision=<span class="hljs-string">&quot;fp16&quot;</span> --multi_gpu train_unconditional.py \\
  --dataset_name=<span class="hljs-string">&quot;huggan/pokemon&quot;</span> \\
  --resolution=64 --center_crop --random_flip \\
  --output_dir=<span class="hljs-string">&quot;ddpm-ema-pokemon-64&quot;</span> \\
  --train_batch_size=16 \\
  --num_epochs=100 \\
  --gradient_accumulation_steps=1 \\
  --use_ema \\
  --learning_rate=1e-4 \\
  --lr_warmup_steps=500 \\
  --mixed_precision=<span class="hljs-string">&quot;fp16&quot;</span> \\
  --logger=<span class="hljs-string">&quot;wandb&quot;</span> \\
  --push_to_hub`}}),{c(){h=n("meta"),Z=p(),w=n("h1"),U=n("a"),Ue=n("span"),m(Q.$$.fragment),Ct=p(),$e=n("span"),Zt=s("Unconditional image generation"),Qe=p(),me=n("p"),Tt=s("Unconditional image generation is not conditioned on any text or images, unlike text- or image-to-image models. It only generates images that resemble its training data distribution."),Pe=p(),b=n("iframe"),ze=p(),T=n("p"),Xt=s("This guide will show you how to train an unconditional image generation model on existing datasets as well as your own custom dataset. All the training scripts for unconditional image generation can be found "),P=n("a"),Jt=s("here"),xt=s(" if you\u2019re interested in learning more about the training details."),Ie=p(),de=n("p"),Gt=s("Before running the script, make sure you install the library\u2019s training dependencies:"),Le=p(),m(z.$$.fragment),He=p(),X=n("p"),St=s("Next, initialize an \u{1F917} "),I=n("a"),Rt=s("Accelerate"),Yt=s(" environment with:"),Be=p(),m(L.$$.fragment),qe=p(),Me=n("p"),Vt=s("To setup a default \u{1F917} Accelerate environment without choosing any configurations:"),De=p(),m(H.$$.fragment),Oe=p(),ge=n("p"),Ft=s("Or if your environment doesn\u2019t support an interactive shell like a notebook, you can use:"),Ke=p(),m(B.$$.fragment),et=p(),N=n("h2"),J=n("a"),be=n("span"),m(q.$$.fragment),Qt=p(),Ee=n("span"),Pt=s("Upload model to Hub"),tt=p(),ye=n("p"),zt=s("You can upload your model on the Hub by adding the following argument to the training script:"),lt=p(),m(D.$$.fragment),at=p(),k=n("h2"),x=n("a"),je=n("span"),m(O.$$.fragment),It=p(),Ae=n("span"),Lt=s("Save and load checkpoints"),it=p(),_e=n("p"),Ht=s("It is a good idea to regularly save checkpoints in case anything happens during training. To save a checkpoint, pass the following argument to the training script:"),nt=p(),m(K.$$.fragment),ot=p(),E=n("p"),Bt=s("The full training state is saved in a subfolder in the "),Ne=n("code"),qt=s("output_dir"),Dt=s(" every 500 steps, which allows you to load a checkpoint and resume training if you pass the "),ke=n("code"),Ot=s("--resume_from_checkpoint"),Kt=s(" argument to the training script:"),rt=p(),m(ee.$$.fragment),st=p(),W=n("h2"),G=n("a"),We=n("span"),m(te.$$.fragment),el=p(),Ce=n("span"),tl=s("Finetuning"),ut=p(),v=n("p"),ll=s("You\u2019re ready to launch the "),le=n("a"),al=s("training script"),il=s(" now! Specify the dataset name to finetune on with the "),Ze=n("code"),nl=s("--dataset_name"),ol=s(" argument and then save it to the path in "),Te=n("code"),rl=s("--output_dir"),sl=s(". To use your own dataset, take a look at the "),we=n("a"),ul=s("Create a dataset for training"),fl=s(" guide."),ft=p(),S=n("p"),pl=s("The training script creates and saves a "),Xe=n("code"),cl=s("diffusion_pytorch_model.bin"),hl=s(" file in your repository."),pt=p(),m(R.$$.fragment),ct=p(),Y=n("p"),ml=s("For example, to finetune on the "),ae=n("a"),dl=s("Oxford Flowers"),Ml=s(" dataset:"),ht=p(),m(ie.$$.fragment),mt=p(),ne=n("div"),Je=n("img"),dt=p(),V=n("p"),gl=s("Or if you want to train your model on the "),oe=n("a"),yl=s("Pokemon"),_l=s(" dataset:"),Mt=p(),m(re.$$.fragment),gt=p(),se=n("div"),xe=n("img"),yt=p(),C=n("h3"),F=n("a"),Ge=n("span"),m(ue.$$.fragment),wl=p(),Se=n("span"),vl=s("Training with multiple GPUs"),_t=p(),$=n("p"),Re=n("code"),Ul=s("accelerate"),$l=s(" allows for seamless multi-GPU training. Follow the instructions "),fe=n("a"),bl=s("here"),El=s(`
for running distributed training with `),Ye=n("code"),jl=s("accelerate"),Al=s(". Here is an example command:"),wt=p(),m(pe.$$.fragment),this.h()},l(e){const a=ya('[data-svelte="svelte-1phssyn"]',document.head);h=o(a,"META",{name:!0,content:!0}),a.forEach(t),Z=c(e),w=o(e,"H1",{class:!0});var ce=r(w);U=o(ce,"A",{id:!0,class:!0,href:!0});var Zl=r(U);Ue=o(Zl,"SPAN",{});var Tl=r(Ue);d(Q.$$.fragment,Tl),Tl.forEach(t),Zl.forEach(t),Ct=c(ce),$e=o(ce,"SPAN",{});var Xl=r($e);Zt=u(Xl,"Unconditional image generation"),Xl.forEach(t),ce.forEach(t),Qe=c(e),me=o(e,"P",{});var Jl=r(me);Tt=u(Jl,"Unconditional image generation is not conditioned on any text or images, unlike text- or image-to-image models. It only generates images that resemble its training data distribution."),Jl.forEach(t),Pe=c(e),b=o(e,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0}),r(b).forEach(t),ze=c(e),T=o(e,"P",{});var Ut=r(T);Xt=u(Ut,"This guide will show you how to train an unconditional image generation model on existing datasets as well as your own custom dataset. All the training scripts for unconditional image generation can be found "),P=o(Ut,"A",{href:!0,rel:!0});var xl=r(P);Jt=u(xl,"here"),xl.forEach(t),xt=u(Ut," if you\u2019re interested in learning more about the training details."),Ut.forEach(t),Ie=c(e),de=o(e,"P",{});var Gl=r(de);Gt=u(Gl,"Before running the script, make sure you install the library\u2019s training dependencies:"),Gl.forEach(t),Le=c(e),d(z.$$.fragment,e),He=c(e),X=o(e,"P",{});var $t=r(X);St=u($t,"Next, initialize an \u{1F917} "),I=o($t,"A",{href:!0,rel:!0});var Sl=r(I);Rt=u(Sl,"Accelerate"),Sl.forEach(t),Yt=u($t," environment with:"),$t.forEach(t),Be=c(e),d(L.$$.fragment,e),qe=c(e),Me=o(e,"P",{});var Rl=r(Me);Vt=u(Rl,"To setup a default \u{1F917} Accelerate environment without choosing any configurations:"),Rl.forEach(t),De=c(e),d(H.$$.fragment,e),Oe=c(e),ge=o(e,"P",{});var Yl=r(ge);Ft=u(Yl,"Or if your environment doesn\u2019t support an interactive shell like a notebook, you can use:"),Yl.forEach(t),Ke=c(e),d(B.$$.fragment,e),et=c(e),N=o(e,"H2",{class:!0});var bt=r(N);J=o(bt,"A",{id:!0,class:!0,href:!0});var Vl=r(J);be=o(Vl,"SPAN",{});var Fl=r(be);d(q.$$.fragment,Fl),Fl.forEach(t),Vl.forEach(t),Qt=c(bt),Ee=o(bt,"SPAN",{});var Ql=r(Ee);Pt=u(Ql,"Upload model to Hub"),Ql.forEach(t),bt.forEach(t),tt=c(e),ye=o(e,"P",{});var Pl=r(ye);zt=u(Pl,"You can upload your model on the Hub by adding the following argument to the training script:"),Pl.forEach(t),lt=c(e),d(D.$$.fragment,e),at=c(e),k=o(e,"H2",{class:!0});var Et=r(k);x=o(Et,"A",{id:!0,class:!0,href:!0});var zl=r(x);je=o(zl,"SPAN",{});var Il=r(je);d(O.$$.fragment,Il),Il.forEach(t),zl.forEach(t),It=c(Et),Ae=o(Et,"SPAN",{});var Ll=r(Ae);Lt=u(Ll,"Save and load checkpoints"),Ll.forEach(t),Et.forEach(t),it=c(e),_e=o(e,"P",{});var Hl=r(_e);Ht=u(Hl,"It is a good idea to regularly save checkpoints in case anything happens during training. To save a checkpoint, pass the following argument to the training script:"),Hl.forEach(t),nt=c(e),d(K.$$.fragment,e),ot=c(e),E=o(e,"P",{});var ve=r(E);Bt=u(ve,"The full training state is saved in a subfolder in the "),Ne=o(ve,"CODE",{});var Bl=r(Ne);qt=u(Bl,"output_dir"),Bl.forEach(t),Dt=u(ve," every 500 steps, which allows you to load a checkpoint and resume training if you pass the "),ke=o(ve,"CODE",{});var ql=r(ke);Ot=u(ql,"--resume_from_checkpoint"),ql.forEach(t),Kt=u(ve," argument to the training script:"),ve.forEach(t),rt=c(e),d(ee.$$.fragment,e),st=c(e),W=o(e,"H2",{class:!0});var jt=r(W);G=o(jt,"A",{id:!0,class:!0,href:!0});var Dl=r(G);We=o(Dl,"SPAN",{});var Ol=r(We);d(te.$$.fragment,Ol),Ol.forEach(t),Dl.forEach(t),el=c(jt),Ce=o(jt,"SPAN",{});var Kl=r(Ce);tl=u(Kl,"Finetuning"),Kl.forEach(t),jt.forEach(t),ut=c(e),v=o(e,"P",{});var j=r(v);ll=u(j,"You\u2019re ready to launch the "),le=o(j,"A",{href:!0,rel:!0});var ea=r(le);al=u(ea,"training script"),ea.forEach(t),il=u(j," now! Specify the dataset name to finetune on with the "),Ze=o(j,"CODE",{});var ta=r(Ze);nl=u(ta,"--dataset_name"),ta.forEach(t),ol=u(j," argument and then save it to the path in "),Te=o(j,"CODE",{});var la=r(Te);rl=u(la,"--output_dir"),la.forEach(t),sl=u(j,". To use your own dataset, take a look at the "),we=o(j,"A",{href:!0});var aa=r(we);ul=u(aa,"Create a dataset for training"),aa.forEach(t),fl=u(j," guide."),j.forEach(t),ft=c(e),S=o(e,"P",{});var At=r(S);pl=u(At,"The training script creates and saves a "),Xe=o(At,"CODE",{});var ia=r(Xe);cl=u(ia,"diffusion_pytorch_model.bin"),ia.forEach(t),hl=u(At," file in your repository."),At.forEach(t),pt=c(e),d(R.$$.fragment,e),ct=c(e),Y=o(e,"P",{});var Nt=r(Y);ml=u(Nt,"For example, to finetune on the "),ae=o(Nt,"A",{href:!0,rel:!0});var na=r(ae);dl=u(na,"Oxford Flowers"),na.forEach(t),Ml=u(Nt," dataset:"),Nt.forEach(t),ht=c(e),d(ie.$$.fragment,e),mt=c(e),ne=o(e,"DIV",{class:!0});var oa=r(ne);Je=o(oa,"IMG",{src:!0}),oa.forEach(t),dt=c(e),V=o(e,"P",{});var kt=r(V);gl=u(kt,"Or if you want to train your model on the "),oe=o(kt,"A",{href:!0,rel:!0});var ra=r(oe);yl=u(ra,"Pokemon"),ra.forEach(t),_l=u(kt," dataset:"),kt.forEach(t),Mt=c(e),d(re.$$.fragment,e),gt=c(e),se=o(e,"DIV",{class:!0});var sa=r(se);xe=o(sa,"IMG",{src:!0}),sa.forEach(t),yt=c(e),C=o(e,"H3",{class:!0});var Wt=r(C);F=o(Wt,"A",{id:!0,class:!0,href:!0});var ua=r(F);Ge=o(ua,"SPAN",{});var fa=r(Ge);d(ue.$$.fragment,fa),fa.forEach(t),ua.forEach(t),wl=c(Wt),Se=o(Wt,"SPAN",{});var pa=r(Se);vl=u(pa,"Training with multiple GPUs"),pa.forEach(t),Wt.forEach(t),_t=c(e),$=o(e,"P",{});var he=r($);Re=o(he,"CODE",{});var ca=r(Re);Ul=u(ca,"accelerate"),ca.forEach(t),$l=u(he," allows for seamless multi-GPU training. Follow the instructions "),fe=o(he,"A",{href:!0,rel:!0});var ha=r(fe);bl=u(ha,"here"),ha.forEach(t),El=u(he,`
for running distributed training with `),Ye=o(he,"CODE",{});var ma=r(Ye);jl=u(ma,"accelerate"),ma.forEach(t),Al=u(he,". Here is an example command:"),he.forEach(t),wt=c(e),d(pe.$$.fragment,e),this.h()},h(){f(h,"name","hf:doc:metadata"),f(h,"content",JSON.stringify($a)),f(U,"id","unconditional-image-generation"),f(U,"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(U,"href","#unconditional-image-generation"),f(w,"class","relative group"),Nl(b.src,kl="https://stevhliu-ddpm-butterflies-128.hf.space")||f(b,"src",kl),f(b,"frameborder","0"),f(b,"width","850"),f(b,"height","550"),f(P,"href","https://github.com/huggingface/diffusers/tree/main/examples/unconditional_image_generation"),f(P,"rel","nofollow"),f(I,"href","https://github.com/huggingface/accelerate/"),f(I,"rel","nofollow"),f(J,"id","upload-model-to-hub"),f(J,"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(J,"href","#upload-model-to-hub"),f(N,"class","relative group"),f(x,"id","save-and-load-checkpoints"),f(x,"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(x,"href","#save-and-load-checkpoints"),f(k,"class","relative group"),f(G,"id","finetuning"),f(G,"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(G,"href","#finetuning"),f(W,"class","relative group"),f(le,"href","https://github.com/huggingface/diffusers/blob/main/examples/unconditional_image_generation/train_unconditional.py"),f(le,"rel","nofollow"),f(we,"href","create_dataset"),f(ae,"href","https://huggingface.co/datasets/huggan/flowers-102-categories"),f(ae,"rel","nofollow"),Nl(Je.src,Wl="https://user-images.githubusercontent.com/26864830/180248660-a0b143d0-b89a-42c5-8656-2ebf6ece7e52.png")||f(Je,"src",Wl),f(ne,"class","flex justify-center"),f(oe,"href","https://huggingface.co/datasets/huggan/pokemon"),f(oe,"rel","nofollow"),Nl(xe.src,Cl="https://user-images.githubusercontent.com/26864830/180248200-928953b4-db38-48db-b0c6-8b740fe6786f.png")||f(xe,"src",Cl),f(se,"class","flex justify-center"),f(F,"id","training-with-multiple-gpus"),f(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(F,"href","#training-with-multiple-gpus"),f(C,"class","relative group"),f(fe,"href","https://huggingface.co/docs/accelerate/basic_tutorials/launch"),f(fe,"rel","nofollow")},m(e,a){l(document.head,h),i(e,Z,a),i(e,w,a),l(w,U),l(U,Ue),M(Q,Ue,null),l(w,Ct),l(w,$e),l($e,Zt),i(e,Qe,a),i(e,me,a),l(me,Tt),i(e,Pe,a),i(e,b,a),i(e,ze,a),i(e,T,a),l(T,Xt),l(T,P),l(P,Jt),l(T,xt),i(e,Ie,a),i(e,de,a),l(de,Gt),i(e,Le,a),M(z,e,a),i(e,He,a),i(e,X,a),l(X,St),l(X,I),l(I,Rt),l(X,Yt),i(e,Be,a),M(L,e,a),i(e,qe,a),i(e,Me,a),l(Me,Vt),i(e,De,a),M(H,e,a),i(e,Oe,a),i(e,ge,a),l(ge,Ft),i(e,Ke,a),M(B,e,a),i(e,et,a),i(e,N,a),l(N,J),l(J,be),M(q,be,null),l(N,Qt),l(N,Ee),l(Ee,Pt),i(e,tt,a),i(e,ye,a),l(ye,zt),i(e,lt,a),M(D,e,a),i(e,at,a),i(e,k,a),l(k,x),l(x,je),M(O,je,null),l(k,It),l(k,Ae),l(Ae,Lt),i(e,it,a),i(e,_e,a),l(_e,Ht),i(e,nt,a),M(K,e,a),i(e,ot,a),i(e,E,a),l(E,Bt),l(E,Ne),l(Ne,qt),l(E,Dt),l(E,ke),l(ke,Ot),l(E,Kt),i(e,rt,a),M(ee,e,a),i(e,st,a),i(e,W,a),l(W,G),l(G,We),M(te,We,null),l(W,el),l(W,Ce),l(Ce,tl),i(e,ut,a),i(e,v,a),l(v,ll),l(v,le),l(le,al),l(v,il),l(v,Ze),l(Ze,nl),l(v,ol),l(v,Te),l(Te,rl),l(v,sl),l(v,we),l(we,ul),l(v,fl),i(e,ft,a),i(e,S,a),l(S,pl),l(S,Xe),l(Xe,cl),l(S,hl),i(e,pt,a),M(R,e,a),i(e,ct,a),i(e,Y,a),l(Y,ml),l(Y,ae),l(ae,dl),l(Y,Ml),i(e,ht,a),M(ie,e,a),i(e,mt,a),i(e,ne,a),l(ne,Je),i(e,dt,a),i(e,V,a),l(V,gl),l(V,oe),l(oe,yl),l(V,_l),i(e,Mt,a),M(re,e,a),i(e,gt,a),i(e,se,a),l(se,xe),i(e,yt,a),i(e,C,a),l(C,F),l(F,Ge),M(ue,Ge,null),l(C,wl),l(C,Se),l(Se,vl),i(e,_t,a),i(e,$,a),l($,Re),l(Re,Ul),l($,$l),l($,fe),l(fe,bl),l($,El),l($,Ye),l(Ye,jl),l($,Al),i(e,wt,a),M(pe,e,a),vt=!0},p(e,[a]){const ce={};a&2&&(ce.$$scope={dirty:a,ctx:e}),R.$set(ce)},i(e){vt||(g(Q.$$.fragment,e),g(z.$$.fragment,e),g(L.$$.fragment,e),g(H.$$.fragment,e),g(B.$$.fragment,e),g(q.$$.fragment,e),g(D.$$.fragment,e),g(O.$$.fragment,e),g(K.$$.fragment,e),g(ee.$$.fragment,e),g(te.$$.fragment,e),g(R.$$.fragment,e),g(ie.$$.fragment,e),g(re.$$.fragment,e),g(ue.$$.fragment,e),g(pe.$$.fragment,e),vt=!0)},o(e){y(Q.$$.fragment,e),y(z.$$.fragment,e),y(L.$$.fragment,e),y(H.$$.fragment,e),y(B.$$.fragment,e),y(q.$$.fragment,e),y(D.$$.fragment,e),y(O.$$.fragment,e),y(K.$$.fragment,e),y(ee.$$.fragment,e),y(te.$$.fragment,e),y(R.$$.fragment,e),y(ie.$$.fragment,e),y(re.$$.fragment,e),y(ue.$$.fragment,e),y(pe.$$.fragment,e),vt=!1},d(e){t(h),e&&t(Z),e&&t(w),_(Q),e&&t(Qe),e&&t(me),e&&t(Pe),e&&t(b),e&&t(ze),e&&t(T),e&&t(Ie),e&&t(de),e&&t(Le),_(z,e),e&&t(He),e&&t(X),e&&t(Be),_(L,e),e&&t(qe),e&&t(Me),e&&t(De),_(H,e),e&&t(Oe),e&&t(ge),e&&t(Ke),_(B,e),e&&t(et),e&&t(N),_(q),e&&t(tt),e&&t(ye),e&&t(lt),_(D,e),e&&t(at),e&&t(k),_(O),e&&t(it),e&&t(_e),e&&t(nt),_(K,e),e&&t(ot),e&&t(E),e&&t(rt),_(ee,e),e&&t(st),e&&t(W),_(te),e&&t(ut),e&&t(v),e&&t(ft),e&&t(S),e&&t(pt),_(R,e),e&&t(ct),e&&t(Y),e&&t(ht),_(ie,e),e&&t(mt),e&&t(ne),e&&t(dt),e&&t(V),e&&t(Mt),_(re,e),e&&t(gt),e&&t(se),e&&t(yt),e&&t(C),_(ue),e&&t(_t),e&&t($),e&&t(wt),_(pe,e)}}}const $a={local:"unconditional-image-generation",sections:[{local:"upload-model-to-hub",title:"Upload model to Hub"},{local:"save-and-load-checkpoints",title:"Save and load checkpoints"},{local:"finetuning",sections:[{local:"training-with-multiple-gpus",title:"Training with multiple GPUs"}],title:"Finetuning"}],title:"Unconditional image generation"};function ba(Fe){return _a(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ka extends da{constructor(h){super();Ma(this,h,ba,Ua,ga,{})}}export{ka as default,$a as metadata};
