import{S as fd,i as vd,s as md,e as l,k as n,w as u,t as o,N as gd,c as r,d as a,m as c,a as s,x as f,h as i,b as h,P as oe,G as t,g as p,y as v,q as m,o as g,B as y,v as yd}from"../chunks/vendor-hf-doc-builder.js";import{T as wd}from"../chunks/Tip-hf-doc-builder.js";import{I as R}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as _t}from"../chunks/CodeBlock-hf-doc-builder.js";function _d(ol){let k;return{c(){k=o("Longer-term, we would also like to expose non-GPU hardware, like HPU, IPU or TPU. If you have a specific AI hardware you'd like to run on, please let us know (website at huggingface.co).")},l(H){k=i(H,"Longer-term, we would also like to expose non-GPU hardware, like HPU, IPU or TPU. If you have a specific AI hardware you'd like to run on, please let us know (website at huggingface.co).")},m(H,Y){p(H,k,Y)},d(H){H&&a(k)}}}function Ed(ol){let k,H,Y,ie,Et,Ae,Tr,bt,Sr,il,ne,Ur,$t,Pr,kr,nl,q,Oe,Vi,Gr,Qe,Fi,cl,ce,dl,ze,Ar,pl,V,Le,Oi,Dr,Ke,Qi,hl,F,de,Tt,De,Cr,St,Br,ul,et,Mr,fl,pe,Ut,_,Pt,kt,jr,xr,Gt,At,Jr,Nr,Dt,Ct,Ir,Yr,Bt,Mt,Rr,Hr,jt,xt,Zr,Wr,Jt,Nt,Xr,qr,w,E,It,Vr,Fr,Yt,Or,Qr,Rt,zr,Lr,Ht,Kr,es,Zt,ts,as,Wt,ls,rs,b,Xt,ss,os,qt,is,ns,Vt,cs,ds,Ft,ps,hs,Ot,us,fs,Qt,vs,ms,$,zt,gs,ys,Lt,ws,_s,Kt,Es,bs,ea,$s,Ts,ta,Ss,Us,aa,Ps,ks,T,la,Gs,As,ra,Ds,Cs,sa,Bs,Ms,oa,js,xs,ia,Js,Ns,na,Is,Ys,S,ca,Rs,Hs,da,Zs,Ws,pa,Xs,qs,ha,Vs,Fs,ua,Os,Qs,fa,zs,Ls,U,va,Ks,eo,ma,to,ao,ga,lo,ro,ya,so,oo,wa,io,no,_a,co,po,P,Ea,ho,uo,ba,fo,vo,$a,mo,go,Ta,yo,wo,Sa,_o,Eo,Ua,bo,vl,O,he,Pa,Ce,$o,ka,To,ml,Z,So,Ga,Uo,Po,Be,ko,Go,gl,Q,ue,Aa,Me,Ao,Da,Do,yl,tt,Co,wl,z,fe,Ca,je,Bo,Ba,Mo,_l,ve,jo,Ma,xo,Jo,El,xe,bl,me,No,ja,Io,Yo,$l,Je,Tl,D,Ro,xa,Ho,Zo,Ja,Wo,Xo,Na,qo,Vo,Sl,Ne,Ul,L,ge,Ia,Ie,Fo,Ya,Oo,Pl,ye,Qo,Ra,zo,Lo,kl,Ye,Gl,at,Ko,Al,Re,Dl,K,we,Ha,He,ei,Za,ti,Cl,G,ai,Wa,li,ri,Xa,si,oi,qa,ii,ni,Va,ci,di,Bl,Ze,Ml,ee,_e,Fa,We,pi,Oa,hi,jl,lt,ui,xl,Ee,fi,Qa,vi,mi,Jl,rt,gi,Nl,W,yi,st,wi,_i,ot,Ei,bi,Il,be,$i,it,Ti,Si,Yl,te,$e,za,Xe,Ui,La,Pi,Rl,nt,ki,Hl,ct,dt,zi,Zl,ae,Te,Ka,qe,Gi,el,Ai,Wl,Se,Di,tl,Ci,Bi,Xl,pt,Mi,ql,Ue,ji,al,xi,Ji,Vl,ht,Ni,Fl,le,ut,Li,Ii,ft,Ki,Ol,vt,Yi,Ql,re,mt,en,Ri,gt,tn,zl,se,Pe,ll,Ve,Hi,rl,Zi,Ll,ke,Wi,sl,Xi,qi,Kl;return Ae=new R({}),ce=new wd({props:{$$slots:{default:[_d]},$$scope:{ctx:ol}}}),De=new R({}),Ce=new R({}),Me=new R({}),je=new R({}),xe=new _t({props:{code:"LS1leHRyYS1pbmRleC11cmwlMjBodHRwcyUzQSUyRiUyRmRvd25sb2FkLnB5dG9yY2gub3JnJTJGd2hsJTJGY3UxMTMlMEF0b3JjaA==",highlighted:`--extra-index-url https:<span class="hljs-regexp">//</span>download.pytorch.org<span class="hljs-regexp">/whl/</span>cu113
torch`}}),Je=new _t({props:{code:"aW1wb3J0JTIwdG9yY2glMEFwcmludChmJTIySXMlMjBDVURBJTIwYXZhaWxhYmxlJTNBJTIwJTdCdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSU3RCUyMiklMEElMjMlMjBUcnVlJTBBcHJpbnQoZiUyMkNVREElMjBkZXZpY2UlM0ElMjAlN0J0b3JjaC5jdWRhLmdldF9kZXZpY2VfbmFtZSh0b3JjaC5jdWRhLmN1cnJlbnRfZGV2aWNlKCkpJTdEJTIyKSUwQSUyMyUyMFRlc2xhJTIwVDQ=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Is CUDA available: <span class="hljs-subst">{torch.cuda.is_available()}</span>&quot;</span>)
<span class="hljs-comment"># True</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;CUDA device: <span class="hljs-subst">{torch.cuda.get_device_name(torch.cuda.current_device())}</span>&quot;</span>)
<span class="hljs-comment"># Tesla T4</span>`}}),Ne=new _t({props:{code:"bW9kZWwlMjAlM0QlMjBsb2FkX3B5dG9yY2hfbW9kZWwoKSUwQW1vZGVsJTIwJTNEJTIwbW9kZWwudG8oJTIyY3VkYSUyMik=",highlighted:`model = load_pytorch_model()
model = model.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),Ie=new R({}),Ye=new _t({props:{code:"LWYlMjBodHRwcyUzQSUyRiUyRnN0b3JhZ2UuZ29vZ2xlYXBpcy5jb20lMkZqYXgtcmVsZWFzZXMlMkZqYXhfY3VkYV9yZWxlYXNlcy5odG1sJTBBamF4JTVCY3VkYTExX3BpcCU1RCUwQWpheGxpYg==",highlighted:`-f https:<span class="hljs-regexp">//</span>storage.googleapis.com<span class="hljs-regexp">/jax-releases/</span>jax_cuda_releases.html
jax[cuda11_pip]
jaxlib`}}),Re=new _t({props:{code:"aW1wb3J0JTIwamF4JTBBJTBBcHJpbnQoZiUyMkpBWCUyMGRldmljZXMlM0ElMjAlN0JqYXguZGV2aWNlcygpJTdEJTIyKSUwQSUyMyUyMEpBWCUyMGRldmljZXMlM0ElMjAlNUJTdHJlYW1FeGVjdXRvckdwdURldmljZShpZCUzRDAlMkMlMjBwcm9jZXNzX2luZGV4JTNEMCklNUQlMEFwcmludChmJTIySkFYJTIwZGV2aWNlJTIwdHlwZSUzQSUyMCU3QmpheC5kZXZpY2VzKCklNUIwJTVELmRldmljZV9raW5kJTdEJTIyKSUwQSUyMyUyMEpBWCUyMGRldmljZSUyMHR5cGUlM0ElMjBUZXNsYSUyMFQ0",highlighted:`<span class="hljs-keyword">import</span> jax

<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;JAX devices: <span class="hljs-subst">{jax.devices()}</span>&quot;</span>)
<span class="hljs-comment"># JAX devices: [StreamExecutorGpuDevice(id=0, process_index=0)]</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;JAX device type: <span class="hljs-subst">{jax.devices()[<span class="hljs-number">0</span>].device_kind}</span>&quot;</span>)
<span class="hljs-comment"># JAX device type: Tesla T4</span>`}}),He=new R({}),Ze=new _t({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEFwcmludCh0Zi5jb25maWcubGlzdF9waHlzaWNhbF9kZXZpY2VzKCdHUFUnKSklMEElMjMlMjAlNUJQaHlzaWNhbERldmljZShuYW1lJTNEJyUyRnBoeXNpY2FsX2RldmljZSUzQUdQVSUzQTAnJTJDJTIwZGV2aWNlX3R5cGUlM0QnR1BVJyklNUQ=",highlighted:`<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-built_in">print</span>(tf.config.list_physical_devices(<span class="hljs-string">&#x27;GPU&#x27;</span>))
<span class="hljs-comment"># [PhysicalDevice(name=&#x27;/physical_device:GPU:0&#x27;, device_type=&#x27;GPU&#x27;)]</span>`}}),We=new R({}),Xe=new R({}),qe=new R({}),Ve=new R({}),{c(){k=l("meta"),H=n(),Y=l("h1"),ie=l("a"),Et=l("span"),u(Ae.$$.fragment),Tr=n(),bt=l("span"),Sr=o("Using GPU Spaces"),il=n(),ne=l("p"),Ur=o("You can upgrade your Space to use a GPU accelerator using the "),$t=l("em"),Pr=o("Settings"),kr=o(" button in the top navigation bar of the Space. You can even request a free upgrade if you are building a cool demo for a side project!"),nl=n(),q=l("div"),Oe=l("img"),Gr=n(),Qe=l("img"),cl=n(),u(ce.$$.fragment),dl=n(),ze=l("p"),Ar=o("As soon as your Space is running on GPU you can see which hardware it\u2019s running on directly from this badge:"),pl=n(),V=l("div"),Le=l("img"),Dr=n(),Ke=l("img"),hl=n(),F=l("h2"),de=l("a"),Tt=l("span"),u(De.$$.fragment),Cr=n(),St=l("span"),Br=o("Hardware Specs"),ul=n(),et=l("p"),Mr=o("In the following table, you can see the Specs for the different upgrade options."),fl=n(),pe=l("table"),Ut=l("thead"),_=l("tr"),Pt=l("th"),kt=l("strong"),jr=o("Hardware"),xr=n(),Gt=l("th"),At=l("strong"),Jr=o("GPU Memory"),Nr=n(),Dt=l("th"),Ct=l("strong"),Ir=o("CPU"),Yr=n(),Bt=l("th"),Mt=l("strong"),Rr=o("Memory"),Hr=n(),jt=l("th"),xt=l("strong"),Zr=o("Disk"),Wr=n(),Jt=l("th"),Nt=l("strong"),Xr=o("Hourly Price"),qr=n(),w=l("tbody"),E=l("tr"),It=l("td"),Vr=o("CPU Basic"),Fr=n(),Yt=l("td"),Or=o("-"),Qr=n(),Rt=l("td"),zr=o("2 vCPU"),Lr=n(),Ht=l("td"),Kr=o("16 GB"),es=n(),Zt=l("td"),ts=o("50 GB"),as=n(),Wt=l("td"),ls=o("Free!"),rs=n(),b=l("tr"),Xt=l("td"),ss=o("CPU Upgrade"),os=n(),qt=l("td"),is=o("-"),ns=n(),Vt=l("td"),cs=o("8 vCPU"),ds=n(),Ft=l("td"),ps=o("32 GB"),hs=n(),Ot=l("td"),us=o("50 GB"),fs=n(),Qt=l("td"),vs=o("$0.03"),ms=n(),$=l("tr"),zt=l("td"),gs=o("Nvidia T4 - small"),ys=n(),Lt=l("td"),ws=o("16GB"),_s=n(),Kt=l("td"),Es=o("4 vCPU"),bs=n(),ea=l("td"),$s=o("15 GB"),Ts=n(),ta=l("td"),Ss=o("50 GB"),Us=n(),aa=l("td"),Ps=o("$0.60"),ks=n(),T=l("tr"),la=l("td"),Gs=o("Nvidia T4 - medium"),As=n(),ra=l("td"),Ds=o("16GB"),Cs=n(),sa=l("td"),Bs=o("8 vCPU"),Ms=n(),oa=l("td"),js=o("30 GB"),xs=n(),ia=l("td"),Js=o("100 GB"),Ns=n(),na=l("td"),Is=o("$0.90"),Ys=n(),S=l("tr"),ca=l("td"),Rs=o("Nvidia A10G - small"),Hs=n(),da=l("td"),Zs=o("24GB"),Ws=n(),pa=l("td"),Xs=o("4 vCPU"),qs=n(),ha=l("td"),Vs=o("15 GB"),Fs=n(),ua=l("td"),Os=o("110 GB"),Qs=n(),fa=l("td"),zs=o("$1.05"),Ls=n(),U=l("tr"),va=l("td"),Ks=o("Nvidia A10G - large"),eo=n(),ma=l("td"),to=o("24GB"),ao=n(),ga=l("td"),lo=o("12 vCPU"),ro=n(),ya=l("td"),so=o("46 GB"),oo=n(),wa=l("td"),io=o("200 GB"),no=n(),_a=l("td"),co=o("$3.15"),po=n(),P=l("tr"),Ea=l("td"),ho=o("Nvidia A100 - large"),uo=n(),ba=l("td"),fo=o("40GB"),vo=n(),$a=l("td"),mo=o("12 vCPU"),go=n(),Ta=l("td"),yo=o("142 GB"),wo=n(),Sa=l("td"),_o=o("1000 GB"),Eo=n(),Ua=l("td"),bo=o("$4.13"),vl=n(),O=l("h2"),he=l("a"),Pa=l("span"),u(Ce.$$.fragment),$o=n(),ka=l("span"),To=o("Configure hardware programmatically"),ml=n(),Z=l("p"),So=o("You can programmatically configure your Space hardware using "),Ga=l("code"),Uo=o("huggingface_hub"),Po=o(`. This allows for a wide range of use cases where you need to dynamically assign GPUs.
Check out `),Be=l("a"),ko=o("this guide"),Go=o(" for more details."),gl=n(),Q=l("h2"),ue=l("a"),Aa=l("span"),u(Me.$$.fragment),Ao=n(),Da=l("span"),Do=o("Framework specific requirements"),yl=n(),tt=l("p"),Co=o("Most Spaces should run out of the box after a GPU upgrade, but sometimes you\u2019ll need to install CUDA versions of the machine learning frameworks you use. Please, follow this guide to ensure your Space takes advantage of the improved hardware."),wl=n(),z=l("h3"),fe=l("a"),Ca=l("span"),u(je.$$.fragment),Bo=n(),Ba=l("span"),Mo=o("PyTorch"),_l=n(),ve=l("p"),jo=o("You\u2019ll need to install a version of PyTorch compatible with the built-in CUDA drivers. Adding the following two lines to your "),Ma=l("code"),xo=o("requirements.txt"),Jo=o(" file should work:"),El=n(),u(xe.$$.fragment),bl=n(),me=l("p"),No=o("You can verify whether the installation was successful by running the following code in your "),ja=l("code"),Io=o("app.py"),Yo=o(" and checking the output in your Space logs:"),$l=n(),u(Je.$$.fragment),Tl=n(),D=l("p"),Ro=o("Many frameworks automatically use the GPU if one is available. This is the case for the Pipelines in \u{1F917} "),xa=l("code"),Ho=o("transformers"),Zo=o(", "),Ja=l("code"),Wo=o("fastai"),Xo=o(" and many others. In other cases, or if you use PyTorch directly, you may need to move your models and data to the GPU to ensure computation is done on the accelerator and not on the CPU. You can use PyTorch\u2019s "),Na=l("code"),qo=o(".to()"),Vo=o(" syntax, for example:"),Sl=n(),u(Ne.$$.fragment),Ul=n(),L=l("h3"),ge=l("a"),Ia=l("span"),u(Ie.$$.fragment),Fo=n(),Ya=l("span"),Oo=o("JAX"),Pl=n(),ye=l("p"),Qo=o("If you use JAX, you need to specify the URL that contains CUDA compatible packages. Please, add the following lines to your "),Ra=l("code"),zo=o("requirements.txt"),Lo=o(" file:"),kl=n(),u(Ye.$$.fragment),Gl=n(),at=l("p"),Ko=o("After that, you can verify the installation by printing the output from the following code and checking it in your Space logs."),Al=n(),u(Re.$$.fragment),Dl=n(),K=l("h3"),we=l("a"),Ha=l("span"),u(He.$$.fragment),ei=n(),Za=l("span"),ti=o("Tensorflow"),Cl=n(),G=l("p"),ai=o("The default "),Wa=l("code"),li=o("tensorflow"),ri=o(" installation should recognize the CUDA device. Just add "),Xa=l("code"),si=o("tensorflow"),oi=o(" to your "),qa=l("code"),ii=o("requirements.txt"),ni=o(" file and use the following code in your "),Va=l("code"),ci=o("app.py"),di=o(" to verify in your Space logs."),Bl=n(),u(Ze.$$.fragment),Ml=n(),ee=l("h2"),_e=l("a"),Fa=l("span"),u(We.$$.fragment),pi=n(),Oa=l("span"),hi=o("Billing"),jl=n(),lt=l("p"),ui=o(`Billing on Spaces is based on hardware usage and is computed by the minute: you get charged for every minute the Space runs on the requested hardware,
regardless of whether the Space is used.`),xl=n(),Ee=l("p"),fi=o("During a Space\u2019s lifecycle, it is only billed when the Space is actually "),Qa=l("code"),vi=o("Running"),mi=o(". This means that there is no cost during build or startup."),Jl=n(),rt=l("p"),gi=o("If a running Space starts to fail, it will be automatically suspended and the billing will stop."),Nl=n(),W=l("p"),yi=o("Spaces running on free hardware are suspended automatically if they are not used for an extended period of time (e.g. two days). Upgraded Spaces run indefinitely by default, even if there is no usage. You can change this behavior by "),st=l("a"),wi=o("setting a custom \u201Csleep time\u201D"),_i=o(" in the Space\u2019s settings. To interrupt the billing on your Space, you can change the Hardware to CPU basic, or "),ot=l("a"),Ei=o("pause"),bi=o(" it."),Il=n(),be=l("p"),$i=o("Additional information about billing can be found in the "),it=l("a"),Ti=o("dedicated Hub-wide section"),Si=o("."),Yl=n(),te=l("h3"),$e=l("a"),za=l("span"),u(Xe.$$.fragment),Ui=n(),La=l("span"),Pi=o("Community GPU Grants"),Rl=n(),nt=l("p"),ki=o("Do you have an awesome Space but need help covering the GPU hardware upgrade costs? We love helping out those with an innovative Space so please feel free to apply for a community GPU grant and see if yours makes the cut! This application can be found in your Space hardware repo settings in the lower left corner under \u201Csleep time settings\u201D:"),Hl=n(),ct=l("p"),dt=l("img"),Zl=n(),ae=l("h2"),Te=l("a"),Ka=l("span"),u(qe.$$.fragment),Gi=n(),el=l("span"),Ai=o("Set a custom sleep time"),Wl=n(),Se=l("p"),Di=o("If your Space runs on the default "),tl=l("code"),Ci=o("cpu-basic"),Bi=o(" hardware, it will go to sleep if inactive for more than a set time (currently, 48 hours). Anyone visiting your Space will restart it automatically."),Xl=n(),pt=l("p"),Mi=o("If you want your Space never to deactivate or if you want to set a custom sleep time, you need to upgrade to a paid Hardware."),ql=n(),Ue=l("p"),ji=o("By default, an upgraded Space will never go to sleep. However, you can use this setting for your upgraded Space to become idle ("),al=l("code"),xi=o("stopped"),Ji=o(" stage) when it\u2019s unused \u{1F634}. You are not going to be charged for the upgraded hardware while it is asleep. The Space will \u2018wake up\u2019 or get restarted once it receives a new visitor."),Vl=n(),ht=l("p"),Ni=o("The following interface will then be available in your Spaces hardware settings:"),Fl=n(),le=l("div"),ut=l("img"),Ii=n(),ft=l("img"),Ol=n(),vt=l("p"),Yi=o("The following options are available:"),Ql=n(),re=l("div"),mt=l("img"),Ri=n(),gt=l("img"),zl=n(),se=l("h2"),Pe=l("a"),ll=l("span"),u(Ve.$$.fragment),Hi=n(),rl=l("span"),Zi=o("Pausing a Space"),Ll=n(),ke=l("p"),Wi=o("You can "),sl=l("code"),Xi=o("pause"),qi=o(" a Space from the repo settings. A \u201Cpaused\u201D Space means that the Space is on hold and will not use resources until manually restarted, and only the owner of a paused Space can restart it. Paused time is not billed."),this.h()},l(e){const d=gd('[data-svelte="svelte-1phssyn"]',document.head);k=r(d,"META",{name:!0,content:!0}),d.forEach(a),H=c(e),Y=r(e,"H1",{class:!0});var Fe=s(Y);ie=r(Fe,"A",{id:!0,class:!0,href:!0});var an=s(ie);Et=r(an,"SPAN",{});var ln=s(Et);f(Ae.$$.fragment,ln),ln.forEach(a),an.forEach(a),Tr=c(Fe),bt=r(Fe,"SPAN",{});var rn=s(bt);Sr=i(rn,"Using GPU Spaces"),rn.forEach(a),Fe.forEach(a),il=c(e),ne=r(e,"P",{});var er=s(ne);Ur=i(er,"You can upgrade your Space to use a GPU accelerator using the "),$t=r(er,"EM",{});var sn=s($t);Pr=i(sn,"Settings"),sn.forEach(a),kr=i(er," button in the top navigation bar of the Space. You can even request a free upgrade if you are building a cool demo for a side project!"),er.forEach(a),nl=c(e),q=r(e,"DIV",{class:!0});var tr=s(q);Oe=r(tr,"IMG",{class:!0,src:!0}),Gr=c(tr),Qe=r(tr,"IMG",{class:!0,src:!0}),tr.forEach(a),cl=c(e),f(ce.$$.fragment,e),dl=c(e),ze=r(e,"P",{});var on=s(ze);Ar=i(on,"As soon as your Space is running on GPU you can see which hardware it\u2019s running on directly from this badge:"),on.forEach(a),pl=c(e),V=r(e,"DIV",{class:!0});var ar=s(V);Le=r(ar,"IMG",{class:!0,src:!0}),Dr=c(ar),Ke=r(ar,"IMG",{class:!0,src:!0}),ar.forEach(a),hl=c(e),F=r(e,"H2",{class:!0});var lr=s(F);de=r(lr,"A",{id:!0,class:!0,href:!0});var nn=s(de);Tt=r(nn,"SPAN",{});var cn=s(Tt);f(De.$$.fragment,cn),cn.forEach(a),nn.forEach(a),Cr=c(lr),St=r(lr,"SPAN",{});var dn=s(St);Br=i(dn,"Hardware Specs"),dn.forEach(a),lr.forEach(a),ul=c(e),et=r(e,"P",{});var pn=s(et);Mr=i(pn,"In the following table, you can see the Specs for the different upgrade options."),pn.forEach(a),fl=c(e),pe=r(e,"TABLE",{});var rr=s(pe);Ut=r(rr,"THEAD",{});var hn=s(Ut);_=r(hn,"TR",{});var C=s(_);Pt=r(C,"TH",{});var un=s(Pt);kt=r(un,"STRONG",{});var fn=s(kt);jr=i(fn,"Hardware"),fn.forEach(a),un.forEach(a),xr=c(C),Gt=r(C,"TH",{});var vn=s(Gt);At=r(vn,"STRONG",{});var mn=s(At);Jr=i(mn,"GPU Memory"),mn.forEach(a),vn.forEach(a),Nr=c(C),Dt=r(C,"TH",{});var gn=s(Dt);Ct=r(gn,"STRONG",{});var yn=s(Ct);Ir=i(yn,"CPU"),yn.forEach(a),gn.forEach(a),Yr=c(C),Bt=r(C,"TH",{});var wn=s(Bt);Mt=r(wn,"STRONG",{});var _n=s(Mt);Rr=i(_n,"Memory"),_n.forEach(a),wn.forEach(a),Hr=c(C),jt=r(C,"TH",{});var En=s(jt);xt=r(En,"STRONG",{});var bn=s(xt);Zr=i(bn,"Disk"),bn.forEach(a),En.forEach(a),Wr=c(C),Jt=r(C,"TH",{});var $n=s(Jt);Nt=r($n,"STRONG",{});var Tn=s(Nt);Xr=i(Tn,"Hourly Price"),Tn.forEach(a),$n.forEach(a),C.forEach(a),hn.forEach(a),qr=c(rr),w=r(rr,"TBODY",{});var A=s(w);E=r(A,"TR",{});var B=s(E);It=r(B,"TD",{});var Sn=s(It);Vr=i(Sn,"CPU Basic"),Sn.forEach(a),Fr=c(B),Yt=r(B,"TD",{});var Un=s(Yt);Or=i(Un,"-"),Un.forEach(a),Qr=c(B),Rt=r(B,"TD",{});var Pn=s(Rt);zr=i(Pn,"2 vCPU"),Pn.forEach(a),Lr=c(B),Ht=r(B,"TD",{});var kn=s(Ht);Kr=i(kn,"16 GB"),kn.forEach(a),es=c(B),Zt=r(B,"TD",{});var Gn=s(Zt);ts=i(Gn,"50 GB"),Gn.forEach(a),as=c(B),Wt=r(B,"TD",{});var An=s(Wt);ls=i(An,"Free!"),An.forEach(a),B.forEach(a),rs=c(A),b=r(A,"TR",{});var M=s(b);Xt=r(M,"TD",{});var Dn=s(Xt);ss=i(Dn,"CPU Upgrade"),Dn.forEach(a),os=c(M),qt=r(M,"TD",{});var Cn=s(qt);is=i(Cn,"-"),Cn.forEach(a),ns=c(M),Vt=r(M,"TD",{});var Bn=s(Vt);cs=i(Bn,"8 vCPU"),Bn.forEach(a),ds=c(M),Ft=r(M,"TD",{});var Mn=s(Ft);ps=i(Mn,"32 GB"),Mn.forEach(a),hs=c(M),Ot=r(M,"TD",{});var jn=s(Ot);us=i(jn,"50 GB"),jn.forEach(a),fs=c(M),Qt=r(M,"TD",{});var xn=s(Qt);vs=i(xn,"$0.03"),xn.forEach(a),M.forEach(a),ms=c(A),$=r(A,"TR",{});var j=s($);zt=r(j,"TD",{});var Jn=s(zt);gs=i(Jn,"Nvidia T4 - small"),Jn.forEach(a),ys=c(j),Lt=r(j,"TD",{});var Nn=s(Lt);ws=i(Nn,"16GB"),Nn.forEach(a),_s=c(j),Kt=r(j,"TD",{});var In=s(Kt);Es=i(In,"4 vCPU"),In.forEach(a),bs=c(j),ea=r(j,"TD",{});var Yn=s(ea);$s=i(Yn,"15 GB"),Yn.forEach(a),Ts=c(j),ta=r(j,"TD",{});var Rn=s(ta);Ss=i(Rn,"50 GB"),Rn.forEach(a),Us=c(j),aa=r(j,"TD",{});var Hn=s(aa);Ps=i(Hn,"$0.60"),Hn.forEach(a),j.forEach(a),ks=c(A),T=r(A,"TR",{});var x=s(T);la=r(x,"TD",{});var Zn=s(la);Gs=i(Zn,"Nvidia T4 - medium"),Zn.forEach(a),As=c(x),ra=r(x,"TD",{});var Wn=s(ra);Ds=i(Wn,"16GB"),Wn.forEach(a),Cs=c(x),sa=r(x,"TD",{});var Xn=s(sa);Bs=i(Xn,"8 vCPU"),Xn.forEach(a),Ms=c(x),oa=r(x,"TD",{});var qn=s(oa);js=i(qn,"30 GB"),qn.forEach(a),xs=c(x),ia=r(x,"TD",{});var Vn=s(ia);Js=i(Vn,"100 GB"),Vn.forEach(a),Ns=c(x),na=r(x,"TD",{});var Fn=s(na);Is=i(Fn,"$0.90"),Fn.forEach(a),x.forEach(a),Ys=c(A),S=r(A,"TR",{});var J=s(S);ca=r(J,"TD",{});var On=s(ca);Rs=i(On,"Nvidia A10G - small"),On.forEach(a),Hs=c(J),da=r(J,"TD",{});var Qn=s(da);Zs=i(Qn,"24GB"),Qn.forEach(a),Ws=c(J),pa=r(J,"TD",{});var zn=s(pa);Xs=i(zn,"4 vCPU"),zn.forEach(a),qs=c(J),ha=r(J,"TD",{});var Ln=s(ha);Vs=i(Ln,"15 GB"),Ln.forEach(a),Fs=c(J),ua=r(J,"TD",{});var Kn=s(ua);Os=i(Kn,"110 GB"),Kn.forEach(a),Qs=c(J),fa=r(J,"TD",{});var ec=s(fa);zs=i(ec,"$1.05"),ec.forEach(a),J.forEach(a),Ls=c(A),U=r(A,"TR",{});var N=s(U);va=r(N,"TD",{});var tc=s(va);Ks=i(tc,"Nvidia A10G - large"),tc.forEach(a),eo=c(N),ma=r(N,"TD",{});var ac=s(ma);to=i(ac,"24GB"),ac.forEach(a),ao=c(N),ga=r(N,"TD",{});var lc=s(ga);lo=i(lc,"12 vCPU"),lc.forEach(a),ro=c(N),ya=r(N,"TD",{});var rc=s(ya);so=i(rc,"46 GB"),rc.forEach(a),oo=c(N),wa=r(N,"TD",{});var sc=s(wa);io=i(sc,"200 GB"),sc.forEach(a),no=c(N),_a=r(N,"TD",{});var oc=s(_a);co=i(oc,"$3.15"),oc.forEach(a),N.forEach(a),po=c(A),P=r(A,"TR",{});var I=s(P);Ea=r(I,"TD",{});var ic=s(Ea);ho=i(ic,"Nvidia A100 - large"),ic.forEach(a),uo=c(I),ba=r(I,"TD",{});var nc=s(ba);fo=i(nc,"40GB"),nc.forEach(a),vo=c(I),$a=r(I,"TD",{});var cc=s($a);mo=i(cc,"12 vCPU"),cc.forEach(a),go=c(I),Ta=r(I,"TD",{});var dc=s(Ta);yo=i(dc,"142 GB"),dc.forEach(a),wo=c(I),Sa=r(I,"TD",{});var pc=s(Sa);_o=i(pc,"1000 GB"),pc.forEach(a),Eo=c(I),Ua=r(I,"TD",{});var hc=s(Ua);bo=i(hc,"$4.13"),hc.forEach(a),I.forEach(a),A.forEach(a),rr.forEach(a),vl=c(e),O=r(e,"H2",{class:!0});var sr=s(O);he=r(sr,"A",{id:!0,class:!0,href:!0});var uc=s(he);Pa=r(uc,"SPAN",{});var fc=s(Pa);f(Ce.$$.fragment,fc),fc.forEach(a),uc.forEach(a),$o=c(sr),ka=r(sr,"SPAN",{});var vc=s(ka);To=i(vc,"Configure hardware programmatically"),vc.forEach(a),sr.forEach(a),ml=c(e),Z=r(e,"P",{});var yt=s(Z);So=i(yt,"You can programmatically configure your Space hardware using "),Ga=r(yt,"CODE",{});var mc=s(Ga);Uo=i(mc,"huggingface_hub"),mc.forEach(a),Po=i(yt,`. This allows for a wide range of use cases where you need to dynamically assign GPUs.
Check out `),Be=r(yt,"A",{href:!0,rel:!0});var gc=s(Be);ko=i(gc,"this guide"),gc.forEach(a),Go=i(yt," for more details."),yt.forEach(a),gl=c(e),Q=r(e,"H2",{class:!0});var or=s(Q);ue=r(or,"A",{id:!0,class:!0,href:!0});var yc=s(ue);Aa=r(yc,"SPAN",{});var wc=s(Aa);f(Me.$$.fragment,wc),wc.forEach(a),yc.forEach(a),Ao=c(or),Da=r(or,"SPAN",{});var _c=s(Da);Do=i(_c,"Framework specific requirements"),_c.forEach(a),or.forEach(a),yl=c(e),tt=r(e,"P",{});var Ec=s(tt);Co=i(Ec,"Most Spaces should run out of the box after a GPU upgrade, but sometimes you\u2019ll need to install CUDA versions of the machine learning frameworks you use. Please, follow this guide to ensure your Space takes advantage of the improved hardware."),Ec.forEach(a),wl=c(e),z=r(e,"H3",{class:!0});var ir=s(z);fe=r(ir,"A",{id:!0,class:!0,href:!0});var bc=s(fe);Ca=r(bc,"SPAN",{});var $c=s(Ca);f(je.$$.fragment,$c),$c.forEach(a),bc.forEach(a),Bo=c(ir),Ba=r(ir,"SPAN",{});var Tc=s(Ba);Mo=i(Tc,"PyTorch"),Tc.forEach(a),ir.forEach(a),_l=c(e),ve=r(e,"P",{});var nr=s(ve);jo=i(nr,"You\u2019ll need to install a version of PyTorch compatible with the built-in CUDA drivers. Adding the following two lines to your "),Ma=r(nr,"CODE",{});var Sc=s(Ma);xo=i(Sc,"requirements.txt"),Sc.forEach(a),Jo=i(nr," file should work:"),nr.forEach(a),El=c(e),f(xe.$$.fragment,e),bl=c(e),me=r(e,"P",{});var cr=s(me);No=i(cr,"You can verify whether the installation was successful by running the following code in your "),ja=r(cr,"CODE",{});var Uc=s(ja);Io=i(Uc,"app.py"),Uc.forEach(a),Yo=i(cr," and checking the output in your Space logs:"),cr.forEach(a),$l=c(e),f(Je.$$.fragment,e),Tl=c(e),D=r(e,"P",{});var Ge=s(D);Ro=i(Ge,"Many frameworks automatically use the GPU if one is available. This is the case for the Pipelines in \u{1F917} "),xa=r(Ge,"CODE",{});var Pc=s(xa);Ho=i(Pc,"transformers"),Pc.forEach(a),Zo=i(Ge,", "),Ja=r(Ge,"CODE",{});var kc=s(Ja);Wo=i(kc,"fastai"),kc.forEach(a),Xo=i(Ge," and many others. In other cases, or if you use PyTorch directly, you may need to move your models and data to the GPU to ensure computation is done on the accelerator and not on the CPU. You can use PyTorch\u2019s "),Na=r(Ge,"CODE",{});var Gc=s(Na);qo=i(Gc,".to()"),Gc.forEach(a),Vo=i(Ge," syntax, for example:"),Ge.forEach(a),Sl=c(e),f(Ne.$$.fragment,e),Ul=c(e),L=r(e,"H3",{class:!0});var dr=s(L);ge=r(dr,"A",{id:!0,class:!0,href:!0});var Ac=s(ge);Ia=r(Ac,"SPAN",{});var Dc=s(Ia);f(Ie.$$.fragment,Dc),Dc.forEach(a),Ac.forEach(a),Fo=c(dr),Ya=r(dr,"SPAN",{});var Cc=s(Ya);Oo=i(Cc,"JAX"),Cc.forEach(a),dr.forEach(a),Pl=c(e),ye=r(e,"P",{});var pr=s(ye);Qo=i(pr,"If you use JAX, you need to specify the URL that contains CUDA compatible packages. Please, add the following lines to your "),Ra=r(pr,"CODE",{});var Bc=s(Ra);zo=i(Bc,"requirements.txt"),Bc.forEach(a),Lo=i(pr," file:"),pr.forEach(a),kl=c(e),f(Ye.$$.fragment,e),Gl=c(e),at=r(e,"P",{});var Mc=s(at);Ko=i(Mc,"After that, you can verify the installation by printing the output from the following code and checking it in your Space logs."),Mc.forEach(a),Al=c(e),f(Re.$$.fragment,e),Dl=c(e),K=r(e,"H3",{class:!0});var hr=s(K);we=r(hr,"A",{id:!0,class:!0,href:!0});var jc=s(we);Ha=r(jc,"SPAN",{});var xc=s(Ha);f(He.$$.fragment,xc),xc.forEach(a),jc.forEach(a),ei=c(hr),Za=r(hr,"SPAN",{});var Jc=s(Za);ti=i(Jc,"Tensorflow"),Jc.forEach(a),hr.forEach(a),Cl=c(e),G=r(e,"P",{});var X=s(G);ai=i(X,"The default "),Wa=r(X,"CODE",{});var Nc=s(Wa);li=i(Nc,"tensorflow"),Nc.forEach(a),ri=i(X," installation should recognize the CUDA device. Just add "),Xa=r(X,"CODE",{});var Ic=s(Xa);si=i(Ic,"tensorflow"),Ic.forEach(a),oi=i(X," to your "),qa=r(X,"CODE",{});var Yc=s(qa);ii=i(Yc,"requirements.txt"),Yc.forEach(a),ni=i(X," file and use the following code in your "),Va=r(X,"CODE",{});var Rc=s(Va);ci=i(Rc,"app.py"),Rc.forEach(a),di=i(X," to verify in your Space logs."),X.forEach(a),Bl=c(e),f(Ze.$$.fragment,e),Ml=c(e),ee=r(e,"H2",{class:!0});var ur=s(ee);_e=r(ur,"A",{id:!0,class:!0,href:!0});var Hc=s(_e);Fa=r(Hc,"SPAN",{});var Zc=s(Fa);f(We.$$.fragment,Zc),Zc.forEach(a),Hc.forEach(a),pi=c(ur),Oa=r(ur,"SPAN",{});var Wc=s(Oa);hi=i(Wc,"Billing"),Wc.forEach(a),ur.forEach(a),jl=c(e),lt=r(e,"P",{});var Xc=s(lt);ui=i(Xc,`Billing on Spaces is based on hardware usage and is computed by the minute: you get charged for every minute the Space runs on the requested hardware,
regardless of whether the Space is used.`),Xc.forEach(a),xl=c(e),Ee=r(e,"P",{});var fr=s(Ee);fi=i(fr,"During a Space\u2019s lifecycle, it is only billed when the Space is actually "),Qa=r(fr,"CODE",{});var qc=s(Qa);vi=i(qc,"Running"),qc.forEach(a),mi=i(fr,". This means that there is no cost during build or startup."),fr.forEach(a),Jl=c(e),rt=r(e,"P",{});var Vc=s(rt);gi=i(Vc,"If a running Space starts to fail, it will be automatically suspended and the billing will stop."),Vc.forEach(a),Nl=c(e),W=r(e,"P",{});var wt=s(W);yi=i(wt,"Spaces running on free hardware are suspended automatically if they are not used for an extended period of time (e.g. two days). Upgraded Spaces run indefinitely by default, even if there is no usage. You can change this behavior by "),st=r(wt,"A",{href:!0});var Fc=s(st);wi=i(Fc,"setting a custom \u201Csleep time\u201D"),Fc.forEach(a),_i=i(wt," in the Space\u2019s settings. To interrupt the billing on your Space, you can change the Hardware to CPU basic, or "),ot=r(wt,"A",{href:!0});var Oc=s(ot);Ei=i(Oc,"pause"),Oc.forEach(a),bi=i(wt," it."),wt.forEach(a),Il=c(e),be=r(e,"P",{});var vr=s(be);$i=i(vr,"Additional information about billing can be found in the "),it=r(vr,"A",{href:!0});var Qc=s(it);Ti=i(Qc,"dedicated Hub-wide section"),Qc.forEach(a),Si=i(vr,"."),vr.forEach(a),Yl=c(e),te=r(e,"H3",{class:!0});var mr=s(te);$e=r(mr,"A",{id:!0,class:!0,href:!0});var zc=s($e);za=r(zc,"SPAN",{});var Lc=s(za);f(Xe.$$.fragment,Lc),Lc.forEach(a),zc.forEach(a),Ui=c(mr),La=r(mr,"SPAN",{});var Kc=s(La);Pi=i(Kc,"Community GPU Grants"),Kc.forEach(a),mr.forEach(a),Rl=c(e),nt=r(e,"P",{});var ed=s(nt);ki=i(ed,"Do you have an awesome Space but need help covering the GPU hardware upgrade costs? We love helping out those with an innovative Space so please feel free to apply for a community GPU grant and see if yours makes the cut! This application can be found in your Space hardware repo settings in the lower left corner under \u201Csleep time settings\u201D:"),ed.forEach(a),Hl=c(e),ct=r(e,"P",{});var td=s(ct);dt=r(td,"IMG",{src:!0,alt:!0}),td.forEach(a),Zl=c(e),ae=r(e,"H2",{class:!0});var gr=s(ae);Te=r(gr,"A",{id:!0,class:!0,href:!0});var ad=s(Te);Ka=r(ad,"SPAN",{});var ld=s(Ka);f(qe.$$.fragment,ld),ld.forEach(a),ad.forEach(a),Gi=c(gr),el=r(gr,"SPAN",{});var rd=s(el);Ai=i(rd,"Set a custom sleep time"),rd.forEach(a),gr.forEach(a),Wl=c(e),Se=r(e,"P",{});var yr=s(Se);Di=i(yr,"If your Space runs on the default "),tl=r(yr,"CODE",{});var sd=s(tl);Ci=i(sd,"cpu-basic"),sd.forEach(a),Bi=i(yr," hardware, it will go to sleep if inactive for more than a set time (currently, 48 hours). Anyone visiting your Space will restart it automatically."),yr.forEach(a),Xl=c(e),pt=r(e,"P",{});var od=s(pt);Mi=i(od,"If you want your Space never to deactivate or if you want to set a custom sleep time, you need to upgrade to a paid Hardware."),od.forEach(a),ql=c(e),Ue=r(e,"P",{});var wr=s(Ue);ji=i(wr,"By default, an upgraded Space will never go to sleep. However, you can use this setting for your upgraded Space to become idle ("),al=r(wr,"CODE",{});var id=s(al);xi=i(id,"stopped"),id.forEach(a),Ji=i(wr," stage) when it\u2019s unused \u{1F634}. You are not going to be charged for the upgraded hardware while it is asleep. The Space will \u2018wake up\u2019 or get restarted once it receives a new visitor."),wr.forEach(a),Vl=c(e),ht=r(e,"P",{});var nd=s(ht);Ni=i(nd,"The following interface will then be available in your Spaces hardware settings:"),nd.forEach(a),Fl=c(e),le=r(e,"DIV",{class:!0});var _r=s(le);ut=r(_r,"IMG",{class:!0,src:!0}),Ii=c(_r),ft=r(_r,"IMG",{class:!0,src:!0}),_r.forEach(a),Ol=c(e),vt=r(e,"P",{});var cd=s(vt);Yi=i(cd,"The following options are available:"),cd.forEach(a),Ql=c(e),re=r(e,"DIV",{class:!0});var Er=s(re);mt=r(Er,"IMG",{class:!0,src:!0}),Ri=c(Er),gt=r(Er,"IMG",{class:!0,src:!0}),Er.forEach(a),zl=c(e),se=r(e,"H2",{class:!0});var br=s(se);Pe=r(br,"A",{id:!0,class:!0,href:!0});var dd=s(Pe);ll=r(dd,"SPAN",{});var pd=s(ll);f(Ve.$$.fragment,pd),pd.forEach(a),dd.forEach(a),Hi=c(br),rl=r(br,"SPAN",{});var hd=s(rl);Zi=i(hd,"Pausing a Space"),hd.forEach(a),br.forEach(a),Ll=c(e),ke=r(e,"P",{});var $r=s(ke);Wi=i($r,"You can "),sl=r($r,"CODE",{});var ud=s(sl);Xi=i(ud,"pause"),ud.forEach(a),qi=i($r," a Space from the repo settings. A \u201Cpaused\u201D Space means that the Space is on hold and will not use resources until manually restarted, and only the owner of a paused Space can restart it. Paused time is not billed."),$r.forEach(a),this.h()},h(){h(k,"name","hf:doc:metadata"),h(k,"content",JSON.stringify(bd)),h(ie,"id","using-gpu-spaces"),h(ie,"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"),h(ie,"href","#using-gpu-spaces"),h(Y,"class","relative group"),h(Oe,"class","block dark:hidden"),oe(Oe.src,Vi="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/spaces-gpu-settings.png")||h(Oe,"src",Vi),h(Qe,"class","hidden dark:block"),oe(Qe.src,Fi="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/spaces-gpu-settings-dark.png")||h(Qe,"src",Fi),h(q,"class","flex justify-center"),h(Le,"class","block dark:hidden"),oe(Le.src,Oi="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/spaces-running-badge.png")||h(Le,"src",Oi),h(Ke,"class","hidden dark:block"),oe(Ke.src,Qi="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/spaces-running-badge-dark.png")||h(Ke,"src",Qi),h(V,"class","flex justify-center"),h(de,"id","hardware-specs"),h(de,"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"),h(de,"href","#hardware-specs"),h(F,"class","relative group"),h(he,"id","configure-hardware-programmatically"),h(he,"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"),h(he,"href","#configure-hardware-programmatically"),h(O,"class","relative group"),h(Be,"href","https://huggingface.co/docs/huggingface_hub/main/en/guides/manage_spaces"),h(Be,"rel","nofollow"),h(ue,"id","frameworks"),h(ue,"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"),h(ue,"href","#frameworks"),h(Q,"class","relative group"),h(fe,"id","pytorch"),h(fe,"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"),h(fe,"href","#pytorch"),h(z,"class","relative group"),h(ge,"id","jax"),h(ge,"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"),h(ge,"href","#jax"),h(L,"class","relative group"),h(we,"id","tensorflow"),h(we,"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"),h(we,"href","#tensorflow"),h(K,"class","relative group"),h(_e,"id","billing"),h(_e,"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"),h(_e,"href","#billing"),h(ee,"class","relative group"),h(st,"href","#sleep-time"),h(ot,"href","#pause"),h(it,"href","./billing"),h($e,"id","community-gpu-grants"),h($e,"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"),h($e,"href","#community-gpu-grants"),h(te,"class","relative group"),oe(dt.src,zi="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/ask-for-community-grant.png")||h(dt,"src",zi),h(dt,"alt","Community GPU Grant"),h(Te,"id","sleep-time"),h(Te,"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"),h(Te,"href","#sleep-time"),h(ae,"class","relative group"),h(ut,"class","block dark:hidden"),oe(ut.src,Li="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/spaces-sleep-time.png")||h(ut,"src",Li),h(ft,"class","hidden dark:block"),oe(ft.src,Ki="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/spaces-sleep-time-dark.png")||h(ft,"src",Ki),h(le,"class","flex justify-center"),h(mt,"class","block dark:hidden"),oe(mt.src,en="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/spaces-sleep-time-options.png")||h(mt,"src",en),h(gt,"class","hidden dark:block"),oe(gt.src,tn="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/spaces-sleep-time-options-dark.png")||h(gt,"src",tn),h(re,"class","flex justify-center"),h(Pe,"id","pause"),h(Pe,"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"),h(Pe,"href","#pause"),h(se,"class","relative group")},m(e,d){t(document.head,k),p(e,H,d),p(e,Y,d),t(Y,ie),t(ie,Et),v(Ae,Et,null),t(Y,Tr),t(Y,bt),t(bt,Sr),p(e,il,d),p(e,ne,d),t(ne,Ur),t(ne,$t),t($t,Pr),t(ne,kr),p(e,nl,d),p(e,q,d),t(q,Oe),t(q,Gr),t(q,Qe),p(e,cl,d),v(ce,e,d),p(e,dl,d),p(e,ze,d),t(ze,Ar),p(e,pl,d),p(e,V,d),t(V,Le),t(V,Dr),t(V,Ke),p(e,hl,d),p(e,F,d),t(F,de),t(de,Tt),v(De,Tt,null),t(F,Cr),t(F,St),t(St,Br),p(e,ul,d),p(e,et,d),t(et,Mr),p(e,fl,d),p(e,pe,d),t(pe,Ut),t(Ut,_),t(_,Pt),t(Pt,kt),t(kt,jr),t(_,xr),t(_,Gt),t(Gt,At),t(At,Jr),t(_,Nr),t(_,Dt),t(Dt,Ct),t(Ct,Ir),t(_,Yr),t(_,Bt),t(Bt,Mt),t(Mt,Rr),t(_,Hr),t(_,jt),t(jt,xt),t(xt,Zr),t(_,Wr),t(_,Jt),t(Jt,Nt),t(Nt,Xr),t(pe,qr),t(pe,w),t(w,E),t(E,It),t(It,Vr),t(E,Fr),t(E,Yt),t(Yt,Or),t(E,Qr),t(E,Rt),t(Rt,zr),t(E,Lr),t(E,Ht),t(Ht,Kr),t(E,es),t(E,Zt),t(Zt,ts),t(E,as),t(E,Wt),t(Wt,ls),t(w,rs),t(w,b),t(b,Xt),t(Xt,ss),t(b,os),t(b,qt),t(qt,is),t(b,ns),t(b,Vt),t(Vt,cs),t(b,ds),t(b,Ft),t(Ft,ps),t(b,hs),t(b,Ot),t(Ot,us),t(b,fs),t(b,Qt),t(Qt,vs),t(w,ms),t(w,$),t($,zt),t(zt,gs),t($,ys),t($,Lt),t(Lt,ws),t($,_s),t($,Kt),t(Kt,Es),t($,bs),t($,ea),t(ea,$s),t($,Ts),t($,ta),t(ta,Ss),t($,Us),t($,aa),t(aa,Ps),t(w,ks),t(w,T),t(T,la),t(la,Gs),t(T,As),t(T,ra),t(ra,Ds),t(T,Cs),t(T,sa),t(sa,Bs),t(T,Ms),t(T,oa),t(oa,js),t(T,xs),t(T,ia),t(ia,Js),t(T,Ns),t(T,na),t(na,Is),t(w,Ys),t(w,S),t(S,ca),t(ca,Rs),t(S,Hs),t(S,da),t(da,Zs),t(S,Ws),t(S,pa),t(pa,Xs),t(S,qs),t(S,ha),t(ha,Vs),t(S,Fs),t(S,ua),t(ua,Os),t(S,Qs),t(S,fa),t(fa,zs),t(w,Ls),t(w,U),t(U,va),t(va,Ks),t(U,eo),t(U,ma),t(ma,to),t(U,ao),t(U,ga),t(ga,lo),t(U,ro),t(U,ya),t(ya,so),t(U,oo),t(U,wa),t(wa,io),t(U,no),t(U,_a),t(_a,co),t(w,po),t(w,P),t(P,Ea),t(Ea,ho),t(P,uo),t(P,ba),t(ba,fo),t(P,vo),t(P,$a),t($a,mo),t(P,go),t(P,Ta),t(Ta,yo),t(P,wo),t(P,Sa),t(Sa,_o),t(P,Eo),t(P,Ua),t(Ua,bo),p(e,vl,d),p(e,O,d),t(O,he),t(he,Pa),v(Ce,Pa,null),t(O,$o),t(O,ka),t(ka,To),p(e,ml,d),p(e,Z,d),t(Z,So),t(Z,Ga),t(Ga,Uo),t(Z,Po),t(Z,Be),t(Be,ko),t(Z,Go),p(e,gl,d),p(e,Q,d),t(Q,ue),t(ue,Aa),v(Me,Aa,null),t(Q,Ao),t(Q,Da),t(Da,Do),p(e,yl,d),p(e,tt,d),t(tt,Co),p(e,wl,d),p(e,z,d),t(z,fe),t(fe,Ca),v(je,Ca,null),t(z,Bo),t(z,Ba),t(Ba,Mo),p(e,_l,d),p(e,ve,d),t(ve,jo),t(ve,Ma),t(Ma,xo),t(ve,Jo),p(e,El,d),v(xe,e,d),p(e,bl,d),p(e,me,d),t(me,No),t(me,ja),t(ja,Io),t(me,Yo),p(e,$l,d),v(Je,e,d),p(e,Tl,d),p(e,D,d),t(D,Ro),t(D,xa),t(xa,Ho),t(D,Zo),t(D,Ja),t(Ja,Wo),t(D,Xo),t(D,Na),t(Na,qo),t(D,Vo),p(e,Sl,d),v(Ne,e,d),p(e,Ul,d),p(e,L,d),t(L,ge),t(ge,Ia),v(Ie,Ia,null),t(L,Fo),t(L,Ya),t(Ya,Oo),p(e,Pl,d),p(e,ye,d),t(ye,Qo),t(ye,Ra),t(Ra,zo),t(ye,Lo),p(e,kl,d),v(Ye,e,d),p(e,Gl,d),p(e,at,d),t(at,Ko),p(e,Al,d),v(Re,e,d),p(e,Dl,d),p(e,K,d),t(K,we),t(we,Ha),v(He,Ha,null),t(K,ei),t(K,Za),t(Za,ti),p(e,Cl,d),p(e,G,d),t(G,ai),t(G,Wa),t(Wa,li),t(G,ri),t(G,Xa),t(Xa,si),t(G,oi),t(G,qa),t(qa,ii),t(G,ni),t(G,Va),t(Va,ci),t(G,di),p(e,Bl,d),v(Ze,e,d),p(e,Ml,d),p(e,ee,d),t(ee,_e),t(_e,Fa),v(We,Fa,null),t(ee,pi),t(ee,Oa),t(Oa,hi),p(e,jl,d),p(e,lt,d),t(lt,ui),p(e,xl,d),p(e,Ee,d),t(Ee,fi),t(Ee,Qa),t(Qa,vi),t(Ee,mi),p(e,Jl,d),p(e,rt,d),t(rt,gi),p(e,Nl,d),p(e,W,d),t(W,yi),t(W,st),t(st,wi),t(W,_i),t(W,ot),t(ot,Ei),t(W,bi),p(e,Il,d),p(e,be,d),t(be,$i),t(be,it),t(it,Ti),t(be,Si),p(e,Yl,d),p(e,te,d),t(te,$e),t($e,za),v(Xe,za,null),t(te,Ui),t(te,La),t(La,Pi),p(e,Rl,d),p(e,nt,d),t(nt,ki),p(e,Hl,d),p(e,ct,d),t(ct,dt),p(e,Zl,d),p(e,ae,d),t(ae,Te),t(Te,Ka),v(qe,Ka,null),t(ae,Gi),t(ae,el),t(el,Ai),p(e,Wl,d),p(e,Se,d),t(Se,Di),t(Se,tl),t(tl,Ci),t(Se,Bi),p(e,Xl,d),p(e,pt,d),t(pt,Mi),p(e,ql,d),p(e,Ue,d),t(Ue,ji),t(Ue,al),t(al,xi),t(Ue,Ji),p(e,Vl,d),p(e,ht,d),t(ht,Ni),p(e,Fl,d),p(e,le,d),t(le,ut),t(le,Ii),t(le,ft),p(e,Ol,d),p(e,vt,d),t(vt,Yi),p(e,Ql,d),p(e,re,d),t(re,mt),t(re,Ri),t(re,gt),p(e,zl,d),p(e,se,d),t(se,Pe),t(Pe,ll),v(Ve,ll,null),t(se,Hi),t(se,rl),t(rl,Zi),p(e,Ll,d),p(e,ke,d),t(ke,Wi),t(ke,sl),t(sl,Xi),t(ke,qi),Kl=!0},p(e,[d]){const Fe={};d&2&&(Fe.$$scope={dirty:d,ctx:e}),ce.$set(Fe)},i(e){Kl||(m(Ae.$$.fragment,e),m(ce.$$.fragment,e),m(De.$$.fragment,e),m(Ce.$$.fragment,e),m(Me.$$.fragment,e),m(je.$$.fragment,e),m(xe.$$.fragment,e),m(Je.$$.fragment,e),m(Ne.$$.fragment,e),m(Ie.$$.fragment,e),m(Ye.$$.fragment,e),m(Re.$$.fragment,e),m(He.$$.fragment,e),m(Ze.$$.fragment,e),m(We.$$.fragment,e),m(Xe.$$.fragment,e),m(qe.$$.fragment,e),m(Ve.$$.fragment,e),Kl=!0)},o(e){g(Ae.$$.fragment,e),g(ce.$$.fragment,e),g(De.$$.fragment,e),g(Ce.$$.fragment,e),g(Me.$$.fragment,e),g(je.$$.fragment,e),g(xe.$$.fragment,e),g(Je.$$.fragment,e),g(Ne.$$.fragment,e),g(Ie.$$.fragment,e),g(Ye.$$.fragment,e),g(Re.$$.fragment,e),g(He.$$.fragment,e),g(Ze.$$.fragment,e),g(We.$$.fragment,e),g(Xe.$$.fragment,e),g(qe.$$.fragment,e),g(Ve.$$.fragment,e),Kl=!1},d(e){a(k),e&&a(H),e&&a(Y),y(Ae),e&&a(il),e&&a(ne),e&&a(nl),e&&a(q),e&&a(cl),y(ce,e),e&&a(dl),e&&a(ze),e&&a(pl),e&&a(V),e&&a(hl),e&&a(F),y(De),e&&a(ul),e&&a(et),e&&a(fl),e&&a(pe),e&&a(vl),e&&a(O),y(Ce),e&&a(ml),e&&a(Z),e&&a(gl),e&&a(Q),y(Me),e&&a(yl),e&&a(tt),e&&a(wl),e&&a(z),y(je),e&&a(_l),e&&a(ve),e&&a(El),y(xe,e),e&&a(bl),e&&a(me),e&&a($l),y(Je,e),e&&a(Tl),e&&a(D),e&&a(Sl),y(Ne,e),e&&a(Ul),e&&a(L),y(Ie),e&&a(Pl),e&&a(ye),e&&a(kl),y(Ye,e),e&&a(Gl),e&&a(at),e&&a(Al),y(Re,e),e&&a(Dl),e&&a(K),y(He),e&&a(Cl),e&&a(G),e&&a(Bl),y(Ze,e),e&&a(Ml),e&&a(ee),y(We),e&&a(jl),e&&a(lt),e&&a(xl),e&&a(Ee),e&&a(Jl),e&&a(rt),e&&a(Nl),e&&a(W),e&&a(Il),e&&a(be),e&&a(Yl),e&&a(te),y(Xe),e&&a(Rl),e&&a(nt),e&&a(Hl),e&&a(ct),e&&a(Zl),e&&a(ae),y(qe),e&&a(Wl),e&&a(Se),e&&a(Xl),e&&a(pt),e&&a(ql),e&&a(Ue),e&&a(Vl),e&&a(ht),e&&a(Fl),e&&a(le),e&&a(Ol),e&&a(vt),e&&a(Ql),e&&a(re),e&&a(zl),e&&a(se),y(Ve),e&&a(Ll),e&&a(ke)}}}const bd={local:"using-gpu-spaces",sections:[{local:"hardware-specs",title:"Hardware Specs"},{local:"configure-hardware-programmatically",title:"Configure hardware programmatically"},{local:"frameworks",sections:[{local:"pytorch",title:"PyTorch"},{local:"jax",title:"JAX"},{local:"tensorflow",title:"Tensorflow"}],title:"Framework specific requirements"},{local:"billing",sections:[{local:"community-gpu-grants",title:"Community GPU Grants "}],title:"Billing"},{local:"sleep-time",title:"Set a custom sleep time"},{local:"pause",title:"Pausing a Space"}],title:"Using GPU Spaces"};function $d(ol){return yd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class kd extends fd{constructor(k){super();vd(this,k,$d,Ed,md,{})}}export{kd as default,bd as metadata};
