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