import{s as Ue,o as ke,n as Ce}from"../chunks/scheduler.d6170356.js";import{S as xe,i as Fe,g as o,s as a,r as m,A as He,h as r,f as l,c as i,j as ve,u as g,x as c,k as ge,y as je,a as n,v as f,d as u,t as p,w as h}from"../chunks/index.fcd4cc08.js";import{T as Ee}from"../chunks/Tip.b09c67cf.js";import{C as fe}from"../chunks/CodeBlock.db16bf50.js";import{H as P,E as Je}from"../chunks/index.9f2da87a.js";function Ge(Q){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(d){s=r(d,"P",{"data-svelte-h":!0}),c(s)!=="svelte-g0nrx2"&&(s.innerHTML=y)},m(d,W){n(d,s,W)},p:Ce,d(d){d&&l(s)}}}function Ze(Q){let s,y,d,W,M,R,_,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"/>',V,v,A,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">huggingface-cli download documentation</a> for more information.',O,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.",X,F,K,H,ee,j,we="Since all models on the Model Hub are Git repositories, you can clone the models locally by running:",te,E,le,J,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,G,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,Z,ie,I,_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,de,Y,me;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:"aHVnZ2luZ2ZhY2UtY2xpJTIwZG93bmxvYWQlMjBIdWdnaW5nRmFjZUg0JTJGemVwaHlyLTdiLWJldGE=",highlighted:"huggingface-cli 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}}),H=new P({props:{title:"Using Git",local:"using-git",headingTag:"h2"}}),E=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}}),Z=new P({props:{title:"Faster downloads",local:"faster-downloads",headingTag:"h2"}}),L=new fe({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 Ee({props:{warning:!0,$$slots:{default:[Ge]},$$scope:{ctx:Q}}}),S=new Je({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/models-downloading.md"}}),{c(){s=o("meta"),y=a(),d=o("p"),W=a(),m(M.$$.fragment),R=a(),m(_.$$.fragment),z=a(),T=o("p"),T.innerHTML=ue,B=a(),b=o("div"),b.innerHTML=pe,N=a(),$=o("div"),$.innerHTML=he,V=a(),m(v.$$.fragment),A=a(),U=o("p"),U.innerHTML=ce,q=a(),m(k.$$.fragment),D=a(),C=o("p"),C.innerHTML=be,O=a(),x=o("p"),x.textContent=$e,X=a(),m(F.$$.fragment),K=a(),m(H.$$.fragment),ee=a(),j=o("p"),j.textContent=we,te=a(),m(E.$$.fragment),le=a(),J=o("p"),J.textContent=ye,ne=a(),G=o("p"),G.innerHTML=Me,ae=a(),m(Z.$$.fragment),ie=a(),I=o("p"),I.innerHTML=_e,se=a(),m(L.$$.fragment),oe=a(),m(w.$$.fragment),re=a(),m(S.$$.fragment),de=a(),Y=o("p"),this.h()},l(e){const t=He("svelte-u9bgzb",document.head);s=r(t,"META",{name:!0,content:!0}),t.forEach(l),y=i(e),d=r(e,"P",{}),ve(d).forEach(l),W=i(e),g(M.$$.fragment,e),R=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),V=i(e),g(v.$$.fragment,e),A=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-164dntn"&&(C.innerHTML=be),O=i(e),x=r(e,"P",{"data-svelte-h":!0}),c(x)!=="svelte-1o4049b"&&(x.textContent=$e),X=i(e),g(F.$$.fragment,e),K=i(e),g(H.$$.fragment,e),ee=i(e),j=r(e,"P",{"data-svelte-h":!0}),c(j)!=="svelte-eeemds"&&(j.textContent=we),te=i(e),g(E.$$.fragment,e),le=i(e),J=r(e,"P",{"data-svelte-h":!0}),c(J)!=="svelte-16ip9pe"&&(J.textContent=ye),ne=i(e),G=r(e,"P",{"data-svelte-h":!0}),c(G)!=="svelte-nl03my"&&(G.innerHTML=Me),ae=i(e),g(Z.$$.fragment,e),ie=i(e),I=r(e,"P",{"data-svelte-h":!0}),c(I)!=="svelte-9rr7vk"&&(I.innerHTML=_e),se=i(e),g(L.$$.fragment,e),oe=i(e),g(w.$$.fragment,e),re=i(e),g(S.$$.fragment,e),de=i(e),Y=r(e,"P",{}),ve(Y).forEach(l),this.h()},h(){ge(s,"name","hf:doc:metadata"),ge(s,"content",Ie),ge(b,"class","flex justify-center"),ge($,"class","flex justify-center")},m(e,t){je(document.head,s),n(e,y,t),n(e,d,t),n(e,W,t),f(M,e,t),n(e,R,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,V,t),f(v,e,t),n(e,A,t),n(e,U,t),n(e,q,t),f(k,e,t),n(e,D,t),n(e,C,t),n(e,O,t),n(e,x,t),n(e,X,t),f(F,e,t),n(e,K,t),f(H,e,t),n(e,ee,t),n(e,j,t),n(e,te,t),f(E,e,t),n(e,le,t),n(e,J,t),n(e,ne,t),n(e,G,t),n(e,ae,t),f(Z,e,t),n(e,ie,t),n(e,I,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,de,t),n(e,Y,t),me=!0},p(e,[t]){const Te={};t&2&&(Te.$$scope={dirty:t,ctx:e}),w.$set(Te)},i(e){me||(u(M.$$.fragment,e),u(_.$$.fragment,e),u(v.$$.fragment,e),u(k.$$.fragment,e),u(F.$$.fragment,e),u(H.$$.fragment,e),u(E.$$.fragment,e),u(Z.$$.fragment,e),u(L.$$.fragment,e),u(w.$$.fragment,e),u(S.$$.fragment,e),me=!0)},o(e){p(M.$$.fragment,e),p(_.$$.fragment,e),p(v.$$.fragment,e),p(k.$$.fragment,e),p(F.$$.fragment,e),p(H.$$.fragment,e),p(E.$$.fragment,e),p(Z.$$.fragment,e),p(L.$$.fragment,e),p(w.$$.fragment,e),p(S.$$.fragment,e),me=!1},d(e){e&&(l(y),l(d),l(W),l(R),l(z),l(T),l(B),l(b),l(N),l($),l(V),l(A),l(U),l(q),l(D),l(C),l(O),l(x),l(X),l(K),l(ee),l(j),l(te),l(le),l(J),l(ne),l(G),l(ae),l(ie),l(I),l(se),l(oe),l(re),l(de),l(Y)),l(s),h(M,e),h(_,e),h(v,e),h(k,e),h(F,e),h(H,e),h(E,e),h(Z,e),h(L,e),h(w,e),h(S,e)}}}const Ie='{"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(Q){return ke(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Re extends xe{constructor(s){super(),Fe(this,s,Le,Ze,Ue,{})}}export{Re as component};
