import{s as O,n as tt,o as et}from"../chunks/scheduler.d6170356.js";import{S as at,i as st,g as i,s as n,r as X,A as nt,h as u,f as a,c as l,j as A,u as Z,x as b,k as K,y as lt,a as s,v as U,d as j,t as C,w as G}from"../chunks/index.fcd4cc08.js";import{C as Q}from"../chunks/CodeBlock.7b16bdef.js";import{H as ot,E as it}from"../chunks/EditOnGithub.da2b595c.js";function ut(W){let o,R,$,T,d,F,p,V='Once you’ve found an interesting dataset on the Hugging Face Hub, you can load the dataset using 🤗 Datasets. You can click on the <a href="https://huggingface.co/datasets/samsum?library=true" rel="nofollow"><strong>Use in dataset library</strong> button</a> to copy the code to load a dataset.',J,r,L='First you need to <a href="/docs/huggingface_hub/quick-start#login">Login with your Hugging Face account</a>, for example using:',x,m,v,c,N="And then you can load a dataset from the Hugging Face Hub using",k,h,z,f,S="You can also upload datasets to the Hugging Face Hub:",H,g,B,y,D="This creates a dataset repository <code>username/my_new_dataset</code> containing your Dataset in Parquet format, that you can reload later.",Y,M,E='For more information about using 🤗 Datasets, check out the <a href="/docs/datasets/tutorial">tutorials</a> and <a href="/docs/datasets/how_to">how-to guides</a> available in the 🤗 Datasets documentation.',I,_,q,w,P;return d=new ot({props:{title:"Using 🤗 Datasets",local:"using--datasets",headingTag:"h1"}}),m=new Q({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:'huggingface-<span class="hljs-keyword">cli</span> login',wrap:!1}}),h=new Q({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJ1c2VybmFtZSUyRm15X2RhdGFzZXQlMjIpJTBBJTBBJTIzJTIwb3IlMjBsb2FkJTIwdGhlJTIwc2VwYXJhdGUlMjBzcGxpdHMlMjBpZiUyMHRoZSUyMGRhdGFzZXQlMjBoYXMlMjB0cmFpbiUyRnZhbGlkYXRpb24lMkZ0ZXN0JTIwc3BsaXRzJTBBdHJhaW5fZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJ1c2VybmFtZSUyRm15X2RhdGFzZXQlMjIlMkMlMjBzcGxpdCUzRCUyMnRyYWluJTIyKSUwQXZhbGlkX2RhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIydXNlcm5hbWUlMkZteV9kYXRhc2V0JTIyJTJDJTIwc3BsaXQlM0QlMjJ2YWxpZGF0aW9uJTIyKSUwQXRlc3RfZGF0YXNldCUyMCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJ1c2VybmFtZSUyRm15X2RhdGFzZXQlMjIlMkMlMjBzcGxpdCUzRCUyMnRlc3QlMjIp",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

dataset = load_dataset(<span class="hljs-string">&quot;username/my_dataset&quot;</span>)

<span class="hljs-comment"># or load the separate splits if the dataset has train/validation/test splits</span>
train_dataset = load_dataset(<span class="hljs-string">&quot;username/my_dataset&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)
valid_dataset = load_dataset(<span class="hljs-string">&quot;username/my_dataset&quot;</span>, split=<span class="hljs-string">&quot;validation&quot;</span>)
test_dataset  = load_dataset(<span class="hljs-string">&quot;username/my_dataset&quot;</span>, split=<span class="hljs-string">&quot;test&quot;</span>)`,wrap:!1}}),g=new Q({props:{code:"bXlfbmV3X2RhdGFzZXQucHVzaF90b19odWIoJTIydXNlcm5hbWUlMkZteV9uZXdfZGF0YXNldCUyMik=",highlighted:'my_new_dataset.push_to_hub(<span class="hljs-string">&quot;username/my_new_dataset&quot;</span>)',wrap:!1}}),_=new it({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/datasets-usage.md"}}),{c(){o=i("meta"),R=n(),$=i("p"),T=n(),X(d.$$.fragment),F=n(),p=i("p"),p.innerHTML=V,J=n(),r=i("p"),r.innerHTML=L,x=n(),X(m.$$.fragment),v=n(),c=i("p"),c.textContent=N,k=n(),X(h.$$.fragment),z=n(),f=i("p"),f.textContent=S,H=n(),X(g.$$.fragment),B=n(),y=i("p"),y.innerHTML=D,Y=n(),M=i("p"),M.innerHTML=E,I=n(),X(_.$$.fragment),q=n(),w=i("p"),this.h()},l(t){const e=nt("svelte-u9bgzb",document.head);o=u(e,"META",{name:!0,content:!0}),e.forEach(a),R=l(t),$=u(t,"P",{}),A($).forEach(a),T=l(t),Z(d.$$.fragment,t),F=l(t),p=u(t,"P",{"data-svelte-h":!0}),b(p)!=="svelte-17fzfn7"&&(p.innerHTML=V),J=l(t),r=u(t,"P",{"data-svelte-h":!0}),b(r)!=="svelte-1jdzygp"&&(r.innerHTML=L),x=l(t),Z(m.$$.fragment,t),v=l(t),c=u(t,"P",{"data-svelte-h":!0}),b(c)!=="svelte-18rgdu6"&&(c.textContent=N),k=l(t),Z(h.$$.fragment,t),z=l(t),f=u(t,"P",{"data-svelte-h":!0}),b(f)!=="svelte-ldgarb"&&(f.textContent=S),H=l(t),Z(g.$$.fragment,t),B=l(t),y=u(t,"P",{"data-svelte-h":!0}),b(y)!=="svelte-1hnrxhs"&&(y.innerHTML=D),Y=l(t),M=u(t,"P",{"data-svelte-h":!0}),b(M)!=="svelte-o2xxpm"&&(M.innerHTML=E),I=l(t),Z(_.$$.fragment,t),q=l(t),w=u(t,"P",{}),A(w).forEach(a),this.h()},h(){K(o,"name","hf:doc:metadata"),K(o,"content",dt)},m(t,e){lt(document.head,o),s(t,R,e),s(t,$,e),s(t,T,e),U(d,t,e),s(t,F,e),s(t,p,e),s(t,J,e),s(t,r,e),s(t,x,e),U(m,t,e),s(t,v,e),s(t,c,e),s(t,k,e),U(h,t,e),s(t,z,e),s(t,f,e),s(t,H,e),U(g,t,e),s(t,B,e),s(t,y,e),s(t,Y,e),s(t,M,e),s(t,I,e),U(_,t,e),s(t,q,e),s(t,w,e),P=!0},p:tt,i(t){P||(j(d.$$.fragment,t),j(m.$$.fragment,t),j(h.$$.fragment,t),j(g.$$.fragment,t),j(_.$$.fragment,t),P=!0)},o(t){C(d.$$.fragment,t),C(m.$$.fragment,t),C(h.$$.fragment,t),C(g.$$.fragment,t),C(_.$$.fragment,t),P=!1},d(t){t&&(a(R),a($),a(T),a(F),a(p),a(J),a(r),a(x),a(v),a(c),a(k),a(z),a(f),a(H),a(B),a(y),a(Y),a(M),a(I),a(q),a(w)),a(o),G(d,t),G(m,t),G(h,t),G(g,t),G(_,t)}}}const dt='{"title":"Using 🤗 Datasets","local":"using--datasets","sections":[],"depth":1}';function pt(W){return et(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ft extends at{constructor(o){super(),st(this,o,pt,ut,O,{})}}export{ft as component};
