import{s as ht,n as ft,o as bt}from"../chunks/scheduler.12fdeddc.js";import{S as $t,i as yt,g as i,s as l,r as u,A as wt,h as o,f as a,c as n,j as ct,u as p,x as r,k as et,y as Mt,a as s,v as c,d as h,t as f,w as b}from"../chunks/index.88dae322.js";import{C as st}from"../chunks/CodeBlock.8e54a086.js";import{H as at,E as _t}from"../chunks/getInferenceSnippets.00466244.js";function vt(lt){let d,I,F,Z,$,R,y,L,w,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.',Y,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"/>',P,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,B,_,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',Q,v,z,U,rt='See the <a href="https://huggingface.co/docs/huggingface_hub/en/guides/cli#download-a-dataset-or-a-space" rel="nofollow">HF 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.",N,k,A,C,W,j,mt="Since all datasets on the Hub are Git repositories, you can clone the datasets locally by running:",V,G,D,x,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.",q,E,pt='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,H,K,J,tt;return $=new at({props:{title:"Downloading datasets",local:"downloading-datasets",headingTag:"h1"}}),y=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:"aGYlMjBkb3dubG9hZCUyMEh1Z2dpbmdGYWNlSDQlMkZ1bHRyYWNoYXRfMjAwayUyMC0tcmVwby10eXBlJTIwZGF0YXNldA==",highlighted:"hf download HuggingFaceH4/ultrachat_200k --repo-type dataset",wrap:!1}}),k=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}}),C=new at({props:{title:"Using Git",local:"using-git",headingTag:"h2"}}),G=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}}),H=new _t({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/datasets-downloading.md"}}),{c(){d=i("meta"),I=l(),F=i("p"),Z=l(),u($.$$.fragment),R=l(),u(y.$$.fragment),L=l(),w=i("p"),w.innerHTML=nt,Y=l(),g=i("div"),g.innerHTML=it,P=l(),m=i("div"),m.innerHTML=ot,S=l(),u(M.$$.fragment),B=l(),_=i("p"),_.innerHTML=dt,Q=l(),u(v.$$.fragment),z=l(),U=i("p"),U.innerHTML=rt,X=l(),T=i("p"),T.textContent=gt,N=l(),u(k.$$.fragment),A=l(),u(C.$$.fragment),W=l(),j=i("p"),j.textContent=mt,V=l(),u(G.$$.fragment),D=l(),x=i("p"),x.textContent=ut,q=l(),E=i("p"),E.innerHTML=pt,O=l(),u(H.$$.fragment),K=l(),J=i("p"),this.h()},l(t){const e=wt("svelte-u9bgzb",document.head);d=o(e,"META",{name:!0,content:!0}),e.forEach(a),I=n(t),F=o(t,"P",{}),ct(F).forEach(a),Z=n(t),p($.$$.fragment,t),R=n(t),p(y.$$.fragment,t),L=n(t),w=o(t,"P",{"data-svelte-h":!0}),r(w)!=="svelte-1mvg6n4"&&(w.innerHTML=nt),Y=n(t),g=o(t,"DIV",{class:!0,"data-svelte-h":!0}),r(g)!=="svelte-1ach5zb"&&(g.innerHTML=it),P=n(t),m=o(t,"DIV",{class:!0,"data-svelte-h":!0}),r(m)!=="svelte-1rm4drj"&&(m.innerHTML=ot),S=n(t),p(M.$$.fragment,t),B=n(t),_=o(t,"P",{"data-svelte-h":!0}),r(_)!=="svelte-h7l26q"&&(_.innerHTML=dt),Q=n(t),p(v.$$.fragment,t),z=n(t),U=o(t,"P",{"data-svelte-h":!0}),r(U)!=="svelte-4pzh1j"&&(U.innerHTML=rt),X=n(t),T=o(t,"P",{"data-svelte-h":!0}),r(T)!=="svelte-19xeyyq"&&(T.textContent=gt),N=n(t),p(k.$$.fragment,t),A=n(t),p(C.$$.fragment,t),W=n(t),j=o(t,"P",{"data-svelte-h":!0}),r(j)!=="svelte-11ieo6t"&&(j.textContent=mt),V=n(t),p(G.$$.fragment,t),D=n(t),x=o(t,"P",{"data-svelte-h":!0}),r(x)!=="svelte-scyzjg"&&(x.textContent=ut),q=n(t),E=o(t,"P",{"data-svelte-h":!0}),r(E)!=="svelte-nl03my"&&(E.innerHTML=pt),O=n(t),p(H.$$.fragment,t),K=n(t),J=o(t,"P",{}),ct(J).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,I,e),s(t,F,e),s(t,Z,e),c($,t,e),s(t,R,e),c(y,t,e),s(t,L,e),s(t,w,e),s(t,Y,e),s(t,g,e),s(t,P,e),s(t,m,e),s(t,S,e),c(M,t,e),s(t,B,e),s(t,_,e),s(t,Q,e),c(v,t,e),s(t,z,e),s(t,U,e),s(t,X,e),s(t,T,e),s(t,N,e),c(k,t,e),s(t,A,e),c(C,t,e),s(t,W,e),s(t,j,e),s(t,V,e),c(G,t,e),s(t,D,e),s(t,x,e),s(t,q,e),s(t,E,e),s(t,O,e),c(H,t,e),s(t,K,e),s(t,J,e),tt=!0},p:ft,i(t){tt||(h($.$$.fragment,t),h(y.$$.fragment,t),h(M.$$.fragment,t),h(v.$$.fragment,t),h(k.$$.fragment,t),h(C.$$.fragment,t),h(G.$$.fragment,t),h(H.$$.fragment,t),tt=!0)},o(t){f($.$$.fragment,t),f(y.$$.fragment,t),f(M.$$.fragment,t),f(v.$$.fragment,t),f(k.$$.fragment,t),f(C.$$.fragment,t),f(G.$$.fragment,t),f(H.$$.fragment,t),tt=!1},d(t){t&&(a(I),a(F),a(Z),a(R),a(L),a(w),a(Y),a(g),a(P),a(m),a(S),a(B),a(_),a(Q),a(z),a(U),a(X),a(T),a(N),a(A),a(W),a(j),a(V),a(D),a(x),a(q),a(E),a(O),a(K),a(J)),a(d),b($,t),b(y,t),b(M,t),b(v,t),b(k,t),b(C,t),b(G,t),b(H,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 xt extends $t{constructor(d){super(),yt(this,d,Tt,vt,ht,{})}}export{xt as component};
