import{s as As,o as Rs,n as Ls}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 Qs,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 xs}from"../chunks/Tip.b09c67cf.js";import{C as g}from"../chunks/CodeBlock.7b16bdef.js";import{H as ws,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 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:Ls,d(o){o&&a(p)}}}function Ps(V){let p,$="You can set a default configuration using <code>default: true</code>",o,M,d;return M=new g({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:Ls,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,ys="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.',D,B,Bs="It is also possible to define multiple 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 configuration 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:",rs,F,fs,w,os,N,us,Q,Ys=`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,ks="In that case you can define a list of configurations inside the <code>configs</code> field in YAML:",ms,L,hs,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 configuration 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 configuration parameters they have.',ds,y,Us,X,$s,z,gs;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 g({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 g({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 g({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 g({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 g({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}}),w=new xs({props:{warning:!0,$$slots:{default:[zs]},$$scope:{ctx:V}}}),N=new ws({props:{title:"Multiple Configurations",local:"multiple-configurations",headingTag:"h2"}}),L=new g({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 g({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 g({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 xs({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=r("meta"),$=e(),o=r("p"),M=e(),u(d.$$.fragment),i=e(),U=r("p"),U.textContent=ys,P=e(),b=r("p"),b.innerHTML=bs,D=e(),B=r("p"),B.textContent=Bs,O=e(),u(C.$$.fragment),K=e(),I=r("p"),I.textContent=Cs,ss=e(),_=r("p"),_.textContent=Is,ts=e(),u(v.$$.fragment),as=e(),S=r("p"),S.innerHTML=_s,ls=e(),u(Y.$$.fragment),es=e(),k=r("p"),k.textContent=vs,ns=e(),u(G.$$.fragment),ps=e(),u(E.$$.fragment),is=e(),Z=r("p"),Z.textContent=Ss,rs=e(),u(F.$$.fragment),fs=e(),u(w.$$.fragment),os=e(),u(N.$$.fragment),us=e(),Q=r("p"),Q.textContent=Ys,cs=e(),x=r("p"),x.innerHTML=ks,ms=e(),u(L.$$.fragment),hs=e(),u(A.$$.fragment),Ts=e(),u(R.$$.fragment),Js=e(),H=r("p"),H.innerHTML=Gs,Ms=e(),u(q.$$.fragment),js=e(),W=r("p"),W.innerHTML=Es,ds=e(),u(y.$$.fragment),Us=e(),u(X.$$.fragment),$s=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=ys),P=n(s),b=f(s,"P",{"data-svelte-h":!0}),j(b)!=="svelte-nfd2gu"&&(b.innerHTML=bs),D=n(s),B=f(s,"P",{"data-svelte-h":!0}),j(B)!=="svelte-1ynr88d"&&(B.textContent=Bs),O=n(s),c(C.$$.fragment,s),K=n(s),I=f(s,"P",{"data-svelte-h":!0}),j(I)!=="svelte-icvatv"&&(I.textContent=Cs),ss=n(s),_=f(s,"P",{"data-svelte-h":!0}),j(_)!=="svelte-1rjh5y0"&&(_.textContent=Is),ts=n(s),c(v.$$.fragment,s),as=n(s),S=f(s,"P",{"data-svelte-h":!0}),j(S)!=="svelte-1kc6igf"&&(S.innerHTML=_s),ls=n(s),c(Y.$$.fragment,s),es=n(s),k=f(s,"P",{"data-svelte-h":!0}),j(k)!=="svelte-140lv3h"&&(k.textContent=vs),ns=n(s),c(G.$$.fragment,s),ps=n(s),c(E.$$.fragment,s),is=n(s),Z=f(s,"P",{"data-svelte-h":!0}),j(Z)!=="svelte-1qp9grc"&&(Z.textContent=Ss),rs=n(s),c(F.$$.fragment,s),fs=n(s),c(w.$$.fragment,s),os=n(s),c(N.$$.fragment,s),us=n(s),Q=f(s,"P",{"data-svelte-h":!0}),j(Q)!=="svelte-i4ipl"&&(Q.textContent=Ys),cs=n(s),x=f(s,"P",{"data-svelte-h":!0}),j(x)!=="svelte-1p9tqpa"&&(x.innerHTML=ks),ms=n(s),c(L.$$.fragment,s),hs=n(s),c(A.$$.fragment,s),Ts=n(s),c(R.$$.fragment,s),Js=n(s),H=f(s,"P",{"data-svelte-h":!0}),j(H)!=="svelte-bg5ygi"&&(H.innerHTML=Gs),Ms=n(s),c(q.$$.fragment,s),js=n(s),W=f(s,"P",{"data-svelte-h":!0}),j(W)!=="svelte-47ik1a"&&(W.innerHTML=Es),ds=n(s),c(y.$$.fragment,s),Us=n(s),c(X.$$.fragment,s),$s=n(s),z=f(s,"P",{}),Ns(z).forEach(a),this.h()},h(){Qs(p,"name","hf:doc:metadata"),Qs(p,"content",Os)},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,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,rs,t),m(F,s,t),l(s,fs,t),m(w,s,t),l(s,os,t),m(N,s,t),l(s,us,t),l(s,Q,t),l(s,cs,t),l(s,x,t),l(s,ms,t),m(L,s,t),l(s,hs,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(y,s,t),l(s,Us,t),m(X,s,t),l(s,$s,t),l(s,z,t),gs=!0},p(s,[t]){const Zs={};t&2&&(Zs.$$scope={dirty:t,ctx:s}),w.$set(Zs);const Fs={};t&2&&(Fs.$$scope={dirty:t,ctx:s}),y.$set(Fs)},i(s){gs||(h(d.$$.fragment,s),h(C.$$.fragment,s),h(v.$$.fragment,s),h(Y.$$.fragment,s),h(G.$$.fragment,s),h(E.$$.fragment,s),h(F.$$.fragment,s),h(w.$$.fragment,s),h(N.$$.fragment,s),h(L.$$.fragment,s),h(A.$$.fragment,s),h(R.$$.fragment,s),h(q.$$.fragment,s),h(y.$$.fragment,s),h(X.$$.fragment,s),gs=!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(w.$$.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),T(X.$$.fragment,s),gs=!1},d(s){s&&(a($),a(o),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(rs),a(fs),a(os),a(us),a(Q),a(cs),a(x),a(ms),a(hs),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(w,s),J(N,s),J(L,s),J(A,s),J(R,s),J(q,s),J(y,s),J(X,s)}}}const Os='{"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 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};
