import{s as Ue,o as ke,n as Ce}from"../chunks/scheduler.12fdeddc.js";import{S as xe,i as Fe,g as o,s as a,r as d,A as Ee,h as r,f as l,c as i,j as ve,u as g,x as c,k as ge,y as He,a as n,v as f,d as u,t as p,w as h}from"../chunks/index.88dae322.js";import{T as Ie}from"../chunks/Tip.64e66512.js";import{C as fe}from"../chunks/CodeBlock.8e54a086.js";import{H as P,E as Ge}from"../chunks/getInferenceSnippets.00466244.js";function Je(R){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,Y){n(m,s,Y)},p:Ce,d(m){m&&l(s)}}}function je(R){let s,y,m,Y,M,W,_,z,T,ue='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.',B,b,pe='<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"/>',N,$,he='<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"/>',A,v,V,U,ce='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. For example, to download the <code>HuggingFaceH4/zephyr-7b-beta</code> model from the command line, run',q,k,D,C,be='See the <a href="https://huggingface.co/docs/huggingface_hub/en/guides/cli#download-an-entire-repository" rel="nofollow">CLI download documentation</a> for more information.',X,x,$e="You can also integrate this into your own library. For example, you can quickly load a Scikit-learn model with a few lines.",O,F,K,E,ee,H,we="Since all models on the Model Hub are Git repositories, you can clone the models locally by running:",te,I,le,G,ye="If you have write-access to the particular model repo, you’ll also have the ability to commit and push revisions to the model.",ne,J,Me='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.',ae,j,ie,Z,_e=`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.`,se,L,oe,w,re,S,me,Q,de;return M=new P({props:{title:"Downloading models",local:"downloading-models",headingTag:"h1"}}),_=new P({props:{title:"Integrated libraries",local:"integrated-libraries",headingTag:"h2"}}),v=new P({props:{title:"Using the Hugging Face Client Library",local:"using-the-hugging-face-client-library",headingTag:"h2"}}),k=new fe({props:{code:"aGYlMjBkb3dubG9hZCUyMEh1Z2dpbmdGYWNlSDQlMkZ6ZXBoeXItN2ItYmV0YQ==",highlighted:"hf download HuggingFaceH4/zephyr-7b-beta",wrap:!1}}),F=new fe({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}}),E=new P({props:{title:"Using Git",local:"using-git",headingTag:"h2"}}),I=new fe({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}}),j=new P({props:{title:"Faster downloads",local:"faster-downloads",headingTag:"h2"}}),L=new fe({props:{code:"cGlwJTIwaW5zdGFsbCUyMCUyMmh1Z2dpbmdmYWNlX2h1YiU1QmhmX3RyYW5zZmVyJTVEJTIyJTBBSEZfSFVCX0VOQUJMRV9IRl9UUkFOU0ZFUiUzRDElMjBoZiUyMGRvd25sb2FkJTIwLi4u",highlighted:`pip install <span class="hljs-string">&quot;huggingface_hub[hf_transfer]&quot;</span>
HF_HUB_ENABLE_HF_TRANSFER=1 hf download ...`,wrap:!1}}),w=new Ie({props:{warning:!0,$$slots:{default:[Je]},$$scope:{ctx:R}}}),S=new Ge({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/models-downloading.md"}}),{c(){s=o("meta"),y=a(),m=o("p"),Y=a(),d(M.$$.fragment),W=a(),d(_.$$.fragment),z=a(),T=o("p"),T.innerHTML=ue,B=a(),b=o("div"),b.innerHTML=pe,N=a(),$=o("div"),$.innerHTML=he,A=a(),d(v.$$.fragment),V=a(),U=o("p"),U.innerHTML=ce,q=a(),d(k.$$.fragment),D=a(),C=o("p"),C.innerHTML=be,X=a(),x=o("p"),x.textContent=$e,O=a(),d(F.$$.fragment),K=a(),d(E.$$.fragment),ee=a(),H=o("p"),H.textContent=we,te=a(),d(I.$$.fragment),le=a(),G=o("p"),G.textContent=ye,ne=a(),J=o("p"),J.innerHTML=Me,ae=a(),d(j.$$.fragment),ie=a(),Z=o("p"),Z.innerHTML=_e,se=a(),d(L.$$.fragment),oe=a(),d(w.$$.fragment),re=a(),d(S.$$.fragment),me=a(),Q=o("p"),this.h()},l(e){const t=Ee("svelte-u9bgzb",document.head);s=r(t,"META",{name:!0,content:!0}),t.forEach(l),y=i(e),m=r(e,"P",{}),ve(m).forEach(l),Y=i(e),g(M.$$.fragment,e),W=i(e),g(_.$$.fragment,e),z=i(e),T=r(e,"P",{"data-svelte-h":!0}),c(T)!=="svelte-1ydsvzi"&&(T.innerHTML=ue),B=i(e),b=r(e,"DIV",{class:!0,"data-svelte-h":!0}),c(b)!=="svelte-wnwui5"&&(b.innerHTML=pe),N=i(e),$=r(e,"DIV",{class:!0,"data-svelte-h":!0}),c($)!=="svelte-1ykqzq1"&&($.innerHTML=he),A=i(e),g(v.$$.fragment,e),V=i(e),U=r(e,"P",{"data-svelte-h":!0}),c(U)!=="svelte-uyak54"&&(U.innerHTML=ce),q=i(e),g(k.$$.fragment,e),D=i(e),C=r(e,"P",{"data-svelte-h":!0}),c(C)!=="svelte-yu21tg"&&(C.innerHTML=be),X=i(e),x=r(e,"P",{"data-svelte-h":!0}),c(x)!=="svelte-1o4049b"&&(x.textContent=$e),O=i(e),g(F.$$.fragment,e),K=i(e),g(E.$$.fragment,e),ee=i(e),H=r(e,"P",{"data-svelte-h":!0}),c(H)!=="svelte-eeemds"&&(H.textContent=we),te=i(e),g(I.$$.fragment,e),le=i(e),G=r(e,"P",{"data-svelte-h":!0}),c(G)!=="svelte-16ip9pe"&&(G.textContent=ye),ne=i(e),J=r(e,"P",{"data-svelte-h":!0}),c(J)!=="svelte-nl03my"&&(J.innerHTML=Me),ae=i(e),g(j.$$.fragment,e),ie=i(e),Z=r(e,"P",{"data-svelte-h":!0}),c(Z)!=="svelte-9rr7vk"&&(Z.innerHTML=_e),se=i(e),g(L.$$.fragment,e),oe=i(e),g(w.$$.fragment,e),re=i(e),g(S.$$.fragment,e),me=i(e),Q=r(e,"P",{}),ve(Q).forEach(l),this.h()},h(){ge(s,"name","hf:doc:metadata"),ge(s,"content",Ze),ge(b,"class","flex justify-center"),ge($,"class","flex justify-center")},m(e,t){He(document.head,s),n(e,y,t),n(e,m,t),n(e,Y,t),f(M,e,t),n(e,W,t),f(_,e,t),n(e,z,t),n(e,T,t),n(e,B,t),n(e,b,t),n(e,N,t),n(e,$,t),n(e,A,t),f(v,e,t),n(e,V,t),n(e,U,t),n(e,q,t),f(k,e,t),n(e,D,t),n(e,C,t),n(e,X,t),n(e,x,t),n(e,O,t),f(F,e,t),n(e,K,t),f(E,e,t),n(e,ee,t),n(e,H,t),n(e,te,t),f(I,e,t),n(e,le,t),n(e,G,t),n(e,ne,t),n(e,J,t),n(e,ae,t),f(j,e,t),n(e,ie,t),n(e,Z,t),n(e,se,t),f(L,e,t),n(e,oe,t),f(w,e,t),n(e,re,t),f(S,e,t),n(e,me,t),n(e,Q,t),de=!0},p(e,[t]){const Te={};t&2&&(Te.$$scope={dirty:t,ctx:e}),w.$set(Te)},i(e){de||(u(M.$$.fragment,e),u(_.$$.fragment,e),u(v.$$.fragment,e),u(k.$$.fragment,e),u(F.$$.fragment,e),u(E.$$.fragment,e),u(I.$$.fragment,e),u(j.$$.fragment,e),u(L.$$.fragment,e),u(w.$$.fragment,e),u(S.$$.fragment,e),de=!0)},o(e){p(M.$$.fragment,e),p(_.$$.fragment,e),p(v.$$.fragment,e),p(k.$$.fragment,e),p(F.$$.fragment,e),p(E.$$.fragment,e),p(I.$$.fragment,e),p(j.$$.fragment,e),p(L.$$.fragment,e),p(w.$$.fragment,e),p(S.$$.fragment,e),de=!1},d(e){e&&(l(y),l(m),l(Y),l(W),l(z),l(T),l(B),l(b),l(N),l($),l(A),l(V),l(U),l(q),l(D),l(C),l(X),l(x),l(O),l(K),l(ee),l(H),l(te),l(le),l(G),l(ne),l(J),l(ae),l(ie),l(Z),l(se),l(oe),l(re),l(me),l(Q)),l(s),h(M,e),h(_,e),h(v,e),h(k,e),h(F,e),h(E,e),h(I,e),h(j,e),h(L,e),h(w,e),h(S,e)}}}const Ze='{"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 Le(R){return ke(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class We extends xe{constructor(s){super(),Fe(this,s,Le,je,Ue,{})}}export{We as component};
