import{s as As,o as Rs,n as Ls}from"../chunks/scheduler.d6170356.js";import{S as Hs,i as qs,g as u,s as e,r as c,A as Ws,h as r,f as a,c as n,j as Ns,u as h,x as j,k as xs,y as Xs,a as l,v as m,d as o,t as T,w as J}from"../chunks/index.fcd4cc08.js";import{T as Qs}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=u("p"),p.innerHTML=$},l(f){p=r(f,"P",{"data-svelte-h":!0}),j(p)!=="svelte-1h4lihq"&&(p.innerHTML=$)},m(f,M){l(f,p,M)},p:Ls,d(f){f&&a(p)}}}function Ps(V){let p,$="You can set a default subset using <code>default: true</code>",f,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=u("p"),p.innerHTML=$,f=e(),c(M.$$.fragment)},l(i){p=r(i,"P",{"data-svelte-h":!0}),j(p)!=="svelte-h6769n"&&(p.innerHTML=$),f=n(i),h(M.$$.fragment,i)},m(i,U){l(i,p,U),l(i,f,U),m(M,i,U),d=!0},p:Ls,i(i){d||(o(M.$$.fragment,i),d=!0)},o(i){T(M.$$.fragment,i),d=!1},d(i){i&&(a(p),a(f)),J(M,i)}}}function Ds(V){let p,$,f,M,d,i,U,gs="This guide will show you how to configure a custom structure for your dataset repository.",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,C,K,I,Cs="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,_,Is="For example, given a repository like this one:",ts,v,as,S,_s="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:",us,F,rs,y,fs,N,cs,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.`,hs,Q,ks="In that case you can define a list of subsets inside the <code>configs</code> field in YAML:",ms,L,os,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="../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"}}),C=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 Qs({props:{warning:!0,$$slots:{default:[zs]},$$scope:{ctx:V}}}),N=new ys({props:{title:"Multiple Subsets",local:"multiple-subsets",headingTag:"h2"}}),L=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 Qs({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=u("meta"),$=e(),f=u("p"),M=e(),c(d.$$.fragment),i=e(),U=u("p"),U.textContent=gs,P=e(),b=u("p"),b.innerHTML=bs,D=e(),B=u("p"),B.textContent=Bs,O=e(),c(C.$$.fragment),K=e(),I=u("p"),I.textContent=Cs,ss=e(),_=u("p"),_.textContent=Is,ts=e(),c(v.$$.fragment),as=e(),S=u("p"),S.innerHTML=_s,ls=e(),c(Y.$$.fragment),es=e(),k=u("p"),k.textContent=vs,ns=e(),c(G.$$.fragment),ps=e(),c(E.$$.fragment),is=e(),Z=u("p"),Z.textContent=Ss,us=e(),c(F.$$.fragment),rs=e(),c(y.$$.fragment),fs=e(),c(N.$$.fragment),cs=e(),x=u("p"),x.textContent=Ys,hs=e(),Q=u("p"),Q.innerHTML=ks,ms=e(),c(L.$$.fragment),os=e(),c(A.$$.fragment),Ts=e(),c(R.$$.fragment),Js=e(),H=u("p"),H.innerHTML=Gs,Ms=e(),c(q.$$.fragment),js=e(),W=u("p"),W.innerHTML=Es,ds=e(),c(g.$$.fragment),Us=e(),c(X.$$.fragment),$s=e(),z=u("p"),this.h()},l(s){const t=Ws("svelte-u9bgzb",document.head);p=r(t,"META",{name:!0,content:!0}),t.forEach(a),$=n(s),f=r(s,"P",{}),Ns(f).forEach(a),M=n(s),h(d.$$.fragment,s),i=n(s),U=r(s,"P",{"data-svelte-h":!0}),j(U)!=="svelte-1hg63u8"&&(U.textContent=gs),P=n(s),b=r(s,"P",{"data-svelte-h":!0}),j(b)!=="svelte-1xcb7x0"&&(b.innerHTML=bs),D=n(s),B=r(s,"P",{"data-svelte-h":!0}),j(B)!=="svelte-6g0pn6"&&(B.textContent=Bs),O=n(s),h(C.$$.fragment,s),K=n(s),I=r(s,"P",{"data-svelte-h":!0}),j(I)!=="svelte-icvatv"&&(I.textContent=Cs),ss=n(s),_=r(s,"P",{"data-svelte-h":!0}),j(_)!=="svelte-1rjh5y0"&&(_.textContent=Is),ts=n(s),h(v.$$.fragment,s),as=n(s),S=r(s,"P",{"data-svelte-h":!0}),j(S)!=="svelte-3ppi17"&&(S.innerHTML=_s),ls=n(s),h(Y.$$.fragment,s),es=n(s),k=r(s,"P",{"data-svelte-h":!0}),j(k)!=="svelte-140lv3h"&&(k.textContent=vs),ns=n(s),h(G.$$.fragment,s),ps=n(s),h(E.$$.fragment,s),is=n(s),Z=r(s,"P",{"data-svelte-h":!0}),j(Z)!=="svelte-1qp9grc"&&(Z.textContent=Ss),us=n(s),h(F.$$.fragment,s),rs=n(s),h(y.$$.fragment,s),fs=n(s),h(N.$$.fragment,s),cs=n(s),x=r(s,"P",{"data-svelte-h":!0}),j(x)!=="svelte-1rzn8an"&&(x.textContent=Ys),hs=n(s),Q=r(s,"P",{"data-svelte-h":!0}),j(Q)!=="svelte-34e7ze"&&(Q.innerHTML=ks),ms=n(s),h(L.$$.fragment,s),os=n(s),h(A.$$.fragment,s),Ts=n(s),h(R.$$.fragment,s),Js=n(s),H=r(s,"P",{"data-svelte-h":!0}),j(H)!=="svelte-1eghtvy"&&(H.innerHTML=Gs),Ms=n(s),h(q.$$.fragment,s),js=n(s),W=r(s,"P",{"data-svelte-h":!0}),j(W)!=="svelte-4hjt7c"&&(W.innerHTML=Es),ds=n(s),h(g.$$.fragment,s),Us=n(s),h(X.$$.fragment,s),$s=n(s),z=r(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,f,t),l(s,M,t),m(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),m(C,s,t),l(s,K,t),l(s,I,t),l(s,ss,t),l(s,_,t),l(s,ts,t),m(v,s,t),l(s,as,t),l(s,S,t),l(s,ls,t),m(Y,s,t),l(s,es,t),l(s,k,t),l(s,ns,t),m(G,s,t),l(s,ps,t),m(E,s,t),l(s,is,t),l(s,Z,t),l(s,us,t),m(F,s,t),l(s,rs,t),m(y,s,t),l(s,fs,t),m(N,s,t),l(s,cs,t),l(s,x,t),l(s,hs,t),l(s,Q,t),l(s,ms,t),m(L,s,t),l(s,os,t),m(A,s,t),l(s,Ts,t),m(R,s,t),l(s,Js,t),l(s,H,t),l(s,Ms,t),m(q,s,t),l(s,js,t),l(s,W,t),l(s,ds,t),m(g,s,t),l(s,Us,t),m(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||(o(d.$$.fragment,s),o(C.$$.fragment,s),o(v.$$.fragment,s),o(Y.$$.fragment,s),o(G.$$.fragment,s),o(E.$$.fragment,s),o(F.$$.fragment,s),o(y.$$.fragment,s),o(N.$$.fragment,s),o(L.$$.fragment,s),o(A.$$.fragment,s),o(R.$$.fragment,s),o(q.$$.fragment,s),o(g.$$.fragment,s),o(X.$$.fragment,s),ws=!0)},o(s){T(d.$$.fragment,s),T(C.$$.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(L.$$.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(f),a(M),a(i),a(U),a(P),a(b),a(D),a(B),a(O),a(K),a(I),a(ss),a(_),a(ts),a(as),a(S),a(ls),a(es),a(k),a(ns),a(ps),a(is),a(Z),a(us),a(rs),a(fs),a(cs),a(x),a(hs),a(Q),a(ms),a(os),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(C,s),J(v,s),J(Y,s),J(G,s),J(E,s),J(F,s),J(y,s),J(N,s),J(L,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};
