import{s as ot,n as rt,o as dt}from"../chunks/scheduler.d6170356.js";import{S as gt,i as ct,g as i,s as l,r as _,A as mt,h as o,f as a,c as n,j as nt,u as v,x as T,k as W,y as ut,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.7b16bdef.js";import{H as D,E as pt}from"../chunks/EditOnGithub.da2b595c.js";function ht(q){let r,x,G,I,c,F,m,H,u,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 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.',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="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.',Q,f,z,b,B,y,at="Since all datasets on the Hub are Git repositories, you can clone the datasets locally by running:",S,$,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,lt='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 c=new D({props:{title:"Downloading datasets",local:"downloading-datasets",headingTag:"h1"}}),m=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"}}),$=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=l(),G=i("p"),I=l(),_(c.$$.fragment),F=l(),_(m.$$.fragment),H=l(),u=i("p"),u.innerHTML=O,R=l(),d=i("div"),d.innerHTML=K,Z=l(),g=i("div"),g.innerHTML=tt,L=l(),_(p.$$.fragment),P=l(),h=i("p"),h.innerHTML=et,Q=l(),_(f.$$.fragment),z=l(),_(b.$$.fragment),B=l(),y=i("p"),y.textContent=at,S=l(),_($.$$.fragment),Y=l(),w=i("p"),w.textContent=st,X=l(),M=i("p"),M.innerHTML=lt,N=l(),_(U.$$.fragment),A=l(),J=i("p"),this.h()},l(t){const e=mt("svelte-u9bgzb",document.head);r=o(e,"META",{name:!0,content:!0}),e.forEach(a),x=n(t),G=o(t,"P",{}),nt(G).forEach(a),I=n(t),v(c.$$.fragment,t),F=n(t),v(m.$$.fragment,t),H=n(t),u=o(t,"P",{"data-svelte-h":!0}),T(u)!=="svelte-1ybvteq"&&(u.innerHTML=O),R=n(t),d=o(t,"DIV",{class:!0,"data-svelte-h":!0}),T(d)!=="svelte-1ach5zb"&&(d.innerHTML=K),Z=n(t),g=o(t,"DIV",{class:!0,"data-svelte-h":!0}),T(g)!=="svelte-1rm4drj"&&(g.innerHTML=tt),L=n(t),v(p.$$.fragment,t),P=n(t),h=o(t,"P",{"data-svelte-h":!0}),T(h)!=="svelte-1y487xi"&&(h.innerHTML=et),Q=n(t),v(f.$$.fragment,t),z=n(t),v(b.$$.fragment,t),B=n(t),y=o(t,"P",{"data-svelte-h":!0}),T(y)!=="svelte-11ieo6t"&&(y.textContent=at),S=n(t),v($.$$.fragment,t),Y=n(t),w=o(t,"P",{"data-svelte-h":!0}),T(w)!=="svelte-scyzjg"&&(w.textContent=st),X=n(t),M=o(t,"P",{"data-svelte-h":!0}),T(M)!=="svelte-nl03my"&&(M.innerHTML=lt),N=n(t),v(U.$$.fragment,t),A=n(t),J=o(t,"P",{}),nt(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){ut(document.head,r),s(t,x,e),s(t,G,e),s(t,I,e),k(c,t,e),s(t,F,e),k(m,t,e),s(t,H,e),s(t,u,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,z,e),k(b,t,e),s(t,B,e),s(t,y,e),s(t,S,e),k($,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(c.$$.fragment,t),j(m.$$.fragment,t),j(p.$$.fragment,t),j(f.$$.fragment,t),j(b.$$.fragment,t),j($.$$.fragment,t),j(U.$$.fragment,t),V=!0)},o(t){C(c.$$.fragment,t),C(m.$$.fragment,t),C(p.$$.fragment,t),C(f.$$.fragment,t),C(b.$$.fragment,t),C($.$$.fragment,t),C(U.$$.fragment,t),V=!1},d(t){t&&(a(x),a(G),a(I),a(F),a(H),a(u),a(R),a(d),a(Z),a(g),a(L),a(P),a(h),a(Q),a(z),a(B),a(y),a(S),a(Y),a(w),a(X),a(M),a(N),a(A),a(J)),a(r),E(c,t),E(m,t),E(p,t),E(f,t),E(b,t),E($,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(),ct(this,r,bt,ht,ot,{})}}export{Ut as component};
