import{s as B,n as F,o as J}from"../chunks/scheduler.d6170356.js";import{S as N,i as Q,g as m,s as i,r as M,A as V,h as g,f as n,c as o,j as O,u as S,x as C,k as Y,y as W,a,v as D,d as L,t as q,w as k}from"../chunks/index.fcd4cc08.js";import{H as R,E as X}from"../chunks/EditOnGithub.da2b595c.js";function Z(j){let s,w,y,b,l,_,r,v,d,z="The default Spaces environment comes with several pre-installed dependencies:",T,c,U='<li><p>The <a href="https://huggingface.co/docs/huggingface_hub/index" rel="nofollow"><code>huggingface_hub</code></a> client library allows you to manage your repository and files on the Hub with Python and programmatically access the Inference API from your Space. If you choose to instantiate the model in your app with the Inference API, you can benefit from the built-in acceleration optimizations. This option also consumes less computing resources, which is always nice for the environment! 🌎</p> <p>Refer to this <a href="https://huggingface.co/docs/huggingface_hub/how-to-inference" rel="nofollow">page</a> for more information on how to programmatically access the Inference API.</p></li> <li><p><a href="https://docs.python-requests.org/en/master/" rel="nofollow"><code>requests</code></a> is useful for calling third-party APIs from your app.</p></li> <li><p><a href="https://github.com/huggingface/datasets" rel="nofollow"><code>datasets</code></a> allows you to fetch or display any dataset from the Hub inside your app.</p></li> <li><p>The SDK you specified, which could be either <code>streamlit</code> or <code>gradio</code>. The version is specified in the <code>README.md</code> file.</p></li> <li><p>Common Debian packages, such as <code>ffmpeg</code>, <code>cmake</code>, <code>libsm6</code>, and few others.</p></li>',x,p,P,u,G="If you need other Python packages to run your app, add them to a <strong>requirements.txt</strong> file at the root of the repository. The Spaces runtime engine will create a custom environment on-the-fly. You can also add a <strong>pre-requirements.txt</strong> file describing dependencies that will be installed before your main dependencies. It can be useful if you need to update pip itself.",H,f,K="Debian dependencies are also supported. Add a <strong>packages.txt</strong> file at the root of your repository, and list all your dependencies in it. Each dependency should be on a separate line, and each line will be read and installed by <code>apt-get install</code>.",A,h,I,$,E;return l=new R({props:{title:"Handling Spaces Dependencies",local:"handling-spaces-dependencies",headingTag:"h1"}}),r=new R({props:{title:"Default dependencies",local:"default-dependencies",headingTag:"h2"}}),p=new R({props:{title:"Adding your own dependencies",local:"adding-your-own-dependencies",headingTag:"h2"}}),h=new X({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/spaces-dependencies.md"}}),{c(){s=m("meta"),w=i(),y=m("p"),b=i(),M(l.$$.fragment),_=i(),M(r.$$.fragment),v=i(),d=m("p"),d.textContent=z,T=i(),c=m("ul"),c.innerHTML=U,x=i(),M(p.$$.fragment),P=i(),u=m("p"),u.innerHTML=G,H=i(),f=m("p"),f.innerHTML=K,A=i(),M(h.$$.fragment),I=i(),$=m("p"),this.h()},l(e){const t=V("svelte-u9bgzb",document.head);s=g(t,"META",{name:!0,content:!0}),t.forEach(n),w=o(e),y=g(e,"P",{}),O(y).forEach(n),b=o(e),S(l.$$.fragment,e),_=o(e),S(r.$$.fragment,e),v=o(e),d=g(e,"P",{"data-svelte-h":!0}),C(d)!=="svelte-1ev06ts"&&(d.textContent=z),T=o(e),c=g(e,"UL",{"data-svelte-h":!0}),C(c)!=="svelte-h6mwq6"&&(c.innerHTML=U),x=o(e),S(p.$$.fragment,e),P=o(e),u=g(e,"P",{"data-svelte-h":!0}),C(u)!=="svelte-13qvdb7"&&(u.innerHTML=G),H=o(e),f=g(e,"P",{"data-svelte-h":!0}),C(f)!=="svelte-10nwxhj"&&(f.innerHTML=K),A=o(e),S(h.$$.fragment,e),I=o(e),$=g(e,"P",{}),O($).forEach(n),this.h()},h(){Y(s,"name","hf:doc:metadata"),Y(s,"content",ee)},m(e,t){W(document.head,s),a(e,w,t),a(e,y,t),a(e,b,t),D(l,e,t),a(e,_,t),D(r,e,t),a(e,v,t),a(e,d,t),a(e,T,t),a(e,c,t),a(e,x,t),D(p,e,t),a(e,P,t),a(e,u,t),a(e,H,t),a(e,f,t),a(e,A,t),D(h,e,t),a(e,I,t),a(e,$,t),E=!0},p:F,i(e){E||(L(l.$$.fragment,e),L(r.$$.fragment,e),L(p.$$.fragment,e),L(h.$$.fragment,e),E=!0)},o(e){q(l.$$.fragment,e),q(r.$$.fragment,e),q(p.$$.fragment,e),q(h.$$.fragment,e),E=!1},d(e){e&&(n(w),n(y),n(b),n(_),n(v),n(d),n(T),n(c),n(x),n(P),n(u),n(H),n(f),n(A),n(I),n($)),n(s),k(l,e),k(r,e),k(p,e),k(h,e)}}}const ee='{"title":"Handling Spaces Dependencies","local":"handling-spaces-dependencies","sections":[{"title":"Default dependencies","local":"default-dependencies","sections":[],"depth":2},{"title":"Adding your own dependencies","local":"adding-your-own-dependencies","sections":[],"depth":2}],"depth":1}';function te(j){return J(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class oe extends N{constructor(s){super(),Q(this,s,te,Z,B,{})}}export{oe as component};
