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