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 n,r as d,A as _e,h as r,f as l,c as i,j as ce,u as g,x as c,k as ie,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,j,ge="Since all models on the Model Hub are Git repositories, you can clone the models locally by running:",q,E,D,F,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,ne;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"}}),E=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:"cGlwJTIwaW5zdGFsbCUyMCUyMmh1Z2dpbmdmYWNlX2h1YiU1QmhmX3RyYW5zZmVyJTVEJTIyJTBBSEZfSFVCX0VOQUJMRV9IRl9UUkFOU0ZFUiUzRDElMjBodWdnaW5nZmFjZS1jbGklMjBkb3dubG9hZCUyMC4uLg==",highlighted:`pip install <span class="hljs-string">&quot;huggingface_hub[hf_transfer]&quot;</span>
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=n(),m=o("p"),Z=n(),d(M.$$.fragment),Y=n(),d(_.$$.fragment),Q=n(),T=o("p"),T.innerHTML=oe,R=n(),b=o("div"),b.innerHTML=re,P=n(),$=o("div"),$.innerHTML=me,B=n(),d(U.$$.fragment),z=n(),v=o("p"),v.innerHTML=de,N=n(),d(k.$$.fragment),A=n(),d(C.$$.fragment),V=n(),j=o("p"),j.textContent=ge,q=n(),d(E.$$.fragment),D=n(),F=o("p"),F.textContent=fe,O=n(),x=o("p"),x.innerHTML=ue,X=n(),d(G.$$.fragment),K=n(),J=o("p"),J.innerHTML=pe,ee=n(),d(I.$$.fragment),te=n(),d(w.$$.fragment),le=n(),d(H.$$.fragment),ae=n(),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=i(e),m=r(e,"P",{}),ce(m).forEach(l),Z=i(e),g(M.$$.fragment,e),Y=i(e),g(_.$$.fragment,e),Q=i(e),T=r(e,"P",{"data-svelte-h":!0}),c(T)!=="svelte-1ydsvzi"&&(T.innerHTML=oe),R=i(e),b=r(e,"DIV",{class:!0,"data-svelte-h":!0}),c(b)!=="svelte-wnwui5"&&(b.innerHTML=re),P=i(e),$=r(e,"DIV",{class:!0,"data-svelte-h":!0}),c($)!=="svelte-1ykqzq1"&&($.innerHTML=me),B=i(e),g(U.$$.fragment,e),z=i(e),v=r(e,"P",{"data-svelte-h":!0}),c(v)!=="svelte-14cbfij"&&(v.innerHTML=de),N=i(e),g(k.$$.fragment,e),A=i(e),g(C.$$.fragment,e),V=i(e),j=r(e,"P",{"data-svelte-h":!0}),c(j)!=="svelte-eeemds"&&(j.textContent=ge),q=i(e),g(E.$$.fragment,e),D=i(e),F=r(e,"P",{"data-svelte-h":!0}),c(F)!=="svelte-16ip9pe"&&(F.textContent=fe),O=i(e),x=r(e,"P",{"data-svelte-h":!0}),c(x)!=="svelte-nl03my"&&(x.innerHTML=ue),X=i(e),g(G.$$.fragment,e),K=i(e),J=r(e,"P",{"data-svelte-h":!0}),c(J)!=="svelte-9rr7vk"&&(J.innerHTML=pe),ee=i(e),g(I.$$.fragment,e),te=i(e),g(w.$$.fragment,e),le=i(e),g(H.$$.fragment,e),ae=i(e),S=r(e,"P",{}),ce(S).forEach(l),this.h()},h(){ie(s,"name","hf:doc:metadata"),ie(s,"content",je),ie(b,"class","flex justify-center"),ie($,"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,j,t),a(e,q,t),f(E,e,t),a(e,D,t),a(e,F,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),ne=!0},p(e,[t]){const he={};t&2&&(he.$$scope={dirty:t,ctx:e}),w.$set(he)},i(e){ne||(u(M.$$.fragment,e),u(_.$$.fragment,e),u(U.$$.fragment,e),u(k.$$.fragment,e),u(C.$$.fragment,e),u(E.$$.fragment,e),u(G.$$.fragment,e),u(I.$$.fragment,e),u(w.$$.fragment,e),u(H.$$.fragment,e),ne=!0)},o(e){p(M.$$.fragment,e),p(_.$$.fragment,e),p(U.$$.fragment,e),p(k.$$.fragment,e),p(C.$$.fragment,e),p(E.$$.fragment,e),p(G.$$.fragment,e),p(I.$$.fragment,e),p(w.$$.fragment,e),p(H.$$.fragment,e),ne=!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(j),l(q),l(D),l(F),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(E,e),h(G,e),h(I,e),h(w,e),h(H,e)}}}const je='{"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 Ee(W){return $e(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class He extends ye{constructor(s){super(),Me(this,s,Ee,Ce,be,{})}}export{He as component};
