import{s as ot,n as rt,o as dt}from"../chunks/scheduler.d6170356.js";import{S as gt,i as mt,g as i,s as n,r as _,A as ut,h as o,f as a,c as l,j as lt,u as v,x as T,k as W,y as ct,a as s,v as k,d as j,t as C,w as E}from"../chunks/index.fcd4cc08.js";import{C as it}from"../chunks/CodeBlock.db16bf50.js";import{H as D,E as pt}from"../chunks/index.c1f68a2b.js";function ht(q){let r,x,G,I,m,F,u,H,c,O='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 this dataset” button on the dataset page to see how to do so. For example, <a href="https://huggingface.co/datasets/Samsung/samsum?library=datasets" rel="nofollow"><code>samsum</code></a> shows how to do so with 🤗 Datasets below.',R,d,K='<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"/>',Z,g,tt='<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"/>',L,p,P,h,et='You can use the <a href="/docs/huggingface_hub"><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.',Q,f,S,b,z,$,at="Since all datasets on the Hub are Git repositories, you can clone the datasets locally by running:",B,y,Y,w,st="If you have write-access to the particular dataset repo, you’ll also have the ability to commit and push revisions to the dataset.",X,M,nt='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,U,A,J,V;return m=new D({props:{title:"Downloading datasets",local:"downloading-datasets",headingTag:"h1"}}),u=new D({props:{title:"Integrated libraries",local:"integrated-libraries",headingTag:"h2"}}),p=new D({props:{title:"Using the Hugging Face Client Library",local:"using-the-hugging-face-client-library",headingTag:"h2"}}),f=new it({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}}),b=new D({props:{title:"Using Git",local:"using-git",headingTag:"h2"}}),y=new it({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}}),U=new pt({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/datasets-downloading.md"}}),{c(){r=i("meta"),x=n(),G=i("p"),I=n(),_(m.$$.fragment),F=n(),_(u.$$.fragment),H=n(),c=i("p"),c.innerHTML=O,R=n(),d=i("div"),d.innerHTML=K,Z=n(),g=i("div"),g.innerHTML=tt,L=n(),_(p.$$.fragment),P=n(),h=i("p"),h.innerHTML=et,Q=n(),_(f.$$.fragment),S=n(),_(b.$$.fragment),z=n(),$=i("p"),$.textContent=at,B=n(),_(y.$$.fragment),Y=n(),w=i("p"),w.textContent=st,X=n(),M=i("p"),M.innerHTML=nt,N=n(),_(U.$$.fragment),A=n(),J=i("p"),this.h()},l(t){const e=ut("svelte-u9bgzb",document.head);r=o(e,"META",{name:!0,content:!0}),e.forEach(a),x=l(t),G=o(t,"P",{}),lt(G).forEach(a),I=l(t),v(m.$$.fragment,t),F=l(t),v(u.$$.fragment,t),H=l(t),c=o(t,"P",{"data-svelte-h":!0}),T(c)!=="svelte-1mvg6n4"&&(c.innerHTML=O),R=l(t),d=o(t,"DIV",{class:!0,"data-svelte-h":!0}),T(d)!=="svelte-1ach5zb"&&(d.innerHTML=K),Z=l(t),g=o(t,"DIV",{class:!0,"data-svelte-h":!0}),T(g)!=="svelte-1rm4drj"&&(g.innerHTML=tt),L=l(t),v(p.$$.fragment,t),P=l(t),h=o(t,"P",{"data-svelte-h":!0}),T(h)!=="svelte-1wqnd71"&&(h.innerHTML=et),Q=l(t),v(f.$$.fragment,t),S=l(t),v(b.$$.fragment,t),z=l(t),$=o(t,"P",{"data-svelte-h":!0}),T($)!=="svelte-11ieo6t"&&($.textContent=at),B=l(t),v(y.$$.fragment,t),Y=l(t),w=o(t,"P",{"data-svelte-h":!0}),T(w)!=="svelte-scyzjg"&&(w.textContent=st),X=l(t),M=o(t,"P",{"data-svelte-h":!0}),T(M)!=="svelte-nl03my"&&(M.innerHTML=nt),N=l(t),v(U.$$.fragment,t),A=l(t),J=o(t,"P",{}),lt(J).forEach(a),this.h()},h(){W(r,"name","hf:doc:metadata"),W(r,"content",ft),W(d,"class","flex justify-center"),W(g,"class","flex justify-center")},m(t,e){ct(document.head,r),s(t,x,e),s(t,G,e),s(t,I,e),k(m,t,e),s(t,F,e),k(u,t,e),s(t,H,e),s(t,c,e),s(t,R,e),s(t,d,e),s(t,Z,e),s(t,g,e),s(t,L,e),k(p,t,e),s(t,P,e),s(t,h,e),s(t,Q,e),k(f,t,e),s(t,S,e),k(b,t,e),s(t,z,e),s(t,$,e),s(t,B,e),k(y,t,e),s(t,Y,e),s(t,w,e),s(t,X,e),s(t,M,e),s(t,N,e),k(U,t,e),s(t,A,e),s(t,J,e),V=!0},p:rt,i(t){V||(j(m.$$.fragment,t),j(u.$$.fragment,t),j(p.$$.fragment,t),j(f.$$.fragment,t),j(b.$$.fragment,t),j(y.$$.fragment,t),j(U.$$.fragment,t),V=!0)},o(t){C(m.$$.fragment,t),C(u.$$.fragment,t),C(p.$$.fragment,t),C(f.$$.fragment,t),C(b.$$.fragment,t),C(y.$$.fragment,t),C(U.$$.fragment,t),V=!1},d(t){t&&(a(x),a(G),a(I),a(F),a(H),a(c),a(R),a(d),a(Z),a(g),a(L),a(P),a(h),a(Q),a(S),a(z),a($),a(B),a(Y),a(w),a(X),a(M),a(N),a(A),a(J)),a(r),E(m,t),E(u,t),E(p,t),E(f,t),E(b,t),E(y,t),E(U,t)}}}const ft='{"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 bt(q){return dt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ut extends gt{constructor(r){super(),mt(this,r,bt,ht,ot,{})}}export{Ut as component};
