import{s as be,o as $e,n as we}from"../chunks/scheduler.d6170356.js";import{S as ye,i as Me,g as o,s as i,r as d,A as _e,h as r,f as l,c as n,j as ce,u as g,x as c,k as ne,y as Te,a,v as f,d as u,t as p,w as h}from"../chunks/index.fcd4cc08.js";import{T as Ue}from"../chunks/Tip.b09c67cf.js";import{C as se}from"../chunks/CodeBlock.7b16bdef.js";import{H as L,E as ve}from"../chunks/EditOnGithub.da2b595c.js";function ke(W){let s,y=`<code>hf_transfer</code> is a power user tool!
It is tested and production-ready,
but it lacks user-friendly features like advanced error handling or proxies.
For more details, please take a look at this <a href="https://huggingface.co/docs/huggingface_hub/hf_transfer" rel="nofollow">guide</a>.`;return{c(){s=o("p"),s.innerHTML=y},l(m){s=r(m,"P",{"data-svelte-h":!0}),c(s)!=="svelte-g0nrx2"&&(s.innerHTML=y)},m(m,Z){a(m,s,Z)},p:we,d(m){m&&l(s)}}}function Ce(W){let s,y,m,Z,M,Y,_,Q,T,oe='If a model on the Hub is tied to a <a href="./models-libraries">supported library</a>, loading the model can be done in just a few lines. For information on accessing the model, you can click on the “Use in <em>Library</em>” button on the model page to see how to do so. For example, <code>distilbert/distilgpt2</code> shows how to do so with 🤗 Transformers below.',R,b,re='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-usage.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-usage-dark.png"/>',P,$,me='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-usage-modal.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-usage-modal-dark.png"/>',B,U,z,v,de='You can use the <a href="https://github.com/huggingface/huggingface_hub" rel="nofollow"><code>huggingface_hub</code></a> library to create, delete, update and retrieve information from repos. You can also download files from repos or integrate them into your library! For example, you can quickly load a Scikit-learn model with a few lines.',N,k,A,C,V,E,ge="Since all models on the Model Hub are Git repositories, you can clone the models locally by running:",D,F,q,j,fe="If you have write-access to the particular model repo, you’ll also have the ability to commit and push revisions to the model.",O,x,ue='Add your SSH public key to <a href="https://huggingface.co/settings/keys" rel="nofollow">your user settings</a> to push changes and/or access private repos.',X,G,K,J,pe=`If you are running on a machine with high bandwidth,
you can increase your download speed with <a href="https://github.com/huggingface/hf_transfer" rel="nofollow"><code>hf_transfer</code></a>,
a Rust-based library developed to speed up file transfers with the Hub.`,ee,I,te,w,le,H,ae,S,ie;return M=new L({props:{title:"Downloading models",local:"downloading-models",headingTag:"h1"}}),_=new L({props:{title:"Integrated libraries",local:"integrated-libraries",headingTag:"h2"}}),U=new L({props:{title:"Using the Hugging Face Client Library",local:"using-the-hugging-face-client-library",headingTag:"h2"}}),k=new se({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGhmX2h1Yl9kb3dubG9hZCUwQWltcG9ydCUyMGpvYmxpYiUwQSUwQVJFUE9fSUQlMjAlM0QlMjAlMjJZT1VSX1JFUE9fSUQlMjIlMEFGSUxFTkFNRSUyMCUzRCUyMCUyMnNrbGVhcm5fbW9kZWwuam9ibGliJTIyJTBBJTBBbW9kZWwlMjAlM0QlMjBqb2JsaWIubG9hZCglMEElMjAlMjAlMjAlMjBoZl9odWJfZG93bmxvYWQocmVwb19pZCUzRFJFUE9fSUQlMkMlMjBmaWxlbmFtZSUzREZJTEVOQU1FKSUwQSk=",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download
<span class="hljs-keyword">import</span> joblib

REPO_ID = <span class="hljs-string">&quot;YOUR_REPO_ID&quot;</span>
FILENAME = <span class="hljs-string">&quot;sklearn_model.joblib&quot;</span>

model = joblib.load(
    hf_hub_download(repo_id=REPO_ID, filename=FILENAME)
)`,wrap:!1}}),C=new L({props:{title:"Using Git",local:"using-git",headingTag:"h2"}}),F=new se({props:{code:"Z2l0JTIwbGZzJTIwaW5zdGFsbCUwQWdpdCUyMGNsb25lJTIwZ2l0JTQwaGYuY28lM0ElM0NNT0RFTCUyMElEJTNFJTIwJTIzJTIwZXhhbXBsZSUzQSUyMGdpdCUyMGNsb25lJTIwZ2l0JTQwaGYuY28lM0FiaWdzY2llbmNlJTJGYmxvb20=",highlighted:`git lfs install
git <span class="hljs-built_in">clone</span> git@hf.co:&lt;MODEL ID&gt; <span class="hljs-comment"># example: git clone git@hf.co:bigscience/bloom</span>`,wrap:!1}}),G=new L({props:{title:"Faster downloads",local:"faster-downloads",headingTag:"h2"}}),I=new se({props:{code:"cGlwJTIwaW5zdGFsbCUyMGh1Z2dpbmdmYWNlX2h1YiU1QmhmX3RyYW5zZmVyJTVEJTBBSEZfSFVCX0VOQUJMRV9IRl9UUkFOU0ZFUiUzRDElMjBodWdnaW5nZmFjZS1jbGklMjBkb3dubG9hZCUyMC4uLg==",highlighted:`pip install huggingface_hub[hf_transfer]
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download ...`,wrap:!1}}),w=new Ue({props:{warning:!0,$$slots:{default:[ke]},$$scope:{ctx:W}}}),H=new ve({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/models-downloading.md"}}),{c(){s=o("meta"),y=i(),m=o("p"),Z=i(),d(M.$$.fragment),Y=i(),d(_.$$.fragment),Q=i(),T=o("p"),T.innerHTML=oe,R=i(),b=o("div"),b.innerHTML=re,P=i(),$=o("div"),$.innerHTML=me,B=i(),d(U.$$.fragment),z=i(),v=o("p"),v.innerHTML=de,N=i(),d(k.$$.fragment),A=i(),d(C.$$.fragment),V=i(),E=o("p"),E.textContent=ge,D=i(),d(F.$$.fragment),q=i(),j=o("p"),j.textContent=fe,O=i(),x=o("p"),x.innerHTML=ue,X=i(),d(G.$$.fragment),K=i(),J=o("p"),J.innerHTML=pe,ee=i(),d(I.$$.fragment),te=i(),d(w.$$.fragment),le=i(),d(H.$$.fragment),ae=i(),S=o("p"),this.h()},l(e){const t=_e("svelte-u9bgzb",document.head);s=r(t,"META",{name:!0,content:!0}),t.forEach(l),y=n(e),m=r(e,"P",{}),ce(m).forEach(l),Z=n(e),g(M.$$.fragment,e),Y=n(e),g(_.$$.fragment,e),Q=n(e),T=r(e,"P",{"data-svelte-h":!0}),c(T)!=="svelte-1ydsvzi"&&(T.innerHTML=oe),R=n(e),b=r(e,"DIV",{class:!0,"data-svelte-h":!0}),c(b)!=="svelte-wnwui5"&&(b.innerHTML=re),P=n(e),$=r(e,"DIV",{class:!0,"data-svelte-h":!0}),c($)!=="svelte-1ykqzq1"&&($.innerHTML=me),B=n(e),g(U.$$.fragment,e),z=n(e),v=r(e,"P",{"data-svelte-h":!0}),c(v)!=="svelte-14cbfij"&&(v.innerHTML=de),N=n(e),g(k.$$.fragment,e),A=n(e),g(C.$$.fragment,e),V=n(e),E=r(e,"P",{"data-svelte-h":!0}),c(E)!=="svelte-eeemds"&&(E.textContent=ge),D=n(e),g(F.$$.fragment,e),q=n(e),j=r(e,"P",{"data-svelte-h":!0}),c(j)!=="svelte-16ip9pe"&&(j.textContent=fe),O=n(e),x=r(e,"P",{"data-svelte-h":!0}),c(x)!=="svelte-nl03my"&&(x.innerHTML=ue),X=n(e),g(G.$$.fragment,e),K=n(e),J=r(e,"P",{"data-svelte-h":!0}),c(J)!=="svelte-9rr7vk"&&(J.innerHTML=pe),ee=n(e),g(I.$$.fragment,e),te=n(e),g(w.$$.fragment,e),le=n(e),g(H.$$.fragment,e),ae=n(e),S=r(e,"P",{}),ce(S).forEach(l),this.h()},h(){ne(s,"name","hf:doc:metadata"),ne(s,"content",Ee),ne(b,"class","flex justify-center"),ne($,"class","flex justify-center")},m(e,t){Te(document.head,s),a(e,y,t),a(e,m,t),a(e,Z,t),f(M,e,t),a(e,Y,t),f(_,e,t),a(e,Q,t),a(e,T,t),a(e,R,t),a(e,b,t),a(e,P,t),a(e,$,t),a(e,B,t),f(U,e,t),a(e,z,t),a(e,v,t),a(e,N,t),f(k,e,t),a(e,A,t),f(C,e,t),a(e,V,t),a(e,E,t),a(e,D,t),f(F,e,t),a(e,q,t),a(e,j,t),a(e,O,t),a(e,x,t),a(e,X,t),f(G,e,t),a(e,K,t),a(e,J,t),a(e,ee,t),f(I,e,t),a(e,te,t),f(w,e,t),a(e,le,t),f(H,e,t),a(e,ae,t),a(e,S,t),ie=!0},p(e,[t]){const he={};t&2&&(he.$$scope={dirty:t,ctx:e}),w.$set(he)},i(e){ie||(u(M.$$.fragment,e),u(_.$$.fragment,e),u(U.$$.fragment,e),u(k.$$.fragment,e),u(C.$$.fragment,e),u(F.$$.fragment,e),u(G.$$.fragment,e),u(I.$$.fragment,e),u(w.$$.fragment,e),u(H.$$.fragment,e),ie=!0)},o(e){p(M.$$.fragment,e),p(_.$$.fragment,e),p(U.$$.fragment,e),p(k.$$.fragment,e),p(C.$$.fragment,e),p(F.$$.fragment,e),p(G.$$.fragment,e),p(I.$$.fragment,e),p(w.$$.fragment,e),p(H.$$.fragment,e),ie=!1},d(e){e&&(l(y),l(m),l(Z),l(Y),l(Q),l(T),l(R),l(b),l(P),l($),l(B),l(z),l(v),l(N),l(A),l(V),l(E),l(D),l(q),l(j),l(O),l(x),l(X),l(K),l(J),l(ee),l(te),l(le),l(ae),l(S)),l(s),h(M,e),h(_,e),h(U,e),h(k,e),h(C,e),h(F,e),h(G,e),h(I,e),h(w,e),h(H,e)}}}const Ee='{"title":"Downloading models","local":"downloading-models","sections":[{"title":"Integrated libraries","local":"integrated-libraries","sections":[],"depth":2},{"title":"Using the Hugging Face Client Library","local":"using-the-hugging-face-client-library","sections":[],"depth":2},{"title":"Using Git","local":"using-git","sections":[],"depth":2},{"title":"Faster downloads","local":"faster-downloads","sections":[],"depth":2}],"depth":1}';function Fe(W){return $e(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class He extends ye{constructor(s){super(),Me(this,s,Fe,Ce,be,{})}}export{He as component};
