import{s as oe,n as re,o as me}from"../chunks/scheduler.d6170356.js";import{S as ge,i as de,g as n,s as a,r as v,A as ue,h as o,f as l,c as s,j as se,u as T,x as U,k as D,y as ce,a as i,v as k,d as C,t as j,w as x}from"../chunks/index.fcd4cc08.js";import{C as ne}from"../chunks/CodeBlock.7b16bdef.js";import{H as O,E as pe}from"../chunks/EditOnGithub.da2b595c.js";function fe(V){let r,J,E,I,d,F,u,S,c,X='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.',Z,m,K='<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"/>',H,g,ee='<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"/>',L,p,Q,f,te='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.',Y,h,P,b,W,$,le="Since all models on the Model Hub are Git repositories, you can clone the models locally by running:",z,w,A,y,ie="If you have write-access to the particular model repo, you’ll also have the ability to commit and push revisions to the model.",N,M,ae='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.',R,_,q,G,B;return d=new O({props:{title:"Downloading models",local:"downloading-models",headingTag:"h1"}}),u=new O({props:{title:"Integrated libraries",local:"integrated-libraries",headingTag:"h2"}}),p=new O({props:{title:"Using the Hugging Face Client Library",local:"using-the-hugging-face-client-library",headingTag:"h2"}}),h=new ne({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}}),b=new O({props:{title:"Using Git",local:"using-git",headingTag:"h2"}}),w=new ne({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}}),_=new pe({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/models-downloading.md"}}),{c(){r=n("meta"),J=a(),E=n("p"),I=a(),v(d.$$.fragment),F=a(),v(u.$$.fragment),S=a(),c=n("p"),c.innerHTML=X,Z=a(),m=n("div"),m.innerHTML=K,H=a(),g=n("div"),g.innerHTML=ee,L=a(),v(p.$$.fragment),Q=a(),f=n("p"),f.innerHTML=te,Y=a(),v(h.$$.fragment),P=a(),v(b.$$.fragment),W=a(),$=n("p"),$.textContent=le,z=a(),v(w.$$.fragment),A=a(),y=n("p"),y.textContent=ie,N=a(),M=n("p"),M.innerHTML=ae,R=a(),v(_.$$.fragment),q=a(),G=n("p"),this.h()},l(e){const t=ue("svelte-u9bgzb",document.head);r=o(t,"META",{name:!0,content:!0}),t.forEach(l),J=s(e),E=o(e,"P",{}),se(E).forEach(l),I=s(e),T(d.$$.fragment,e),F=s(e),T(u.$$.fragment,e),S=s(e),c=o(e,"P",{"data-svelte-h":!0}),U(c)!=="svelte-1ydsvzi"&&(c.innerHTML=X),Z=s(e),m=o(e,"DIV",{class:!0,"data-svelte-h":!0}),U(m)!=="svelte-wnwui5"&&(m.innerHTML=K),H=s(e),g=o(e,"DIV",{class:!0,"data-svelte-h":!0}),U(g)!=="svelte-1ykqzq1"&&(g.innerHTML=ee),L=s(e),T(p.$$.fragment,e),Q=s(e),f=o(e,"P",{"data-svelte-h":!0}),U(f)!=="svelte-14cbfij"&&(f.innerHTML=te),Y=s(e),T(h.$$.fragment,e),P=s(e),T(b.$$.fragment,e),W=s(e),$=o(e,"P",{"data-svelte-h":!0}),U($)!=="svelte-eeemds"&&($.textContent=le),z=s(e),T(w.$$.fragment,e),A=s(e),y=o(e,"P",{"data-svelte-h":!0}),U(y)!=="svelte-16ip9pe"&&(y.textContent=ie),N=s(e),M=o(e,"P",{"data-svelte-h":!0}),U(M)!=="svelte-nl03my"&&(M.innerHTML=ae),R=s(e),T(_.$$.fragment,e),q=s(e),G=o(e,"P",{}),se(G).forEach(l),this.h()},h(){D(r,"name","hf:doc:metadata"),D(r,"content",he),D(m,"class","flex justify-center"),D(g,"class","flex justify-center")},m(e,t){ce(document.head,r),i(e,J,t),i(e,E,t),i(e,I,t),k(d,e,t),i(e,F,t),k(u,e,t),i(e,S,t),i(e,c,t),i(e,Z,t),i(e,m,t),i(e,H,t),i(e,g,t),i(e,L,t),k(p,e,t),i(e,Q,t),i(e,f,t),i(e,Y,t),k(h,e,t),i(e,P,t),k(b,e,t),i(e,W,t),i(e,$,t),i(e,z,t),k(w,e,t),i(e,A,t),i(e,y,t),i(e,N,t),i(e,M,t),i(e,R,t),k(_,e,t),i(e,q,t),i(e,G,t),B=!0},p:re,i(e){B||(C(d.$$.fragment,e),C(u.$$.fragment,e),C(p.$$.fragment,e),C(h.$$.fragment,e),C(b.$$.fragment,e),C(w.$$.fragment,e),C(_.$$.fragment,e),B=!0)},o(e){j(d.$$.fragment,e),j(u.$$.fragment,e),j(p.$$.fragment,e),j(h.$$.fragment,e),j(b.$$.fragment,e),j(w.$$.fragment,e),j(_.$$.fragment,e),B=!1},d(e){e&&(l(J),l(E),l(I),l(F),l(S),l(c),l(Z),l(m),l(H),l(g),l(L),l(Q),l(f),l(Y),l(P),l(W),l($),l(z),l(A),l(y),l(N),l(M),l(R),l(q),l(G)),l(r),x(d,e),x(u,e),x(p,e),x(h,e),x(b,e),x(w,e),x(_,e)}}}const he='{"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}],"depth":1}';function be(V){return me(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _e extends ge{constructor(r){super(),de(this,r,be,fe,oe,{})}}export{_e as component};
