import{s as O,n as tt,o as et}from"../chunks/scheduler.12fdeddc.js";import{S as at,i as st,g as i,s as n,r as w,A as nt,h as u,f as a,c as l,j as A,u as j,x as b,k as K,y as lt,a as s,v as G,d as R,t as C,w as T}from"../chunks/index.88dae322.js";import{C as Q}from"../chunks/CodeBlock.8e54a086.js";import{H as ot,E as it}from"../chunks/getInferenceSnippets.00466244.js";function ut(W){let o,U,$,F,d,Z,p,L='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/nyu-mll/glue?library=datasets" rel="nofollow"><strong>Use this dataset</strong> button</a> to copy the code to load a dataset.',J,r,N='First you need to <a href="/docs/huggingface_hub/quick-start#login">Login with your Hugging Face account</a>, for example using:',v,m,x,h,S="And then you can load a dataset from the Hugging Face Hub using",k,c,z,f,V="You can also upload datasets to the Hugging Face Hub:",B,g,H,M,D="This creates a dataset repository <code>username/my_new_dataset</code> containing your Dataset in Parquet format, that you can reload later.",I,y,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.',Y,_,q,X,P;return d=new ot({props:{title:"Using 🤗 Datasets",local:"using--datasets",headingTag:"h1"}}),m=new Q({props:{code:"aGYlMjBhdXRoJTIwbG9naW4=",highlighted:'<span class="hljs-attribute">hf auth login</span>',wrap:!1}}),c=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"),U=n(),$=i("p"),F=n(),w(d.$$.fragment),Z=n(),p=i("p"),p.innerHTML=L,J=n(),r=i("p"),r.innerHTML=N,v=n(),w(m.$$.fragment),x=n(),h=i("p"),h.textContent=S,k=n(),w(c.$$.fragment),z=n(),f=i("p"),f.textContent=V,B=n(),w(g.$$.fragment),H=n(),M=i("p"),M.innerHTML=D,I=n(),y=i("p"),y.innerHTML=E,Y=n(),w(_.$$.fragment),q=n(),X=i("p"),this.h()},l(t){const e=nt("svelte-u9bgzb",document.head);o=u(e,"META",{name:!0,content:!0}),e.forEach(a),U=l(t),$=u(t,"P",{}),A($).forEach(a),F=l(t),j(d.$$.fragment,t),Z=l(t),p=u(t,"P",{"data-svelte-h":!0}),b(p)!=="svelte-1e8voe6"&&(p.innerHTML=L),J=l(t),r=u(t,"P",{"data-svelte-h":!0}),b(r)!=="svelte-1jdzygp"&&(r.innerHTML=N),v=l(t),j(m.$$.fragment,t),x=l(t),h=u(t,"P",{"data-svelte-h":!0}),b(h)!=="svelte-18rgdu6"&&(h.textContent=S),k=l(t),j(c.$$.fragment,t),z=l(t),f=u(t,"P",{"data-svelte-h":!0}),b(f)!=="svelte-ldgarb"&&(f.textContent=V),B=l(t),j(g.$$.fragment,t),H=l(t),M=u(t,"P",{"data-svelte-h":!0}),b(M)!=="svelte-1hnrxhs"&&(M.innerHTML=D),I=l(t),y=u(t,"P",{"data-svelte-h":!0}),b(y)!=="svelte-o2xxpm"&&(y.innerHTML=E),Y=l(t),j(_.$$.fragment,t),q=l(t),X=u(t,"P",{}),A(X).forEach(a),this.h()},h(){K(o,"name","hf:doc:metadata"),K(o,"content",dt)},m(t,e){lt(document.head,o),s(t,U,e),s(t,$,e),s(t,F,e),G(d,t,e),s(t,Z,e),s(t,p,e),s(t,J,e),s(t,r,e),s(t,v,e),G(m,t,e),s(t,x,e),s(t,h,e),s(t,k,e),G(c,t,e),s(t,z,e),s(t,f,e),s(t,B,e),G(g,t,e),s(t,H,e),s(t,M,e),s(t,I,e),s(t,y,e),s(t,Y,e),G(_,t,e),s(t,q,e),s(t,X,e),P=!0},p:tt,i(t){P||(R(d.$$.fragment,t),R(m.$$.fragment,t),R(c.$$.fragment,t),R(g.$$.fragment,t),R(_.$$.fragment,t),P=!0)},o(t){C(d.$$.fragment,t),C(m.$$.fragment,t),C(c.$$.fragment,t),C(g.$$.fragment,t),C(_.$$.fragment,t),P=!1},d(t){t&&(a(U),a($),a(F),a(Z),a(p),a(J),a(r),a(v),a(x),a(h),a(k),a(z),a(f),a(B),a(H),a(M),a(I),a(y),a(Y),a(q),a(X)),a(o),T(d,t),T(m,t),T(c,t),T(g,t),T(_,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};
