import{s as et,n as at,o as st}from"../chunks/scheduler.9cda857a.js";import{S as nt,i as lt,e as i,s as n,c as b,h as ot,a as p,d as a,b as l,f as O,g as X,j as w,k as tt,l as it,m as s,n as C,t as j,o as G,p as R}from"../chunks/index.003612b0.js";import{C as pt}from"../chunks/CopyLLMTxtMenu.44d08a39.js";import{C as W}from"../chunks/CodeBlock.a90632f1.js";import{H as ut,E as dt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e5cfda8c.js";function mt(S){let o,F,T,Z,u,x,d,J,m,N='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.',v,r,V='First you need to <a href="/docs/huggingface_hub/quick-start#login">Login with your Hugging Face account</a>, for example using:',z,h,k,f,D="And then you can load a dataset from the Hugging Face Hub using",B,c,H,g,E="You can also upload datasets to the Hugging Face Hub:",I,y,Y,M,A="This creates a dataset repository <code>username/my_new_dataset</code> containing your Dataset in Parquet format, that you can reload later.",q,$,K='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.',P,_,Q,U,L;return u=new pt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),d=new ut({props:{title:"Using 🤗 Datasets",local:"using--datasets",headingTag:"h1"}}),h=new W({props:{code:"aGYlMjBhdXRoJTIwbG9naW4=",highlighted:'<span class="hljs-attribute">hf auth login</span>',wrap:!1}}),c=new W({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}}),y=new W({props:{code:"bXlfbmV3X2RhdGFzZXQucHVzaF90b19odWIoJTIydXNlcm5hbWUlMkZteV9uZXdfZGF0YXNldCUyMik=",highlighted:'my_new_dataset.push_to_hub(<span class="hljs-string">&quot;username/my_new_dataset&quot;</span>)',wrap:!1}}),_=new dt({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/datasets-usage.md"}}),{c(){o=i("meta"),F=n(),T=i("p"),Z=n(),b(u.$$.fragment),x=n(),b(d.$$.fragment),J=n(),m=i("p"),m.innerHTML=N,v=n(),r=i("p"),r.innerHTML=V,z=n(),b(h.$$.fragment),k=n(),f=i("p"),f.textContent=D,B=n(),b(c.$$.fragment),H=n(),g=i("p"),g.textContent=E,I=n(),b(y.$$.fragment),Y=n(),M=i("p"),M.innerHTML=A,q=n(),$=i("p"),$.innerHTML=K,P=n(),b(_.$$.fragment),Q=n(),U=i("p"),this.h()},l(t){const e=ot("svelte-u9bgzb",document.head);o=p(e,"META",{name:!0,content:!0}),e.forEach(a),F=l(t),T=p(t,"P",{}),O(T).forEach(a),Z=l(t),X(u.$$.fragment,t),x=l(t),X(d.$$.fragment,t),J=l(t),m=p(t,"P",{"data-svelte-h":!0}),w(m)!=="svelte-1e8voe6"&&(m.innerHTML=N),v=l(t),r=p(t,"P",{"data-svelte-h":!0}),w(r)!=="svelte-1jdzygp"&&(r.innerHTML=V),z=l(t),X(h.$$.fragment,t),k=l(t),f=p(t,"P",{"data-svelte-h":!0}),w(f)!=="svelte-18rgdu6"&&(f.textContent=D),B=l(t),X(c.$$.fragment,t),H=l(t),g=p(t,"P",{"data-svelte-h":!0}),w(g)!=="svelte-ldgarb"&&(g.textContent=E),I=l(t),X(y.$$.fragment,t),Y=l(t),M=p(t,"P",{"data-svelte-h":!0}),w(M)!=="svelte-1hnrxhs"&&(M.innerHTML=A),q=l(t),$=p(t,"P",{"data-svelte-h":!0}),w($)!=="svelte-o2xxpm"&&($.innerHTML=K),P=l(t),X(_.$$.fragment,t),Q=l(t),U=p(t,"P",{}),O(U).forEach(a),this.h()},h(){tt(o,"name","hf:doc:metadata"),tt(o,"content",rt)},m(t,e){it(document.head,o),s(t,F,e),s(t,T,e),s(t,Z,e),C(u,t,e),s(t,x,e),C(d,t,e),s(t,J,e),s(t,m,e),s(t,v,e),s(t,r,e),s(t,z,e),C(h,t,e),s(t,k,e),s(t,f,e),s(t,B,e),C(c,t,e),s(t,H,e),s(t,g,e),s(t,I,e),C(y,t,e),s(t,Y,e),s(t,M,e),s(t,q,e),s(t,$,e),s(t,P,e),C(_,t,e),s(t,Q,e),s(t,U,e),L=!0},p:at,i(t){L||(j(u.$$.fragment,t),j(d.$$.fragment,t),j(h.$$.fragment,t),j(c.$$.fragment,t),j(y.$$.fragment,t),j(_.$$.fragment,t),L=!0)},o(t){G(u.$$.fragment,t),G(d.$$.fragment,t),G(h.$$.fragment,t),G(c.$$.fragment,t),G(y.$$.fragment,t),G(_.$$.fragment,t),L=!1},d(t){t&&(a(F),a(T),a(Z),a(x),a(J),a(m),a(v),a(r),a(z),a(k),a(f),a(B),a(H),a(g),a(I),a(Y),a(M),a(q),a($),a(P),a(Q),a(U)),a(o),R(u,t),R(d,t),R(h,t),R(c,t),R(y,t),R(_,t)}}}const rt='{"title":"Using 🤗 Datasets","local":"using--datasets","sections":[],"depth":1}';function ht(S){return st(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $t extends nt{constructor(o){super(),lt(this,o,ht,mt,et,{})}}export{$t as component};
