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