import{s as xs,o as Ls,n as Qs}from"../chunks/scheduler.d6170356.js";import{S as As,i as Rs,g as r,s as e,r as c,A as Hs,h as f,f as a,c as n,j as Es,u,x as j,k as Fs,y as qs,a as l,v as h,d as m,t as T,w as J}from"../chunks/index.fcd4cc08.js";import{T as Ns}from"../chunks/Tip.b09c67cf.js";import{C as $}from"../chunks/CodeBlock.7b16bdef.js";import{H as ws}from"../chunks/Heading.8660bd0e.js";function Ws(X){let p,w="Note that <code>config_name</code> field is required even if you have a single configuration.";return{c(){p=r("p"),p.innerHTML=w},l(o){p=f(o,"P",{"data-svelte-h":!0}),j(p)!=="svelte-1k9y6t6"&&(p.innerHTML=w)},m(o,M){l(o,p,M)},p:Qs,d(o){o&&a(p)}}}function Xs(X){let p,w="You can set a default configuration using <code>default: true</code>",o,M,d;return M=new $({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=r("p"),p.innerHTML=w,o=e(),c(M.$$.fragment)},l(i){p=f(i,"P",{"data-svelte-h":!0}),j(p)!=="svelte-1a4ev9z"&&(p.innerHTML=w),o=n(i),u(M.$$.fragment,i)},m(i,U){l(i,p,U),l(i,o,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(o)),J(M,i)}}}function Vs(X){let p,w,o,M,d,i,U,$s="This guide will show you how to configure a custom structure for your dataset repository.",z,b,gs='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, configurations and builder parameters that are used by the Viewer.',P,B,ys="It is also possible to define multiple configurations for the same dataset (e.g. if the dataset has various independent files).",D,C,O,I,bs="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.",K,_,Bs="For example, given a repository like this one:",ss,v,ts,S,Cs="You can define a configuration for your splits by adding the <code>configs</code> field in the YAML block at the top of your README.md:",as,Y,ls,k,Is="You can select multiple files per split using a list of paths:",es,G,ns,Z,ps,E,_s="Or you can use glob patterns to automatically list all the files you need:",is,F,rs,g,fs,N,os,Q,vs=`Your dataset might have several subsets of data that you want to be able to use separately.
For example each configuration has its own dropdown in the Dataset Viewer the Hugging Face Hub.`,cs,x,Ss="In that case you can define a list of configurations inside the <code>configs</code> field in YAML:",us,L,hs,A,ms,R,Ts,H,Ys="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 configuration to load your <code>csv</code> files:",Js,q,Ms,W,ks='Refer to the <a href="../datasets/package_reference/builder_classes">specific builders’ documentation</a> to see what configuration parameters they have.',js,y,ds,V,Us;return d=new ws({props:{title:"Manual Configuration",local:"manual-configuration",headingTag:"h1"}}),C=new ws({props:{title:"Splits",local:"splits",headingTag:"h2"}}),v=new $({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 $({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 $({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}}),Z=new $({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 $({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}}),g=new Ns({props:{warning:!0,$$slots:{default:[Ws]},$$scope:{ctx:X}}}),N=new ws({props:{title:"Multiple Configurations",local:"multiple-configurations",headingTag:"h2"}}),L=new $({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 $({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 ws({props:{title:"Builder parameters",local:"builder-parameters",headingTag:"h2"}}),q=new $({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}}),y=new Ns({props:{$$slots:{default:[Xs]},$$scope:{ctx:X}}}),{c(){p=r("meta"),w=e(),o=r("p"),M=e(),c(d.$$.fragment),i=e(),U=r("p"),U.textContent=$s,z=e(),b=r("p"),b.innerHTML=gs,P=e(),B=r("p"),B.textContent=ys,D=e(),c(C.$$.fragment),O=e(),I=r("p"),I.textContent=bs,K=e(),_=r("p"),_.textContent=Bs,ss=e(),c(v.$$.fragment),ts=e(),S=r("p"),S.innerHTML=Cs,as=e(),c(Y.$$.fragment),ls=e(),k=r("p"),k.textContent=Is,es=e(),c(G.$$.fragment),ns=e(),c(Z.$$.fragment),ps=e(),E=r("p"),E.textContent=_s,is=e(),c(F.$$.fragment),rs=e(),c(g.$$.fragment),fs=e(),c(N.$$.fragment),os=e(),Q=r("p"),Q.textContent=vs,cs=e(),x=r("p"),x.innerHTML=Ss,us=e(),c(L.$$.fragment),hs=e(),c(A.$$.fragment),ms=e(),c(R.$$.fragment),Ts=e(),H=r("p"),H.innerHTML=Ys,Js=e(),c(q.$$.fragment),Ms=e(),W=r("p"),W.innerHTML=ks,js=e(),c(y.$$.fragment),ds=e(),V=r("p"),this.h()},l(s){const t=Hs("svelte-u9bgzb",document.head);p=f(t,"META",{name:!0,content:!0}),t.forEach(a),w=n(s),o=f(s,"P",{}),Es(o).forEach(a),M=n(s),u(d.$$.fragment,s),i=n(s),U=f(s,"P",{"data-svelte-h":!0}),j(U)!=="svelte-1hg63u8"&&(U.textContent=$s),z=n(s),b=f(s,"P",{"data-svelte-h":!0}),j(b)!=="svelte-nfd2gu"&&(b.innerHTML=gs),P=n(s),B=f(s,"P",{"data-svelte-h":!0}),j(B)!=="svelte-1ynr88d"&&(B.textContent=ys),D=n(s),u(C.$$.fragment,s),O=n(s),I=f(s,"P",{"data-svelte-h":!0}),j(I)!=="svelte-icvatv"&&(I.textContent=bs),K=n(s),_=f(s,"P",{"data-svelte-h":!0}),j(_)!=="svelte-1rjh5y0"&&(_.textContent=Bs),ss=n(s),u(v.$$.fragment,s),ts=n(s),S=f(s,"P",{"data-svelte-h":!0}),j(S)!=="svelte-1kc6igf"&&(S.innerHTML=Cs),as=n(s),u(Y.$$.fragment,s),ls=n(s),k=f(s,"P",{"data-svelte-h":!0}),j(k)!=="svelte-140lv3h"&&(k.textContent=Is),es=n(s),u(G.$$.fragment,s),ns=n(s),u(Z.$$.fragment,s),ps=n(s),E=f(s,"P",{"data-svelte-h":!0}),j(E)!=="svelte-1qp9grc"&&(E.textContent=_s),is=n(s),u(F.$$.fragment,s),rs=n(s),u(g.$$.fragment,s),fs=n(s),u(N.$$.fragment,s),os=n(s),Q=f(s,"P",{"data-svelte-h":!0}),j(Q)!=="svelte-i4ipl"&&(Q.textContent=vs),cs=n(s),x=f(s,"P",{"data-svelte-h":!0}),j(x)!=="svelte-1p9tqpa"&&(x.innerHTML=Ss),us=n(s),u(L.$$.fragment,s),hs=n(s),u(A.$$.fragment,s),ms=n(s),u(R.$$.fragment,s),Ts=n(s),H=f(s,"P",{"data-svelte-h":!0}),j(H)!=="svelte-bg5ygi"&&(H.innerHTML=Ys),Js=n(s),u(q.$$.fragment,s),Ms=n(s),W=f(s,"P",{"data-svelte-h":!0}),j(W)!=="svelte-47ik1a"&&(W.innerHTML=ks),js=n(s),u(y.$$.fragment,s),ds=n(s),V=f(s,"P",{}),Es(V).forEach(a),this.h()},h(){Fs(p,"name","hf:doc:metadata"),Fs(p,"content",zs)},m(s,t){qs(document.head,p),l(s,w,t),l(s,o,t),l(s,M,t),h(d,s,t),l(s,i,t),l(s,U,t),l(s,z,t),l(s,b,t),l(s,P,t),l(s,B,t),l(s,D,t),h(C,s,t),l(s,O,t),l(s,I,t),l(s,K,t),l(s,_,t),l(s,ss,t),h(v,s,t),l(s,ts,t),l(s,S,t),l(s,as,t),h(Y,s,t),l(s,ls,t),l(s,k,t),l(s,es,t),h(G,s,t),l(s,ns,t),h(Z,s,t),l(s,ps,t),l(s,E,t),l(s,is,t),h(F,s,t),l(s,rs,t),h(g,s,t),l(s,fs,t),h(N,s,t),l(s,os,t),l(s,Q,t),l(s,cs,t),l(s,x,t),l(s,us,t),h(L,s,t),l(s,hs,t),h(A,s,t),l(s,ms,t),h(R,s,t),l(s,Ts,t),l(s,H,t),l(s,Js,t),h(q,s,t),l(s,Ms,t),l(s,W,t),l(s,js,t),h(y,s,t),l(s,ds,t),l(s,V,t),Us=!0},p(s,[t]){const Gs={};t&2&&(Gs.$$scope={dirty:t,ctx:s}),g.$set(Gs);const Zs={};t&2&&(Zs.$$scope={dirty:t,ctx:s}),y.$set(Zs)},i(s){Us||(m(d.$$.fragment,s),m(C.$$.fragment,s),m(v.$$.fragment,s),m(Y.$$.fragment,s),m(G.$$.fragment,s),m(Z.$$.fragment,s),m(F.$$.fragment,s),m(g.$$.fragment,s),m(N.$$.fragment,s),m(L.$$.fragment,s),m(A.$$.fragment,s),m(R.$$.fragment,s),m(q.$$.fragment,s),m(y.$$.fragment,s),Us=!0)},o(s){T(d.$$.fragment,s),T(C.$$.fragment,s),T(v.$$.fragment,s),T(Y.$$.fragment,s),T(G.$$.fragment,s),T(Z.$$.fragment,s),T(F.$$.fragment,s),T(g.$$.fragment,s),T(N.$$.fragment,s),T(L.$$.fragment,s),T(A.$$.fragment,s),T(R.$$.fragment,s),T(q.$$.fragment,s),T(y.$$.fragment,s),Us=!1},d(s){s&&(a(w),a(o),a(M),a(i),a(U),a(z),a(b),a(P),a(B),a(D),a(O),a(I),a(K),a(_),a(ss),a(ts),a(S),a(as),a(ls),a(k),a(es),a(ns),a(ps),a(E),a(is),a(rs),a(fs),a(os),a(Q),a(cs),a(x),a(us),a(hs),a(ms),a(Ts),a(H),a(Js),a(Ms),a(W),a(js),a(ds),a(V)),a(p),J(d,s),J(C,s),J(v,s),J(Y,s),J(G,s),J(Z,s),J(F,s),J(g,s),J(N,s),J(L,s),J(A,s),J(R,s),J(q,s),J(y,s)}}}const zs='{"title":"Manual Configuration","local":"manual-configuration","sections":[{"title":"Splits","local":"splits","sections":[],"depth":2},{"title":"Multiple Configurations","local":"multiple-configurations","sections":[],"depth":2},{"title":"Builder parameters","local":"builder-parameters","sections":[],"depth":2}],"depth":1}';function Ps(X){return Ls(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class at extends As{constructor(p){super(),Rs(this,p,Ps,Vs,xs,{})}}export{at as component};
