import{s as Ue,n as ve,o as Ce}from"../chunks/scheduler.9cda857a.js";import{S as xe,i as ke,e as s,s as a,c as r,h as Ee,a as o,d as l,b as i,f as Te,g as d,j as p,k as me,l as Ge,m as n,n as m,t as g,o as f,p as u}from"../chunks/index.003612b0.js";import{C as He}from"../chunks/CopyLLMTxtMenu.44d08a39.js";import{C as ge}from"../chunks/CodeBlock.a90632f1.js";import{H as Y,E as Ie}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e5cfda8c.js";function Fe(fe){let h,P,S,Q,$,z,w,W,y,R,M,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,c,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,b,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,_,A,T,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',X,U,D,v,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.',q,C,$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,x,K,k,ee,E,we="Since all models on the Model Hub are Git repositories, you can clone the models locally by running:",te,G,le,H,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,I,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,F,ie,J,_e=`If you are running on a machine with high bandwidth,
you can speed up downloads by allowing <code>hf_xet</code> to run on all CPU cores. <code>hf_xet</code> is a Rust-based package leveraging the new <a href="https://huggingface.co/docs/hub/en/xet/index" rel="nofollow">Xet storage backend</a> to optimize file transfers with chunk-based deduplication. <code>hf_xet</code> is enabled by default but with lower performances to avoid bloating available CPU and bandwidth, which could degrade UX.`,se,j,oe,Z,re,L,de;return $=new He({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),w=new Y({props:{title:"Downloading models",local:"downloading-models",headingTag:"h1"}}),y=new Y({props:{title:"Integrated libraries",local:"integrated-libraries",headingTag:"h2"}}),_=new Y({props:{title:"Using the Hugging Face Client Library",local:"using-the-hugging-face-client-library",headingTag:"h2"}}),U=new ge({props:{code:"aGYlMjBkb3dubG9hZCUyMEh1Z2dpbmdGYWNlSDQlMkZ6ZXBoeXItN2ItYmV0YQ==",highlighted:"hf download HuggingFaceH4/zephyr-7b-beta",wrap:!1}}),x=new ge({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}}),k=new Y({props:{title:"Using Git",local:"using-git",headingTag:"h2"}}),G=new ge({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}}),F=new Y({props:{title:"Faster downloads",local:"faster-downloads",headingTag:"h2"}}),j=new ge({props:{code:"cGlwJTIwaW5zdGFsbCUyMC1VJTIwaHVnZ2luZ2ZhY2VfaHViJTBBSEZfWEVUX0hJR0hfUEVSRk9STUFOQ0UlM0QxJTIwaGYlMjBkb3dubG9hZCUyMC4uLg==",highlighted:`pip install -U huggingface_hub
HF_XET_HIGH_PERFORMANCE=1 hf download ...`,wrap:!1}}),Z=new Ie({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/models-downloading.md"}}),{c(){h=s("meta"),P=a(),S=s("p"),Q=a(),r($.$$.fragment),z=a(),r(w.$$.fragment),W=a(),r(y.$$.fragment),R=a(),M=s("p"),M.innerHTML=ue,B=a(),c=s("div"),c.innerHTML=pe,N=a(),b=s("div"),b.innerHTML=he,V=a(),r(_.$$.fragment),A=a(),T=s("p"),T.innerHTML=ce,X=a(),r(U.$$.fragment),D=a(),v=s("p"),v.innerHTML=be,q=a(),C=s("p"),C.textContent=$e,O=a(),r(x.$$.fragment),K=a(),r(k.$$.fragment),ee=a(),E=s("p"),E.textContent=we,te=a(),r(G.$$.fragment),le=a(),H=s("p"),H.textContent=ye,ne=a(),I=s("p"),I.innerHTML=Me,ae=a(),r(F.$$.fragment),ie=a(),J=s("p"),J.innerHTML=_e,se=a(),r(j.$$.fragment),oe=a(),r(Z.$$.fragment),re=a(),L=s("p"),this.h()},l(e){const t=Ee("svelte-u9bgzb",document.head);h=o(t,"META",{name:!0,content:!0}),t.forEach(l),P=i(e),S=o(e,"P",{}),Te(S).forEach(l),Q=i(e),d($.$$.fragment,e),z=i(e),d(w.$$.fragment,e),W=i(e),d(y.$$.fragment,e),R=i(e),M=o(e,"P",{"data-svelte-h":!0}),p(M)!=="svelte-1ydsvzi"&&(M.innerHTML=ue),B=i(e),c=o(e,"DIV",{class:!0,"data-svelte-h":!0}),p(c)!=="svelte-wnwui5"&&(c.innerHTML=pe),N=i(e),b=o(e,"DIV",{class:!0,"data-svelte-h":!0}),p(b)!=="svelte-1ykqzq1"&&(b.innerHTML=he),V=i(e),d(_.$$.fragment,e),A=i(e),T=o(e,"P",{"data-svelte-h":!0}),p(T)!=="svelte-uyak54"&&(T.innerHTML=ce),X=i(e),d(U.$$.fragment,e),D=i(e),v=o(e,"P",{"data-svelte-h":!0}),p(v)!=="svelte-yu21tg"&&(v.innerHTML=be),q=i(e),C=o(e,"P",{"data-svelte-h":!0}),p(C)!=="svelte-1o4049b"&&(C.textContent=$e),O=i(e),d(x.$$.fragment,e),K=i(e),d(k.$$.fragment,e),ee=i(e),E=o(e,"P",{"data-svelte-h":!0}),p(E)!=="svelte-eeemds"&&(E.textContent=we),te=i(e),d(G.$$.fragment,e),le=i(e),H=o(e,"P",{"data-svelte-h":!0}),p(H)!=="svelte-16ip9pe"&&(H.textContent=ye),ne=i(e),I=o(e,"P",{"data-svelte-h":!0}),p(I)!=="svelte-nl03my"&&(I.innerHTML=Me),ae=i(e),d(F.$$.fragment,e),ie=i(e),J=o(e,"P",{"data-svelte-h":!0}),p(J)!=="svelte-n540lx"&&(J.innerHTML=_e),se=i(e),d(j.$$.fragment,e),oe=i(e),d(Z.$$.fragment,e),re=i(e),L=o(e,"P",{}),Te(L).forEach(l),this.h()},h(){me(h,"name","hf:doc:metadata"),me(h,"content",Je),me(c,"class","flex justify-center"),me(b,"class","flex justify-center")},m(e,t){Ge(document.head,h),n(e,P,t),n(e,S,t),n(e,Q,t),m($,e,t),n(e,z,t),m(w,e,t),n(e,W,t),m(y,e,t),n(e,R,t),n(e,M,t),n(e,B,t),n(e,c,t),n(e,N,t),n(e,b,t),n(e,V,t),m(_,e,t),n(e,A,t),n(e,T,t),n(e,X,t),m(U,e,t),n(e,D,t),n(e,v,t),n(e,q,t),n(e,C,t),n(e,O,t),m(x,e,t),n(e,K,t),m(k,e,t),n(e,ee,t),n(e,E,t),n(e,te,t),m(G,e,t),n(e,le,t),n(e,H,t),n(e,ne,t),n(e,I,t),n(e,ae,t),m(F,e,t),n(e,ie,t),n(e,J,t),n(e,se,t),m(j,e,t),n(e,oe,t),m(Z,e,t),n(e,re,t),n(e,L,t),de=!0},p:ve,i(e){de||(g($.$$.fragment,e),g(w.$$.fragment,e),g(y.$$.fragment,e),g(_.$$.fragment,e),g(U.$$.fragment,e),g(x.$$.fragment,e),g(k.$$.fragment,e),g(G.$$.fragment,e),g(F.$$.fragment,e),g(j.$$.fragment,e),g(Z.$$.fragment,e),de=!0)},o(e){f($.$$.fragment,e),f(w.$$.fragment,e),f(y.$$.fragment,e),f(_.$$.fragment,e),f(U.$$.fragment,e),f(x.$$.fragment,e),f(k.$$.fragment,e),f(G.$$.fragment,e),f(F.$$.fragment,e),f(j.$$.fragment,e),f(Z.$$.fragment,e),de=!1},d(e){e&&(l(P),l(S),l(Q),l(z),l(W),l(R),l(M),l(B),l(c),l(N),l(b),l(V),l(A),l(T),l(X),l(D),l(v),l(q),l(C),l(O),l(K),l(ee),l(E),l(te),l(le),l(H),l(ne),l(I),l(ae),l(ie),l(J),l(se),l(oe),l(re),l(L)),l(h),u($,e),u(w,e),u(y,e),u(_,e),u(U,e),u(x,e),u(k,e),u(G,e),u(F,e),u(j,e),u(Z,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 je(fe){return Ce(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Qe extends xe{constructor(h){super(),ke(this,h,je,Fe,Ue,{})}}export{Qe as component};
