import{s as ht,n as ft,o as bt}from"../chunks/scheduler.d6170356.js";import{S as $t,i as wt,g as i,s as l,r as u,A as yt,h as o,f as a,c as n,j as pt,u as c,x as r,k as et,y as Mt,a as s,v as p,d as h,t as f,w as b}from"../chunks/index.fcd4cc08.js";import{C as st}from"../chunks/CodeBlock.db16bf50.js";import{H as at,E as _t}from"../chunks/getInferenceSnippets.0f6acb26.js";function vt(lt){let d,Z,F,I,$,R,w,L,y,nt='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.',P,g,it='<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"/>',Q,m,ot='<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"/>',S,M,Y,_,dt='You can use the <a href="/docs/huggingface_hub"><code>huggingface_hub</code></a> library to create, delete, update and retrieve information from repos. For example, to download the <code>HuggingFaceH4/ultrachat_200k</code> dataset from the command line, run',z,v,B,U,rt='See the <a href="https://huggingface.co/docs/huggingface_hub/en/guides/cli#download-a-dataset-or-a-space" rel="nofollow">huggingface-cli download documentation</a> for more information.',X,T,gt="You can also integrate this into your own library! For example, you can quickly load a CSV dataset with a few lines using Pandas.",W,G,A,j,N,k,mt="Since all datasets on the Hub are Git repositories, you can clone the datasets locally by running:",V,x,q,C,ut="If you have write-access to the particular dataset repo, you’ll also have the ability to commit and push revisions to the dataset.",D,J,ct='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.',O,E,K,H,tt;return $=new at({props:{title:"Downloading datasets",local:"downloading-datasets",headingTag:"h1"}}),w=new at({props:{title:"Integrated libraries",local:"integrated-libraries",headingTag:"h2"}}),M=new at({props:{title:"Using the Hugging Face Client Library",local:"using-the-hugging-face-client-library",headingTag:"h2"}}),v=new st({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwZG93bmxvYWQlMjBIdWdnaW5nRmFjZUg0JTJGdWx0cmFjaGF0XzIwMGslMjAtLXJlcG8tdHlwZSUyMGRhdGFzZXQ=",highlighted:"huggingface-cli download HuggingFaceH4/ultrachat_200k --repo-type dataset",wrap:!1}}),G=new st({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}}),j=new at({props:{title:"Using Git",local:"using-git",headingTag:"h2"}}),x=new st({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}}),E=new _t({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/datasets-downloading.md"}}),{c(){d=i("meta"),Z=l(),F=i("p"),I=l(),u($.$$.fragment),R=l(),u(w.$$.fragment),L=l(),y=i("p"),y.innerHTML=nt,P=l(),g=i("div"),g.innerHTML=it,Q=l(),m=i("div"),m.innerHTML=ot,S=l(),u(M.$$.fragment),Y=l(),_=i("p"),_.innerHTML=dt,z=l(),u(v.$$.fragment),B=l(),U=i("p"),U.innerHTML=rt,X=l(),T=i("p"),T.textContent=gt,W=l(),u(G.$$.fragment),A=l(),u(j.$$.fragment),N=l(),k=i("p"),k.textContent=mt,V=l(),u(x.$$.fragment),q=l(),C=i("p"),C.textContent=ut,D=l(),J=i("p"),J.innerHTML=ct,O=l(),u(E.$$.fragment),K=l(),H=i("p"),this.h()},l(t){const e=yt("svelte-u9bgzb",document.head);d=o(e,"META",{name:!0,content:!0}),e.forEach(a),Z=n(t),F=o(t,"P",{}),pt(F).forEach(a),I=n(t),c($.$$.fragment,t),R=n(t),c(w.$$.fragment,t),L=n(t),y=o(t,"P",{"data-svelte-h":!0}),r(y)!=="svelte-1mvg6n4"&&(y.innerHTML=nt),P=n(t),g=o(t,"DIV",{class:!0,"data-svelte-h":!0}),r(g)!=="svelte-1ach5zb"&&(g.innerHTML=it),Q=n(t),m=o(t,"DIV",{class:!0,"data-svelte-h":!0}),r(m)!=="svelte-1rm4drj"&&(m.innerHTML=ot),S=n(t),c(M.$$.fragment,t),Y=n(t),_=o(t,"P",{"data-svelte-h":!0}),r(_)!=="svelte-h7l26q"&&(_.innerHTML=dt),z=n(t),c(v.$$.fragment,t),B=n(t),U=o(t,"P",{"data-svelte-h":!0}),r(U)!=="svelte-w7mtxm"&&(U.innerHTML=rt),X=n(t),T=o(t,"P",{"data-svelte-h":!0}),r(T)!=="svelte-19xeyyq"&&(T.textContent=gt),W=n(t),c(G.$$.fragment,t),A=n(t),c(j.$$.fragment,t),N=n(t),k=o(t,"P",{"data-svelte-h":!0}),r(k)!=="svelte-11ieo6t"&&(k.textContent=mt),V=n(t),c(x.$$.fragment,t),q=n(t),C=o(t,"P",{"data-svelte-h":!0}),r(C)!=="svelte-scyzjg"&&(C.textContent=ut),D=n(t),J=o(t,"P",{"data-svelte-h":!0}),r(J)!=="svelte-nl03my"&&(J.innerHTML=ct),O=n(t),c(E.$$.fragment,t),K=n(t),H=o(t,"P",{}),pt(H).forEach(a),this.h()},h(){et(d,"name","hf:doc:metadata"),et(d,"content",Ut),et(g,"class","flex justify-center"),et(m,"class","flex justify-center")},m(t,e){Mt(document.head,d),s(t,Z,e),s(t,F,e),s(t,I,e),p($,t,e),s(t,R,e),p(w,t,e),s(t,L,e),s(t,y,e),s(t,P,e),s(t,g,e),s(t,Q,e),s(t,m,e),s(t,S,e),p(M,t,e),s(t,Y,e),s(t,_,e),s(t,z,e),p(v,t,e),s(t,B,e),s(t,U,e),s(t,X,e),s(t,T,e),s(t,W,e),p(G,t,e),s(t,A,e),p(j,t,e),s(t,N,e),s(t,k,e),s(t,V,e),p(x,t,e),s(t,q,e),s(t,C,e),s(t,D,e),s(t,J,e),s(t,O,e),p(E,t,e),s(t,K,e),s(t,H,e),tt=!0},p:ft,i(t){tt||(h($.$$.fragment,t),h(w.$$.fragment,t),h(M.$$.fragment,t),h(v.$$.fragment,t),h(G.$$.fragment,t),h(j.$$.fragment,t),h(x.$$.fragment,t),h(E.$$.fragment,t),tt=!0)},o(t){f($.$$.fragment,t),f(w.$$.fragment,t),f(M.$$.fragment,t),f(v.$$.fragment,t),f(G.$$.fragment,t),f(j.$$.fragment,t),f(x.$$.fragment,t),f(E.$$.fragment,t),tt=!1},d(t){t&&(a(Z),a(F),a(I),a(R),a(L),a(y),a(P),a(g),a(Q),a(m),a(S),a(Y),a(_),a(z),a(B),a(U),a(X),a(T),a(W),a(A),a(N),a(k),a(V),a(q),a(C),a(D),a(J),a(O),a(K),a(H)),a(d),b($,t),b(w,t),b(M,t),b(v,t),b(G,t),b(j,t),b(x,t),b(E,t)}}}const Ut='{"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 Tt(lt){return bt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ct extends $t{constructor(d){super(),wt(this,d,Tt,vt,ht,{})}}export{Ct as component};
