import{s as ne,n as ie,o as oe}from"../chunks/scheduler.d6170356.js";import{S as re,i as de,g as i,s as l,r as _,A as ge,h as o,f as a,c as n,j as se,u as v,x as U,k as A,y as ce,a as s,v as T,d as k,t as j,w as C}from"../chunks/index.fcd4cc08.js";import{C as le}from"../chunks/CodeBlock.7b16bdef.js";import{H as V}from"../chunks/Heading.8660bd0e.js";function pe(W){let r,J,G,x,c,I,p,F,m,D='If a dataset on the Hub is tied to a <a href="./datasets-libraries">supported library</a>, loading the dataset can be done in just a few lines. For information on accessing the dataset, you can click on the “Use in dataset library” button on the dataset page to see how to do so. For example, <a href="https://huggingface.co/datasets/samsum?library=true" rel="nofollow"><code>samsum</code></a> shows how to do so with 🤗 Datasets below.',H,d,q='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/datasets-usage.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/datasets-usage-dark.png"/>',R,g,O='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/datasets-usage-modal.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/datasets-usage-modal-dark.png"/>',Z,u,L,h,K='You can use the <a href="https://huggingface.co/docs/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 CSV dataset with a few lines using Pandas.',P,f,Q,y,z,b,ee="Since all datasets on the Hub are Git repositories, you can clone the datasets locally by running:",B,M,S,w,te="If you have write-access to the particular dataset repo, you’ll also have the ability to commit and push revisions to the dataset.",Y,$,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.',X,E,N;return c=new V({props:{title:"Downloading datasets",local:"downloading-datasets",headingTag:"h1"}}),p=new V({props:{title:"Integrated libraries",local:"integrated-libraries",headingTag:"h2"}}),u=new V({props:{title:"Using the Hugging Face Client Library",local:"using-the-hugging-face-client-library",headingTag:"h2"}}),f=new le({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGhmX2h1Yl9kb3dubG9hZCUwQWltcG9ydCUyMHBhbmRhcyUyMGFzJTIwcGQlMEElMEFSRVBPX0lEJTIwJTNEJTIwJTIyWU9VUl9SRVBPX0lEJTIyJTBBRklMRU5BTUUlMjAlM0QlMjAlMjJkYXRhLmNzdiUyMiUwQSUwQWRhdGFzZXQlMjAlM0QlMjBwZC5yZWFkX2NzdiglMEElMjAlMjAlMjAlMjBoZl9odWJfZG93bmxvYWQocmVwb19pZCUzRFJFUE9fSUQlMkMlMjBmaWxlbmFtZSUzREZJTEVOQU1FJTJDJTIwcmVwb190eXBlJTNEJTIyZGF0YXNldCUyMiklMEEp",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download
<span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd

REPO_ID = <span class="hljs-string">&quot;YOUR_REPO_ID&quot;</span>
FILENAME = <span class="hljs-string">&quot;data.csv&quot;</span>

dataset = pd.read_csv(
    hf_hub_download(repo_id=REPO_ID, filename=FILENAME, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>)
)`,wrap:!1}}),y=new V({props:{title:"Using Git",local:"using-git",headingTag:"h2"}}),M=new le({props:{code:"Z2l0JTIwbGZzJTIwaW5zdGFsbCUwQWdpdCUyMGNsb25lJTIwZ2l0JTQwaGYuY28lM0FkYXRhc2V0cyUyRiUzQ2RhdGFzZXQlMjBJRCUzRSUyMCUyMyUyMGV4YW1wbGUlM0ElMjBnaXQlMjBjbG9uZSUyMGdpdCU0MGhmLmNvJTNBZGF0YXNldHMlMkZhbGxlbmFpJTJGYzQ=",highlighted:`git lfs install
git <span class="hljs-built_in">clone</span> git@hf.co:datasets/&lt;dataset ID&gt; <span class="hljs-comment"># example: git clone git@hf.co:datasets/allenai/c4</span>`,wrap:!1}}),{c(){r=i("meta"),J=l(),G=i("p"),x=l(),_(c.$$.fragment),I=l(),_(p.$$.fragment),F=l(),m=i("p"),m.innerHTML=D,H=l(),d=i("div"),d.innerHTML=q,R=l(),g=i("div"),g.innerHTML=O,Z=l(),_(u.$$.fragment),L=l(),h=i("p"),h.innerHTML=K,P=l(),_(f.$$.fragment),Q=l(),_(y.$$.fragment),z=l(),b=i("p"),b.textContent=ee,B=l(),_(M.$$.fragment),S=l(),w=i("p"),w.textContent=te,Y=l(),$=i("p"),$.innerHTML=ae,X=l(),E=i("p"),this.h()},l(e){const t=ge("svelte-u9bgzb",document.head);r=o(t,"META",{name:!0,content:!0}),t.forEach(a),J=n(e),G=o(e,"P",{}),se(G).forEach(a),x=n(e),v(c.$$.fragment,e),I=n(e),v(p.$$.fragment,e),F=n(e),m=o(e,"P",{"data-svelte-h":!0}),U(m)!=="svelte-1ybvteq"&&(m.innerHTML=D),H=n(e),d=o(e,"DIV",{class:!0,"data-svelte-h":!0}),U(d)!=="svelte-1ach5zb"&&(d.innerHTML=q),R=n(e),g=o(e,"DIV",{class:!0,"data-svelte-h":!0}),U(g)!=="svelte-1rm4drj"&&(g.innerHTML=O),Z=n(e),v(u.$$.fragment,e),L=n(e),h=o(e,"P",{"data-svelte-h":!0}),U(h)!=="svelte-1y487xi"&&(h.innerHTML=K),P=n(e),v(f.$$.fragment,e),Q=n(e),v(y.$$.fragment,e),z=n(e),b=o(e,"P",{"data-svelte-h":!0}),U(b)!=="svelte-11ieo6t"&&(b.textContent=ee),B=n(e),v(M.$$.fragment,e),S=n(e),w=o(e,"P",{"data-svelte-h":!0}),U(w)!=="svelte-scyzjg"&&(w.textContent=te),Y=n(e),$=o(e,"P",{"data-svelte-h":!0}),U($)!=="svelte-nl03my"&&($.innerHTML=ae),X=n(e),E=o(e,"P",{}),se(E).forEach(a),this.h()},h(){A(r,"name","hf:doc:metadata"),A(r,"content",me),A(d,"class","flex justify-center"),A(g,"class","flex justify-center")},m(e,t){ce(document.head,r),s(e,J,t),s(e,G,t),s(e,x,t),T(c,e,t),s(e,I,t),T(p,e,t),s(e,F,t),s(e,m,t),s(e,H,t),s(e,d,t),s(e,R,t),s(e,g,t),s(e,Z,t),T(u,e,t),s(e,L,t),s(e,h,t),s(e,P,t),T(f,e,t),s(e,Q,t),T(y,e,t),s(e,z,t),s(e,b,t),s(e,B,t),T(M,e,t),s(e,S,t),s(e,w,t),s(e,Y,t),s(e,$,t),s(e,X,t),s(e,E,t),N=!0},p:ie,i(e){N||(k(c.$$.fragment,e),k(p.$$.fragment,e),k(u.$$.fragment,e),k(f.$$.fragment,e),k(y.$$.fragment,e),k(M.$$.fragment,e),N=!0)},o(e){j(c.$$.fragment,e),j(p.$$.fragment,e),j(u.$$.fragment,e),j(f.$$.fragment,e),j(y.$$.fragment,e),j(M.$$.fragment,e),N=!1},d(e){e&&(a(J),a(G),a(x),a(I),a(F),a(m),a(H),a(d),a(R),a(g),a(Z),a(L),a(h),a(P),a(Q),a(z),a(b),a(B),a(S),a(w),a(Y),a($),a(X),a(E)),a(r),C(c,e),C(p,e),C(u,e),C(f,e),C(y,e),C(M,e)}}}const me='{"title":"Downloading datasets","local":"downloading-datasets","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 ue(W){return oe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Me extends re{constructor(r){super(),de(this,r,ue,pe,ne,{})}}export{Me as component};
