import{s as Ks,n as st,o as tt}from"../chunks/scheduler.9cda857a.js";import{S as at,i as lt,e as p,s as e,c as u,h as et,a as i,d as a,b as n,f as xs,g as c,j as o,k as Ss,l as O,m as l,n as h,t as r,o as f,p as m}from"../chunks/index.003612b0.js";import{C as nt}from"../chunks/CopyLLMTxtMenu.44d08a39.js";import{C as M}from"../chunks/CodeBlock.a90632f1.js";import{H as ks,E as pt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e5cfda8c.js";function it(Gs){let J,K,P,ss,j,ts,U,as,w,Zs='This guide will show you how to configure a custom structure for your dataset repository. The <a href="https://huggingface.co/collections/datasets-examples/manual-configuration-655e293cea26da0acab95b87" rel="nofollow">companion collection of example datasets</a> showcases each section of the documentation.',ls,y,Fs='A dataset with a supported structure and <a href="./datasets-adding#file-formats">file formats</a> automatically has a Dataset Viewer on its dataset page on the Hub. You can use YAML to define the splits, subsets and builder parameters that are used by the Viewer.',es,b,Ns="It is also possible to define multiple subsets (also called “configurations”) for the same dataset (e.g. if the dataset has various independent files).",ns,g,ps,$,Ls="If you have multiple files and want to define which file goes into which split, you can use YAML at the top of your README.md.",is,B,Qs="For example, given a repository like this one:",os,C,us,v,Rs="You can define a subset for your splits by adding the <code>configs</code> field in the YAML block at the top of your README.md:",cs,I,hs,_,As="You can select multiple files per split using a list of paths:",rs,S,fs,k,ms,Y,qs="Or you can use glob patterns to automatically list all the files you need:",Ts,E,Js,d,Hs="<p>Note that <code>config_name</code> field is required even if you have a single subset.</p>",Ms,x,ds,G,Ws=`Your dataset might have several subsets of data that you want to be able to use separately.
For example each subset has its own dropdown in the Dataset Viewer the Hugging Face Hub.`,js,Z,zs="In that case you can define a list of subsets inside the <code>configs</code> field in YAML:",Us,F,ws,N,ys,L,Vs="Note that the order of subsets shown in the viewer is the default one first, then alphabetical.",bs,T,z,Xs="You can set a default subset using <code>default: true</code>",Ys,Q,Es,V,Ps="This is useful to set which subset the Dataset Viewer shows first, and which subset data libraries load by default.",gs,R,$s,A,Ds="Not only <code>data_files</code>, but other builder-specific parameters can be passed via YAML, allowing for more flexibility on how to load the data while not requiring any custom code. For example, define which separator to use in which subset to load your <code>csv</code> files:",Bs,q,Cs,H,Os='Refer to the <a href="/docs/datasets/package_reference/builder_classes">specific builders’ documentation</a> to see what parameters they have.',vs,W,Is,D,_s;return j=new nt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),U=new ks({props:{title:"Manual Configuration",local:"manual-configuration",headingTag:"h1"}}),g=new ks({props:{title:"Splits",local:"splits",headingTag:"h2"}}),C=new M({props:{code:"bXlfZGF0YXNldF9yZXBvc2l0b3J5JTJGJTBBJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwUkVBRE1FLm1kJTBBJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwZGF0YS5jc3YlMEElRTIlOTQlOTQlRTIlOTQlODAlRTIlOTQlODAlMjBob2xkb3V0LmNzdg==",highlighted:`<span class="hljs-title">my_dataset_repository</span>/
├── <span class="hljs-type">README</span>.md
├── <span class="hljs-class"><span class="hljs-keyword">data</span>.csv</span>
└── holdout.csv`,wrap:!1}}),I=new M({props:{code:"LS0tJTBBY29uZmlncyUzQSUwQS0lMjBjb25maWdfbmFtZSUzQSUyMGRlZmF1bHQlMEElMjAlMjBkYXRhX2ZpbGVzJTNBJTBBJTIwJTIwLSUyMHNwbGl0JTNBJTIwdHJhaW4lMEElMjAlMjAlMjAlMjBwYXRoJTNBJTIwJTIyZGF0YS5jc3YlMjIlMEElMjAlMjAtJTIwc3BsaXQlM0ElMjB0ZXN0JTBBJTIwJTIwJTIwJTIwcGF0aCUzQSUyMCUyMmhvbGRvdXQuY3N2JTIyJTBBLS0t",highlighted:`<span class="hljs-meta">---</span>
<span class="hljs-attr">configs:</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">config_name:</span> <span class="hljs-string">default</span>
  <span class="hljs-attr">data_files:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">split:</span> <span class="hljs-string">train</span>
    <span class="hljs-attr">path:</span> <span class="hljs-string">&quot;data.csv&quot;</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">split:</span> <span class="hljs-string">test</span>
    <span class="hljs-attr">path:</span> <span class="hljs-string">&quot;holdout.csv&quot;</span>
<span class="hljs-meta">---</span>`,wrap:!1}}),S=new M({props:{code:"bXlfZGF0YXNldF9yZXBvc2l0b3J5JTJGJTBBJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwUkVBRE1FLm1kJTBBJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwZGF0YSUyRiUwQSVFMiU5NCU4MiUyMCUyMCUyMCVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMGFiYy5jc3YlMEElRTIlOTQlODIlMjAlMjAlMjAlRTIlOTQlOTQlRTIlOTQlODAlRTIlOTQlODAlMjBkZWYuY3N2JTBBJUUyJTk0JTk0JUUyJTk0JTgwJUUyJTk0JTgwJTIwaG9sZG91dCUyRiUwQSUyMCUyMCUyMCUyMCVFMiU5NCU5NCVFMiU5NCU4MCVFMiU5NCU4MCUyMGdoaS5jc3Y=",highlighted:`my_dataset_repository/
├── README.md
├── data/
│   ├── abc.<span class="hljs-built_in">csv</span>
│   └── def.<span class="hljs-built_in">csv</span>
└── holdout/
    └── ghi.<span class="hljs-built_in">csv</span>`,wrap:!1}}),k=new M({props:{code:"LS0tJTBBY29uZmlncyUzQSUwQS0lMjBjb25maWdfbmFtZSUzQSUyMGRlZmF1bHQlMEElMjAlMjBkYXRhX2ZpbGVzJTNBJTBBJTIwJTIwLSUyMHNwbGl0JTNBJTIwdHJhaW4lMEElMjAlMjAlMjAlMjBwYXRoJTNBJTBBJTIwJTIwJTIwJTIwLSUyMCUyMmRhdGElMkZhYmMuY3N2JTIyJTBBJTIwJTIwJTIwJTIwLSUyMCUyMmRhdGElMkZkZWYuY3N2JTIyJTBBJTIwJTIwLSUyMHNwbGl0JTNBJTIwdGVzdCUwQSUyMCUyMCUyMCUyMHBhdGglM0ElMjAlMjJob2xkb3V0JTJGZ2hpLmNzdiUyMiUwQS0tLQ==",highlighted:`<span class="hljs-meta">---</span>
<span class="hljs-attr">configs:</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">config_name:</span> <span class="hljs-string">default</span>
  <span class="hljs-attr">data_files:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">split:</span> <span class="hljs-string">train</span>
    <span class="hljs-attr">path:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">&quot;data/abc.csv&quot;</span>
    <span class="hljs-bullet">-</span> <span class="hljs-string">&quot;data/def.csv&quot;</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">split:</span> <span class="hljs-string">test</span>
    <span class="hljs-attr">path:</span> <span class="hljs-string">&quot;holdout/ghi.csv&quot;</span>
<span class="hljs-meta">---</span>`,wrap:!1}}),E=new M({props:{code:"LS0tJTBBY29uZmlncyUzQSUwQS0lMjBjb25maWdfbmFtZSUzQSUyMGRlZmF1bHQlMEElMjAlMjBkYXRhX2ZpbGVzJTNBJTBBJTIwJTIwLSUyMHNwbGl0JTNBJTIwdHJhaW4lMEElMjAlMjAlMjAlMjBwYXRoJTNBJTIwJTIyZGF0YSUyRiouY3N2JTIyJTBBJTIwJTIwLSUyMHNwbGl0JTNBJTIwdGVzdCUwQSUyMCUyMCUyMCUyMHBhdGglM0ElMjAlMjJob2xkb3V0JTJGKi5jc3YlMjIlMEEtLS0=",highlighted:`<span class="hljs-meta">---</span>
<span class="hljs-attr">configs:</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">config_name:</span> <span class="hljs-string">default</span>
  <span class="hljs-attr">data_files:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">split:</span> <span class="hljs-string">train</span>
    <span class="hljs-attr">path:</span> <span class="hljs-string">&quot;data/*.csv&quot;</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">split:</span> <span class="hljs-string">test</span>
    <span class="hljs-attr">path:</span> <span class="hljs-string">&quot;holdout/*.csv&quot;</span>
<span class="hljs-meta">---</span>`,wrap:!1}}),x=new ks({props:{title:"Multiple Subsets",local:"multiple-subsets",headingTag:"h2"}}),F=new M({props:{code:"bXlfZGF0YXNldF9yZXBvc2l0b3J5JTJGJTBBJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwUkVBRE1FLm1kJTBBJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwbWFpbl9kYXRhLmNzdiUwQSVFMiU5NCU5NCVFMiU5NCU4MCVFMiU5NCU4MCUyMGFkZGl0aW9uYWxfZGF0YS5jc3Y=",highlighted:`my_dataset_repository/
├── README.md
├── main_data.<span class="hljs-built_in">csv</span>
└── additional_data.<span class="hljs-built_in">csv</span>`,wrap:!1}}),N=new M({props:{code:"LS0tJTBBY29uZmlncyUzQSUwQS0lMjBjb25maWdfbmFtZSUzQSUyMG1haW5fZGF0YSUwQSUyMCUyMGRhdGFfZmlsZXMlM0ElMjAlMjJtYWluX2RhdGEuY3N2JTIyJTBBLSUyMGNvbmZpZ19uYW1lJTNBJTIwYWRkaXRpb25hbF9kYXRhJTBBJTIwJTIwZGF0YV9maWxlcyUzQSUyMCUyMmFkZGl0aW9uYWxfZGF0YS5jc3YlMjIlMEEtLS0=",highlighted:`<span class="hljs-meta">---</span>
<span class="hljs-attr">configs:</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">config_name:</span> <span class="hljs-string">main_data</span>
  <span class="hljs-attr">data_files:</span> <span class="hljs-string">&quot;main_data.csv&quot;</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">config_name:</span> <span class="hljs-string">additional_data</span>
  <span class="hljs-attr">data_files:</span> <span class="hljs-string">&quot;additional_data.csv&quot;</span>
<span class="hljs-meta">---</span>`,wrap:!1}}),Q=new M({props:{code:"LSUyMGNvbmZpZ19uYW1lJTNBJTIwbWFpbl9kYXRhJTBBJTIwJTIwZGF0YV9maWxlcyUzQSUyMCUyMm1haW5fZGF0YS5jc3YlMjIlMEElMjAlMjBkZWZhdWx0JTNBJTIwdHJ1ZQ==",highlighted:`<span class="hljs-bullet">-</span> <span class="hljs-attr">config_name:</span> <span class="hljs-string">main_data</span>
  <span class="hljs-attr">data_files:</span> <span class="hljs-string">&quot;main_data.csv&quot;</span>
  <span class="hljs-attr">default:</span> <span class="hljs-literal">true</span>`,wrap:!1}}),R=new ks({props:{title:"Builder parameters",local:"builder-parameters",headingTag:"h2"}}),q=new M({props:{code:"LS0tJTBBY29uZmlncyUzQSUwQS0lMjBjb25maWdfbmFtZSUzQSUyMHRhYiUwQSUyMCUyMGRhdGFfZmlsZXMlM0ElMjAlMjJtYWluX2RhdGEuY3N2JTIyJTBBJTIwJTIwc2VwJTNBJTIwJTIyJTVDdCUyMiUwQS0lMjBjb25maWdfbmFtZSUzQSUyMGNvbW1hJTBBJTIwJTIwZGF0YV9maWxlcyUzQSUyMCUyMmFkZGl0aW9uYWxfZGF0YS5jc3YlMjIlMEElMjAlMjBzZXAlM0ElMjAlMjIlMkMlMjIlMEEtLS0=",highlighted:`<span class="hljs-meta">---</span>
<span class="hljs-attr">configs:</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">config_name:</span> <span class="hljs-string">tab</span>
  <span class="hljs-attr">data_files:</span> <span class="hljs-string">&quot;main_data.csv&quot;</span>
  <span class="hljs-attr">sep:</span> <span class="hljs-string">&quot;\\t&quot;</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">config_name:</span> <span class="hljs-string">comma</span>
  <span class="hljs-attr">data_files:</span> <span class="hljs-string">&quot;additional_data.csv&quot;</span>
  <span class="hljs-attr">sep:</span> <span class="hljs-string">&quot;,&quot;</span>
<span class="hljs-meta">---</span>`,wrap:!1}}),W=new pt({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/datasets-manual-configuration.md"}}),{c(){J=p("meta"),K=e(),P=p("p"),ss=e(),u(j.$$.fragment),ts=e(),u(U.$$.fragment),as=e(),w=p("p"),w.innerHTML=Zs,ls=e(),y=p("p"),y.innerHTML=Fs,es=e(),b=p("p"),b.textContent=Ns,ns=e(),u(g.$$.fragment),ps=e(),$=p("p"),$.textContent=Ls,is=e(),B=p("p"),B.textContent=Qs,os=e(),u(C.$$.fragment),us=e(),v=p("p"),v.innerHTML=Rs,cs=e(),u(I.$$.fragment),hs=e(),_=p("p"),_.textContent=As,rs=e(),u(S.$$.fragment),fs=e(),u(k.$$.fragment),ms=e(),Y=p("p"),Y.textContent=qs,Ts=e(),u(E.$$.fragment),Js=e(),d=p("blockquote"),d.innerHTML=Hs,Ms=e(),u(x.$$.fragment),ds=e(),G=p("p"),G.textContent=Ws,js=e(),Z=p("p"),Z.innerHTML=zs,Us=e(),u(F.$$.fragment),ws=e(),u(N.$$.fragment),ys=e(),L=p("p"),L.textContent=Vs,bs=e(),T=p("blockquote"),z=p("p"),z.innerHTML=Xs,Ys=e(),u(Q.$$.fragment),Es=e(),V=p("p"),V.textContent=Ps,gs=e(),u(R.$$.fragment),$s=e(),A=p("p"),A.innerHTML=Ds,Bs=e(),u(q.$$.fragment),Cs=e(),H=p("p"),H.innerHTML=Os,vs=e(),u(W.$$.fragment),Is=e(),D=p("p"),this.h()},l(s){const t=et("svelte-u9bgzb",document.head);J=i(t,"META",{name:!0,content:!0}),t.forEach(a),K=n(s),P=i(s,"P",{}),xs(P).forEach(a),ss=n(s),c(j.$$.fragment,s),ts=n(s),c(U.$$.fragment,s),as=n(s),w=i(s,"P",{"data-svelte-h":!0}),o(w)!=="svelte-1q3c0th"&&(w.innerHTML=Zs),ls=n(s),y=i(s,"P",{"data-svelte-h":!0}),o(y)!=="svelte-1xcb7x0"&&(y.innerHTML=Fs),es=n(s),b=i(s,"P",{"data-svelte-h":!0}),o(b)!=="svelte-6g0pn6"&&(b.textContent=Ns),ns=n(s),c(g.$$.fragment,s),ps=n(s),$=i(s,"P",{"data-svelte-h":!0}),o($)!=="svelte-icvatv"&&($.textContent=Ls),is=n(s),B=i(s,"P",{"data-svelte-h":!0}),o(B)!=="svelte-1rjh5y0"&&(B.textContent=Qs),os=n(s),c(C.$$.fragment,s),us=n(s),v=i(s,"P",{"data-svelte-h":!0}),o(v)!=="svelte-3ppi17"&&(v.innerHTML=Rs),cs=n(s),c(I.$$.fragment,s),hs=n(s),_=i(s,"P",{"data-svelte-h":!0}),o(_)!=="svelte-140lv3h"&&(_.textContent=As),rs=n(s),c(S.$$.fragment,s),fs=n(s),c(k.$$.fragment,s),ms=n(s),Y=i(s,"P",{"data-svelte-h":!0}),o(Y)!=="svelte-1qp9grc"&&(Y.textContent=qs),Ts=n(s),c(E.$$.fragment,s),Js=n(s),d=i(s,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),o(d)!=="svelte-z00vdi"&&(d.innerHTML=Hs),Ms=n(s),c(x.$$.fragment,s),ds=n(s),G=i(s,"P",{"data-svelte-h":!0}),o(G)!=="svelte-1rzn8an"&&(G.textContent=Ws),js=n(s),Z=i(s,"P",{"data-svelte-h":!0}),o(Z)!=="svelte-34e7ze"&&(Z.innerHTML=zs),Us=n(s),c(F.$$.fragment,s),ws=n(s),c(N.$$.fragment,s),ys=n(s),L=i(s,"P",{"data-svelte-h":!0}),o(L)!=="svelte-1kezca"&&(L.textContent=Vs),bs=n(s),T=i(s,"BLOCKQUOTE",{class:!0});var X=xs(T);z=i(X,"P",{"data-svelte-h":!0}),o(z)!=="svelte-h6769n"&&(z.innerHTML=Xs),Ys=n(X),c(Q.$$.fragment,X),Es=n(X),V=i(X,"P",{"data-svelte-h":!0}),o(V)!=="svelte-1ihdwyq"&&(V.textContent=Ps),X.forEach(a),gs=n(s),c(R.$$.fragment,s),$s=n(s),A=i(s,"P",{"data-svelte-h":!0}),o(A)!=="svelte-1eghtvy"&&(A.innerHTML=Ds),Bs=n(s),c(q.$$.fragment,s),Cs=n(s),H=i(s,"P",{"data-svelte-h":!0}),o(H)!=="svelte-1ak1ty0"&&(H.innerHTML=Os),vs=n(s),c(W.$$.fragment,s),Is=n(s),D=i(s,"P",{}),xs(D).forEach(a),this.h()},h(){Ss(J,"name","hf:doc:metadata"),Ss(J,"content",ot),Ss(d,"class","warning"),Ss(T,"class","tip")},m(s,t){O(document.head,J),l(s,K,t),l(s,P,t),l(s,ss,t),h(j,s,t),l(s,ts,t),h(U,s,t),l(s,as,t),l(s,w,t),l(s,ls,t),l(s,y,t),l(s,es,t),l(s,b,t),l(s,ns,t),h(g,s,t),l(s,ps,t),l(s,$,t),l(s,is,t),l(s,B,t),l(s,os,t),h(C,s,t),l(s,us,t),l(s,v,t),l(s,cs,t),h(I,s,t),l(s,hs,t),l(s,_,t),l(s,rs,t),h(S,s,t),l(s,fs,t),h(k,s,t),l(s,ms,t),l(s,Y,t),l(s,Ts,t),h(E,s,t),l(s,Js,t),l(s,d,t),l(s,Ms,t),h(x,s,t),l(s,ds,t),l(s,G,t),l(s,js,t),l(s,Z,t),l(s,Us,t),h(F,s,t),l(s,ws,t),h(N,s,t),l(s,ys,t),l(s,L,t),l(s,bs,t),l(s,T,t),O(T,z),O(T,Ys),h(Q,T,null),O(T,Es),O(T,V),l(s,gs,t),h(R,s,t),l(s,$s,t),l(s,A,t),l(s,Bs,t),h(q,s,t),l(s,Cs,t),l(s,H,t),l(s,vs,t),h(W,s,t),l(s,Is,t),l(s,D,t),_s=!0},p:st,i(s){_s||(r(j.$$.fragment,s),r(U.$$.fragment,s),r(g.$$.fragment,s),r(C.$$.fragment,s),r(I.$$.fragment,s),r(S.$$.fragment,s),r(k.$$.fragment,s),r(E.$$.fragment,s),r(x.$$.fragment,s),r(F.$$.fragment,s),r(N.$$.fragment,s),r(Q.$$.fragment,s),r(R.$$.fragment,s),r(q.$$.fragment,s),r(W.$$.fragment,s),_s=!0)},o(s){f(j.$$.fragment,s),f(U.$$.fragment,s),f(g.$$.fragment,s),f(C.$$.fragment,s),f(I.$$.fragment,s),f(S.$$.fragment,s),f(k.$$.fragment,s),f(E.$$.fragment,s),f(x.$$.fragment,s),f(F.$$.fragment,s),f(N.$$.fragment,s),f(Q.$$.fragment,s),f(R.$$.fragment,s),f(q.$$.fragment,s),f(W.$$.fragment,s),_s=!1},d(s){s&&(a(K),a(P),a(ss),a(ts),a(as),a(w),a(ls),a(y),a(es),a(b),a(ns),a(ps),a($),a(is),a(B),a(os),a(us),a(v),a(cs),a(hs),a(_),a(rs),a(fs),a(ms),a(Y),a(Ts),a(Js),a(d),a(Ms),a(ds),a(G),a(js),a(Z),a(Us),a(ws),a(ys),a(L),a(bs),a(T),a(gs),a($s),a(A),a(Bs),a(Cs),a(H),a(vs),a(Is),a(D)),a(J),m(j,s),m(U,s),m(g,s),m(C,s),m(I,s),m(S,s),m(k,s),m(E,s),m(x,s),m(F,s),m(N,s),m(Q),m(R,s),m(q,s),m(W,s)}}}const ot='{"title":"Manual Configuration","local":"manual-configuration","sections":[{"title":"Splits","local":"splits","sections":[],"depth":2},{"title":"Multiple Subsets","local":"multiple-subsets","sections":[],"depth":2},{"title":"Builder parameters","local":"builder-parameters","sections":[],"depth":2}],"depth":1}';function ut(Gs){return tt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Tt extends at{constructor(J){super(),lt(this,J,ut,it,Ks,{})}}export{Tt as component};
