import{s as As,o as Rs,n as Qs}from"../chunks/scheduler.d6170356.js";import{S as Hs,i as qs,g as c,s as e,r as f,A as Ws,h as u,f as a,c as n,j as Ns,u as o,x as j,k as xs,y as Xs,a as l,v as h,d as m,t as T,w as J}from"../chunks/index.fcd4cc08.js";import{T as Ls}from"../chunks/Tip.b09c67cf.js";import{C as w}from"../chunks/CodeBlock.7b16bdef.js";import{H as ys,E as Vs}from"../chunks/EditOnGithub.da2b595c.js";function zs(V){let p,$="Note that <code>config_name</code> field is required even if you have a single subset.";return{c(){p=c("p"),p.innerHTML=$},l(r){p=u(r,"P",{"data-svelte-h":!0}),j(p)!=="svelte-1h4lihq"&&(p.innerHTML=$)},m(r,M){l(r,p,M)},p:Qs,d(r){r&&a(p)}}}function Ps(V){let p,$="You can set a default subset using <code>default: true</code>",r,M,d;return M=new w({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}}),{c(){p=c("p"),p.innerHTML=$,r=e(),f(M.$$.fragment)},l(i){p=u(i,"P",{"data-svelte-h":!0}),j(p)!=="svelte-h6769n"&&(p.innerHTML=$),r=n(i),o(M.$$.fragment,i)},m(i,U){l(i,p,U),l(i,r,U),h(M,i,U),d=!0},p:Qs,i(i){d||(m(M.$$.fragment,i),d=!0)},o(i){T(M.$$.fragment,i),d=!1},d(i){i&&(a(p),a(r)),J(M,i)}}}function Ds(V){let p,$,r,M,d,i,U,gs='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.',P,b,bs='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.',D,B,Bs="It is also possible to define multiple subsets (also called “configurations”) for the same dataset (e.g. if the dataset has various independent files).",O,I,K,_,Is="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.",ss,C,_s="For example, given a repository like this one:",ts,v,as,S,Cs="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:",ls,Y,es,k,vs="You can select multiple files per split using a list of paths:",ns,G,ps,E,is,Z,Ss="Or you can use glob patterns to automatically list all the files you need:",cs,F,us,y,rs,N,fs,x,Ys=`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.`,os,L,ks="In that case you can define a list of subsets inside the <code>configs</code> field in YAML:",hs,Q,ms,A,Ts,R,Js,H,Gs="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:",Ms,q,js,W,Es='Refer to the <a href="/docs/datasets/package_reference/builder_classes">specific builders’ documentation</a> to see what parameters they have.',ds,g,Us,X,$s,z,ws;return d=new ys({props:{title:"Manual Configuration",local:"manual-configuration",headingTag:"h1"}}),I=new ys({props:{title:"Splits",local:"splits",headingTag:"h2"}}),v=new w({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}}),Y=new w({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}}),G=new w({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}}),E=new w({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}}),F=new w({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}}),y=new Ls({props:{warning:!0,$$slots:{default:[zs]},$$scope:{ctx:V}}}),N=new ys({props:{title:"Multiple Subsets",local:"multiple-subsets",headingTag:"h2"}}),Q=new w({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}}),A=new w({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}}),R=new ys({props:{title:"Builder parameters",local:"builder-parameters",headingTag:"h2"}}),q=new w({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}}),g=new Ls({props:{$$slots:{default:[Ps]},$$scope:{ctx:V}}}),X=new Vs({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/datasets-manual-configuration.md"}}),{c(){p=c("meta"),$=e(),r=c("p"),M=e(),f(d.$$.fragment),i=e(),U=c("p"),U.innerHTML=gs,P=e(),b=c("p"),b.innerHTML=bs,D=e(),B=c("p"),B.textContent=Bs,O=e(),f(I.$$.fragment),K=e(),_=c("p"),_.textContent=Is,ss=e(),C=c("p"),C.textContent=_s,ts=e(),f(v.$$.fragment),as=e(),S=c("p"),S.innerHTML=Cs,ls=e(),f(Y.$$.fragment),es=e(),k=c("p"),k.textContent=vs,ns=e(),f(G.$$.fragment),ps=e(),f(E.$$.fragment),is=e(),Z=c("p"),Z.textContent=Ss,cs=e(),f(F.$$.fragment),us=e(),f(y.$$.fragment),rs=e(),f(N.$$.fragment),fs=e(),x=c("p"),x.textContent=Ys,os=e(),L=c("p"),L.innerHTML=ks,hs=e(),f(Q.$$.fragment),ms=e(),f(A.$$.fragment),Ts=e(),f(R.$$.fragment),Js=e(),H=c("p"),H.innerHTML=Gs,Ms=e(),f(q.$$.fragment),js=e(),W=c("p"),W.innerHTML=Es,ds=e(),f(g.$$.fragment),Us=e(),f(X.$$.fragment),$s=e(),z=c("p"),this.h()},l(s){const t=Ws("svelte-u9bgzb",document.head);p=u(t,"META",{name:!0,content:!0}),t.forEach(a),$=n(s),r=u(s,"P",{}),Ns(r).forEach(a),M=n(s),o(d.$$.fragment,s),i=n(s),U=u(s,"P",{"data-svelte-h":!0}),j(U)!=="svelte-1q3c0th"&&(U.innerHTML=gs),P=n(s),b=u(s,"P",{"data-svelte-h":!0}),j(b)!=="svelte-1xcb7x0"&&(b.innerHTML=bs),D=n(s),B=u(s,"P",{"data-svelte-h":!0}),j(B)!=="svelte-6g0pn6"&&(B.textContent=Bs),O=n(s),o(I.$$.fragment,s),K=n(s),_=u(s,"P",{"data-svelte-h":!0}),j(_)!=="svelte-icvatv"&&(_.textContent=Is),ss=n(s),C=u(s,"P",{"data-svelte-h":!0}),j(C)!=="svelte-1rjh5y0"&&(C.textContent=_s),ts=n(s),o(v.$$.fragment,s),as=n(s),S=u(s,"P",{"data-svelte-h":!0}),j(S)!=="svelte-3ppi17"&&(S.innerHTML=Cs),ls=n(s),o(Y.$$.fragment,s),es=n(s),k=u(s,"P",{"data-svelte-h":!0}),j(k)!=="svelte-140lv3h"&&(k.textContent=vs),ns=n(s),o(G.$$.fragment,s),ps=n(s),o(E.$$.fragment,s),is=n(s),Z=u(s,"P",{"data-svelte-h":!0}),j(Z)!=="svelte-1qp9grc"&&(Z.textContent=Ss),cs=n(s),o(F.$$.fragment,s),us=n(s),o(y.$$.fragment,s),rs=n(s),o(N.$$.fragment,s),fs=n(s),x=u(s,"P",{"data-svelte-h":!0}),j(x)!=="svelte-1rzn8an"&&(x.textContent=Ys),os=n(s),L=u(s,"P",{"data-svelte-h":!0}),j(L)!=="svelte-34e7ze"&&(L.innerHTML=ks),hs=n(s),o(Q.$$.fragment,s),ms=n(s),o(A.$$.fragment,s),Ts=n(s),o(R.$$.fragment,s),Js=n(s),H=u(s,"P",{"data-svelte-h":!0}),j(H)!=="svelte-1eghtvy"&&(H.innerHTML=Gs),Ms=n(s),o(q.$$.fragment,s),js=n(s),W=u(s,"P",{"data-svelte-h":!0}),j(W)!=="svelte-1ak1ty0"&&(W.innerHTML=Es),ds=n(s),o(g.$$.fragment,s),Us=n(s),o(X.$$.fragment,s),$s=n(s),z=u(s,"P",{}),Ns(z).forEach(a),this.h()},h(){xs(p,"name","hf:doc:metadata"),xs(p,"content",Os)},m(s,t){Xs(document.head,p),l(s,$,t),l(s,r,t),l(s,M,t),h(d,s,t),l(s,i,t),l(s,U,t),l(s,P,t),l(s,b,t),l(s,D,t),l(s,B,t),l(s,O,t),h(I,s,t),l(s,K,t),l(s,_,t),l(s,ss,t),l(s,C,t),l(s,ts,t),h(v,s,t),l(s,as,t),l(s,S,t),l(s,ls,t),h(Y,s,t),l(s,es,t),l(s,k,t),l(s,ns,t),h(G,s,t),l(s,ps,t),h(E,s,t),l(s,is,t),l(s,Z,t),l(s,cs,t),h(F,s,t),l(s,us,t),h(y,s,t),l(s,rs,t),h(N,s,t),l(s,fs,t),l(s,x,t),l(s,os,t),l(s,L,t),l(s,hs,t),h(Q,s,t),l(s,ms,t),h(A,s,t),l(s,Ts,t),h(R,s,t),l(s,Js,t),l(s,H,t),l(s,Ms,t),h(q,s,t),l(s,js,t),l(s,W,t),l(s,ds,t),h(g,s,t),l(s,Us,t),h(X,s,t),l(s,$s,t),l(s,z,t),ws=!0},p(s,[t]){const Zs={};t&2&&(Zs.$$scope={dirty:t,ctx:s}),y.$set(Zs);const Fs={};t&2&&(Fs.$$scope={dirty:t,ctx:s}),g.$set(Fs)},i(s){ws||(m(d.$$.fragment,s),m(I.$$.fragment,s),m(v.$$.fragment,s),m(Y.$$.fragment,s),m(G.$$.fragment,s),m(E.$$.fragment,s),m(F.$$.fragment,s),m(y.$$.fragment,s),m(N.$$.fragment,s),m(Q.$$.fragment,s),m(A.$$.fragment,s),m(R.$$.fragment,s),m(q.$$.fragment,s),m(g.$$.fragment,s),m(X.$$.fragment,s),ws=!0)},o(s){T(d.$$.fragment,s),T(I.$$.fragment,s),T(v.$$.fragment,s),T(Y.$$.fragment,s),T(G.$$.fragment,s),T(E.$$.fragment,s),T(F.$$.fragment,s),T(y.$$.fragment,s),T(N.$$.fragment,s),T(Q.$$.fragment,s),T(A.$$.fragment,s),T(R.$$.fragment,s),T(q.$$.fragment,s),T(g.$$.fragment,s),T(X.$$.fragment,s),ws=!1},d(s){s&&(a($),a(r),a(M),a(i),a(U),a(P),a(b),a(D),a(B),a(O),a(K),a(_),a(ss),a(C),a(ts),a(as),a(S),a(ls),a(es),a(k),a(ns),a(ps),a(is),a(Z),a(cs),a(us),a(rs),a(fs),a(x),a(os),a(L),a(hs),a(ms),a(Ts),a(Js),a(H),a(Ms),a(js),a(W),a(ds),a(Us),a($s),a(z)),a(p),J(d,s),J(I,s),J(v,s),J(Y,s),J(G,s),J(E,s),J(F,s),J(y,s),J(N,s),J(Q,s),J(A,s),J(R,s),J(q,s),J(g,s),J(X,s)}}}const Os='{"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 Ks(V){return Rs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class nt extends Hs{constructor(p){super(),qs(this,p,Ks,Ds,As,{})}}export{nt as component};
