import{s as Ce,n as xe,o as Fe}from"../chunks/scheduler.9cda857a.js";import{S as Ee,i as He,e as s,s as i,c as r,h as Ie,a as o,d as l,b as a,f as ke,g as m,j as d,k as Q,l as Ge,m as n,n as g,t as f,o as u,p}from"../chunks/index.f47f3121.js";import{C as Je}from"../chunks/CopyLLMTxtMenu.676ed699.js";import{C as ue}from"../chunks/CodeBlock.24d62f98.js";import{H as R,E as Le}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.64d112fc.js";function je(pe){let h,z,S,B,w,P,y,W,M,N,_,he='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.',q,c,ce='<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"/>',V,b,be='<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,T,D,v,$e='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',O,U,X,k,we='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.',K,C,ye="You can also integrate this into your own library. For example, you can quickly load a Scikit-learn model with a few lines.",ee,x,te,F,le,E,Me="Since all models on the Model Hub are Git repositories, you can clone the models locally by running:",ne,H,ie,I,_e="If you have write-access to the particular model repo, you’ll also have the ability to commit and push revisions to the model.",ae,G,Te='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.',se,J,oe,L,ve=`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.`,re,j,me,$,Ue=`<p><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>.</p>`,de,Z,ge,Y,fe;return w=new Je({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),y=new R({props:{title:"Downloading models",local:"downloading-models",headingTag:"h1"}}),M=new R({props:{title:"Integrated libraries",local:"integrated-libraries",headingTag:"h2"}}),T=new R({props:{title:"Using the Hugging Face Client Library",local:"using-the-hugging-face-client-library",headingTag:"h2"}}),U=new ue({props:{code:"aGYlMjBkb3dubG9hZCUyMEh1Z2dpbmdGYWNlSDQlMkZ6ZXBoeXItN2ItYmV0YQ==",highlighted:"hf download HuggingFaceH4/zephyr-7b-beta",wrap:!1}}),x=new ue({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}}),F=new R({props:{title:"Using Git",local:"using-git",headingTag:"h2"}}),H=new ue({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 R({props:{title:"Faster downloads",local:"faster-downloads",headingTag:"h2"}}),j=new ue({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}}),Z=new Le({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/models-downloading.md"}}),{c(){h=s("meta"),z=i(),S=s("p"),B=i(),r(w.$$.fragment),P=i(),r(y.$$.fragment),W=i(),r(M.$$.fragment),N=i(),_=s("p"),_.innerHTML=he,q=i(),c=s("div"),c.innerHTML=ce,V=i(),b=s("div"),b.innerHTML=be,A=i(),r(T.$$.fragment),D=i(),v=s("p"),v.innerHTML=$e,O=i(),r(U.$$.fragment),X=i(),k=s("p"),k.innerHTML=we,K=i(),C=s("p"),C.textContent=ye,ee=i(),r(x.$$.fragment),te=i(),r(F.$$.fragment),le=i(),E=s("p"),E.textContent=Me,ne=i(),r(H.$$.fragment),ie=i(),I=s("p"),I.textContent=_e,ae=i(),G=s("p"),G.innerHTML=Te,se=i(),r(J.$$.fragment),oe=i(),L=s("p"),L.innerHTML=ve,re=i(),r(j.$$.fragment),me=i(),$=s("blockquote"),$.innerHTML=Ue,de=i(),r(Z.$$.fragment),ge=i(),Y=s("p"),this.h()},l(e){const t=Ie("svelte-u9bgzb",document.head);h=o(t,"META",{name:!0,content:!0}),t.forEach(l),z=a(e),S=o(e,"P",{}),ke(S).forEach(l),B=a(e),m(w.$$.fragment,e),P=a(e),m(y.$$.fragment,e),W=a(e),m(M.$$.fragment,e),N=a(e),_=o(e,"P",{"data-svelte-h":!0}),d(_)!=="svelte-1ydsvzi"&&(_.innerHTML=he),q=a(e),c=o(e,"DIV",{class:!0,"data-svelte-h":!0}),d(c)!=="svelte-wnwui5"&&(c.innerHTML=ce),V=a(e),b=o(e,"DIV",{class:!0,"data-svelte-h":!0}),d(b)!=="svelte-1ykqzq1"&&(b.innerHTML=be),A=a(e),m(T.$$.fragment,e),D=a(e),v=o(e,"P",{"data-svelte-h":!0}),d(v)!=="svelte-uyak54"&&(v.innerHTML=$e),O=a(e),m(U.$$.fragment,e),X=a(e),k=o(e,"P",{"data-svelte-h":!0}),d(k)!=="svelte-yu21tg"&&(k.innerHTML=we),K=a(e),C=o(e,"P",{"data-svelte-h":!0}),d(C)!=="svelte-1o4049b"&&(C.textContent=ye),ee=a(e),m(x.$$.fragment,e),te=a(e),m(F.$$.fragment,e),le=a(e),E=o(e,"P",{"data-svelte-h":!0}),d(E)!=="svelte-eeemds"&&(E.textContent=Me),ne=a(e),m(H.$$.fragment,e),ie=a(e),I=o(e,"P",{"data-svelte-h":!0}),d(I)!=="svelte-16ip9pe"&&(I.textContent=_e),ae=a(e),G=o(e,"P",{"data-svelte-h":!0}),d(G)!=="svelte-nl03my"&&(G.innerHTML=Te),se=a(e),m(J.$$.fragment,e),oe=a(e),L=o(e,"P",{"data-svelte-h":!0}),d(L)!=="svelte-9rr7vk"&&(L.innerHTML=ve),re=a(e),m(j.$$.fragment,e),me=a(e),$=o(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),d($)!=="svelte-nqpby"&&($.innerHTML=Ue),de=a(e),m(Z.$$.fragment,e),ge=a(e),Y=o(e,"P",{}),ke(Y).forEach(l),this.h()},h(){Q(h,"name","hf:doc:metadata"),Q(h,"content",Ze),Q(c,"class","flex justify-center"),Q(b,"class","flex justify-center"),Q($,"class","warning")},m(e,t){Ge(document.head,h),n(e,z,t),n(e,S,t),n(e,B,t),g(w,e,t),n(e,P,t),g(y,e,t),n(e,W,t),g(M,e,t),n(e,N,t),n(e,_,t),n(e,q,t),n(e,c,t),n(e,V,t),n(e,b,t),n(e,A,t),g(T,e,t),n(e,D,t),n(e,v,t),n(e,O,t),g(U,e,t),n(e,X,t),n(e,k,t),n(e,K,t),n(e,C,t),n(e,ee,t),g(x,e,t),n(e,te,t),g(F,e,t),n(e,le,t),n(e,E,t),n(e,ne,t),g(H,e,t),n(e,ie,t),n(e,I,t),n(e,ae,t),n(e,G,t),n(e,se,t),g(J,e,t),n(e,oe,t),n(e,L,t),n(e,re,t),g(j,e,t),n(e,me,t),n(e,$,t),n(e,de,t),g(Z,e,t),n(e,ge,t),n(e,Y,t),fe=!0},p:xe,i(e){fe||(f(w.$$.fragment,e),f(y.$$.fragment,e),f(M.$$.fragment,e),f(T.$$.fragment,e),f(U.$$.fragment,e),f(x.$$.fragment,e),f(F.$$.fragment,e),f(H.$$.fragment,e),f(J.$$.fragment,e),f(j.$$.fragment,e),f(Z.$$.fragment,e),fe=!0)},o(e){u(w.$$.fragment,e),u(y.$$.fragment,e),u(M.$$.fragment,e),u(T.$$.fragment,e),u(U.$$.fragment,e),u(x.$$.fragment,e),u(F.$$.fragment,e),u(H.$$.fragment,e),u(J.$$.fragment,e),u(j.$$.fragment,e),u(Z.$$.fragment,e),fe=!1},d(e){e&&(l(z),l(S),l(B),l(P),l(W),l(N),l(_),l(q),l(c),l(V),l(b),l(A),l(D),l(v),l(O),l(X),l(k),l(K),l(C),l(ee),l(te),l(le),l(E),l(ne),l(ie),l(I),l(ae),l(G),l(se),l(oe),l(L),l(re),l(me),l($),l(de),l(ge),l(Y)),l(h),p(w,e),p(y,e),p(M,e),p(T,e),p(U,e),p(x,e),p(F,e),p(H,e),p(J,e),p(j,e),p(Z,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 Se(pe){return Fe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pe extends Ee{constructor(h){super(),He(this,h,Se,je,Ce,{})}}export{Pe as component};
