import{s as Lt,n as Pt,o as St}from"../chunks/scheduler.d6170356.js";import{S as It,i as At,g as n,s as i,r as d,A as Bt,h as o,f as a,c as l,j as Ht,u as p,x as r,k as jt,y as Et,a as s,v as m,d as u,t as c,w as g}from"../chunks/index.fcd4cc08.js";import{C as kt}from"../chunks/CodeBlock.7b16bdef.js";import{H as F,E as Ft}from"../chunks/EditOnGithub.da2b595c.js";function Dt(ct){let f,Q,D,z,h,W,$,gt="There are no constraints on how to structure dataset repositories.",Y,T,ht=`However, if you want the Dataset Viewer to show certain data files, or to separate your dataset in train/validation/test splits, you need to structure your dataset accordingly.
Often it is as simple as naming your data files according to their split names, e.g. <code>train.csv</code> and <code>test.csv</code>.`,O,b,Z,w,$t='Machine learning datasets typically have splits and may also have subsets. A dataset is generally made of <em>splits</em> (e.g. <code>train</code> and <code>test</code>) that are used during different stages of training and evaluating a model. A <em>subset</em> (also called <em>configuration</em>) is a sub-dataset contained within a larger dataset. Subsets are especially common in multilingual speech datasets where there may be a different subset for each language. If you’re interested in learning more about splits and subsets, check out the <a href="/docs/datasets-server/configs_and_splits">Splits and subsets</a> guide!',R,v,Tt='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/split-configs-server.gif" alt="split-configs-server"/>',V,y,N,x,bt="Splits are automatically detected based on file and directory names. For example, this is a dataset with <code>train</code>, <code>test</code>, and <code>validation</code> splits:",X,J,q,M,wt='To structure your dataset by naming your data files or directories according to their split names, see the <a href="./datasets-file-names-and-splits">File names and splits</a> documentation and the <a href="https://huggingface.co/collections/datasets-examples/file-names-and-splits-655e28af4471bd95709eb135" rel="nofollow">companion collection of example datasets</a>.',K,_,tt,C,vt=`You can choose the data files to show in the Dataset Viewer for your dataset using YAML.
It is useful if you want to specify which file goes into which split manually.`,et,U,yt="You can also define multiple subsets for your dataset, and pass dataset building parameters (e.g. the separator to use for CSV files).",at,H,xt="Here is an example of a configuration defining a subset called “benchmark” with a <code>test</code> split.",st,j,it,k,Jt='See the documentation on <a href="./datasets-manual-configuration">Manual configuration</a> for more information. Look also to the <a href="https://huggingface.co/collections/datasets-examples/manual-configuration-655e293cea26da0acab95b87" rel="nofollow">example datasets</a>.',lt,L,nt,P,Mt='See the <a href="./datasets-adding#file-formats">File formats</a> doc page to find the list of supported formats and recommendations for your dataset. If your dataset uses CSV or TSV files, you can find more information in the <a href="https://huggingface.co/collections/datasets-examples/format-csv-and-tsv-655f681cb9673a4249cccb3d" rel="nofollow">example datasets</a>.',ot,S,rt,I,_t=`For image and audio classification datasets, you can also use directories to name the image and audio classes.
And if your images/audio files have metadata (e.g. captions, bounding boxes, transcriptions, etc.), you can have metadata files next to them.`,ft,A,Ct="We provide two guides that you can check out:",dt,B,Ut='<li><a href="./datasets-image">How to create an image dataset</a> (<a href="https://huggingface.co/collections/datasets-examples/image-dataset-6568e7cf28639db76eb92d65" rel="nofollow">example datasets</a>)</li> <li><a href="./datasets-audio">How to create an audio dataset</a> (<a href="https://huggingface.co/collections/datasets-examples/audio-dataset-66aca0b73e8f69e3d069e607" rel="nofollow">example datasets</a>)</li>',pt,E,mt,G,ut;return h=new F({props:{title:"Data files Configuration",local:"data-files-configuration",headingTag:"h1"}}),b=new F({props:{title:"What are splits and subsets?",local:"what-are-splits-and-subsets",headingTag:"h2"}}),y=new F({props:{title:"Automatic splits detection",local:"automatic-splits-detection",headingTag:"h2"}}),J=new kt({props:{code:"bXlfZGF0YXNldF9yZXBvc2l0b3J5JTJGJTBBJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwUkVBRE1FLm1kJTBBJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwdHJhaW4uY3N2JTBBJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwdGVzdC5jc3YlMEElRTIlOTQlOTQlRTIlOTQlODAlRTIlOTQlODAlMjB2YWxpZGF0aW9uLmNzdg==",highlighted:`my_dataset_repository/
├── README.md
├── train.<span class="hljs-built_in">csv</span>
├── test.<span class="hljs-built_in">csv</span>
└── validation.<span class="hljs-built_in">csv</span>`,wrap:!1}}),_=new F({props:{title:"Manual splits and subsets configuration",local:"manual-splits-and-subsets-configuration",headingTag:"h2"}}),j=new kt({props:{code:"Y29uZmlncyUzQSUwQS0lMjBjb25maWdfbmFtZSUzQSUyMGJlbmNobWFyayUwQSUyMCUyMGRhdGFfZmlsZXMlM0ElMEElMjAlMjAtJTIwc3BsaXQlM0ElMjB0ZXN0JTBBJTIwJTIwJTIwJTIwcGF0aCUzQSUyMGJlbmNobWFyay5jc3Y=",highlighted:`<span class="hljs-attr">configs:</span>
<span class="hljs-bullet">-</span> <span class="hljs-attr">config_name:</span> <span class="hljs-string">benchmark</span>
  <span class="hljs-attr">data_files:</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">benchmark.csv</span>`,wrap:!1}}),L=new F({props:{title:"Supported file formats",local:"supported-file-formats",headingTag:"h2"}}),S=new F({props:{title:"Image and Audio datasets",local:"image-and-audio-datasets",headingTag:"h2"}}),E=new Ft({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/datasets-data-files-configuration.md"}}),{c(){f=n("meta"),Q=i(),D=n("p"),z=i(),d(h.$$.fragment),W=i(),$=n("p"),$.textContent=gt,Y=i(),T=n("p"),T.innerHTML=ht,O=i(),d(b.$$.fragment),Z=i(),w=n("p"),w.innerHTML=$t,R=i(),v=n("p"),v.innerHTML=Tt,V=i(),d(y.$$.fragment),N=i(),x=n("p"),x.innerHTML=bt,X=i(),d(J.$$.fragment),q=i(),M=n("p"),M.innerHTML=wt,K=i(),d(_.$$.fragment),tt=i(),C=n("p"),C.textContent=vt,et=i(),U=n("p"),U.textContent=yt,at=i(),H=n("p"),H.innerHTML=xt,st=i(),d(j.$$.fragment),it=i(),k=n("p"),k.innerHTML=Jt,lt=i(),d(L.$$.fragment),nt=i(),P=n("p"),P.innerHTML=Mt,ot=i(),d(S.$$.fragment),rt=i(),I=n("p"),I.textContent=_t,ft=i(),A=n("p"),A.textContent=Ct,dt=i(),B=n("ul"),B.innerHTML=Ut,pt=i(),d(E.$$.fragment),mt=i(),G=n("p"),this.h()},l(t){const e=Bt("svelte-u9bgzb",document.head);f=o(e,"META",{name:!0,content:!0}),e.forEach(a),Q=l(t),D=o(t,"P",{}),Ht(D).forEach(a),z=l(t),p(h.$$.fragment,t),W=l(t),$=o(t,"P",{"data-svelte-h":!0}),r($)!=="svelte-1sicc2g"&&($.textContent=gt),Y=l(t),T=o(t,"P",{"data-svelte-h":!0}),r(T)!=="svelte-rffpu1"&&(T.innerHTML=ht),O=l(t),p(b.$$.fragment,t),Z=l(t),w=o(t,"P",{"data-svelte-h":!0}),r(w)!=="svelte-1scij8h"&&(w.innerHTML=$t),R=l(t),v=o(t,"P",{"data-svelte-h":!0}),r(v)!=="svelte-1p3cuco"&&(v.innerHTML=Tt),V=l(t),p(y.$$.fragment,t),N=l(t),x=o(t,"P",{"data-svelte-h":!0}),r(x)!=="svelte-1l3jl1k"&&(x.innerHTML=bt),X=l(t),p(J.$$.fragment,t),q=l(t),M=o(t,"P",{"data-svelte-h":!0}),r(M)!=="svelte-1gvdkiz"&&(M.innerHTML=wt),K=l(t),p(_.$$.fragment,t),tt=l(t),C=o(t,"P",{"data-svelte-h":!0}),r(C)!=="svelte-irk0xr"&&(C.textContent=vt),et=l(t),U=o(t,"P",{"data-svelte-h":!0}),r(U)!=="svelte-24qwdr"&&(U.textContent=yt),at=l(t),H=o(t,"P",{"data-svelte-h":!0}),r(H)!=="svelte-acor93"&&(H.innerHTML=xt),st=l(t),p(j.$$.fragment,t),it=l(t),k=o(t,"P",{"data-svelte-h":!0}),r(k)!=="svelte-1bzrp3h"&&(k.innerHTML=Jt),lt=l(t),p(L.$$.fragment,t),nt=l(t),P=o(t,"P",{"data-svelte-h":!0}),r(P)!=="svelte-13m965x"&&(P.innerHTML=Mt),ot=l(t),p(S.$$.fragment,t),rt=l(t),I=o(t,"P",{"data-svelte-h":!0}),r(I)!=="svelte-r9o772"&&(I.textContent=_t),ft=l(t),A=o(t,"P",{"data-svelte-h":!0}),r(A)!=="svelte-1s3m8si"&&(A.textContent=Ct),dt=l(t),B=o(t,"UL",{"data-svelte-h":!0}),r(B)!=="svelte-zbloxx"&&(B.innerHTML=Ut),pt=l(t),p(E.$$.fragment,t),mt=l(t),G=o(t,"P",{}),Ht(G).forEach(a),this.h()},h(){jt(f,"name","hf:doc:metadata"),jt(f,"content",Gt)},m(t,e){Et(document.head,f),s(t,Q,e),s(t,D,e),s(t,z,e),m(h,t,e),s(t,W,e),s(t,$,e),s(t,Y,e),s(t,T,e),s(t,O,e),m(b,t,e),s(t,Z,e),s(t,w,e),s(t,R,e),s(t,v,e),s(t,V,e),m(y,t,e),s(t,N,e),s(t,x,e),s(t,X,e),m(J,t,e),s(t,q,e),s(t,M,e),s(t,K,e),m(_,t,e),s(t,tt,e),s(t,C,e),s(t,et,e),s(t,U,e),s(t,at,e),s(t,H,e),s(t,st,e),m(j,t,e),s(t,it,e),s(t,k,e),s(t,lt,e),m(L,t,e),s(t,nt,e),s(t,P,e),s(t,ot,e),m(S,t,e),s(t,rt,e),s(t,I,e),s(t,ft,e),s(t,A,e),s(t,dt,e),s(t,B,e),s(t,pt,e),m(E,t,e),s(t,mt,e),s(t,G,e),ut=!0},p:Pt,i(t){ut||(u(h.$$.fragment,t),u(b.$$.fragment,t),u(y.$$.fragment,t),u(J.$$.fragment,t),u(_.$$.fragment,t),u(j.$$.fragment,t),u(L.$$.fragment,t),u(S.$$.fragment,t),u(E.$$.fragment,t),ut=!0)},o(t){c(h.$$.fragment,t),c(b.$$.fragment,t),c(y.$$.fragment,t),c(J.$$.fragment,t),c(_.$$.fragment,t),c(j.$$.fragment,t),c(L.$$.fragment,t),c(S.$$.fragment,t),c(E.$$.fragment,t),ut=!1},d(t){t&&(a(Q),a(D),a(z),a(W),a($),a(Y),a(T),a(O),a(Z),a(w),a(R),a(v),a(V),a(N),a(x),a(X),a(q),a(M),a(K),a(tt),a(C),a(et),a(U),a(at),a(H),a(st),a(it),a(k),a(lt),a(nt),a(P),a(ot),a(rt),a(I),a(ft),a(A),a(dt),a(B),a(pt),a(mt),a(G)),a(f),g(h,t),g(b,t),g(y,t),g(J,t),g(_,t),g(j,t),g(L,t),g(S,t),g(E,t)}}}const Gt='{"title":"Data files Configuration","local":"data-files-configuration","sections":[{"title":"What are splits and subsets?","local":"what-are-splits-and-subsets","sections":[],"depth":2},{"title":"Automatic splits detection","local":"automatic-splits-detection","sections":[],"depth":2},{"title":"Manual splits and subsets configuration","local":"manual-splits-and-subsets-configuration","sections":[],"depth":2},{"title":"Supported file formats","local":"supported-file-formats","sections":[],"depth":2},{"title":"Image and Audio datasets","local":"image-and-audio-datasets","sections":[],"depth":2}],"depth":1}';function Qt(ct){return St(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Zt extends It{constructor(f){super(),At(this,f,Qt,Dt,Lt,{})}}export{Zt as component};
