import{s as Pt,n as It,o as Bt}from"../chunks/scheduler.9cda857a.js";import{S as Et,i as At,e as n,s as i,c as f,h as Ft,a as o,d as a,b as l,f as jt,g as p,j as r,k as kt,l as Dt,m as s,n as d,t as m,o as u,p as c}from"../chunks/index.003612b0.js";import{C as Gt}from"../chunks/CopyLLMTxtMenu.44d08a39.js";import{C as St}from"../chunks/CodeBlock.a90632f1.js";import{H as D,E as Qt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e5cfda8c.js";function zt(ht){let g,z,G,V,h,W,$,Y,T,$t="There are no constraints on how to structure dataset repositories.",O,v,Tt=`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>.`,Z,b,R,w,vt='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!',N,y,bt='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/split-configs-server.gif" alt="split-configs-server"/>',X,x,q,J,wt="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:",K,M,tt,_,yt='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>.',et,C,at,U,xt=`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.`,st,H,Jt="You can also define multiple subsets for your dataset, and pass dataset building parameters (e.g. the separator to use for CSV files).",it,L,Mt="Here is an example of a configuration defining a subset called “benchmark” with a <code>test</code> split.",lt,j,nt,k,_t='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>.',ot,S,rt,P,Ct='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>.',ft,I,pt,B,Ut=`For image/audio/video classification datasets, you can also use directories to name the image/audio/video classes.
And if your images/audio/video files have metadata (e.g. captions, bounding boxes, transcriptions, etc.), you can have metadata files next to them.`,dt,E,Ht="We provide two guides that you can check out:",mt,A,Lt='<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> <li><a href="./datasets-video">How to create a video dataset</a></li>',ut,F,ct,Q,gt;return h=new Gt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),$=new D({props:{title:"Data files Configuration",local:"data-files-configuration",headingTag:"h1"}}),b=new D({props:{title:"What are splits and subsets?",local:"what-are-splits-and-subsets",headingTag:"h2"}}),x=new D({props:{title:"Automatic splits detection",local:"automatic-splits-detection",headingTag:"h2"}}),M=new St({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}}),C=new D({props:{title:"Manual splits and subsets configuration",local:"manual-splits-and-subsets-configuration",headingTag:"h2"}}),j=new St({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}}),S=new D({props:{title:"Supported file formats",local:"supported-file-formats",headingTag:"h2"}}),I=new D({props:{title:"Image, Audio and Video datasets",local:"image-audio-and-video-datasets",headingTag:"h2"}}),F=new Qt({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/datasets-data-files-configuration.md"}}),{c(){g=n("meta"),z=i(),G=n("p"),V=i(),f(h.$$.fragment),W=i(),f($.$$.fragment),Y=i(),T=n("p"),T.textContent=$t,O=i(),v=n("p"),v.innerHTML=Tt,Z=i(),f(b.$$.fragment),R=i(),w=n("p"),w.innerHTML=vt,N=i(),y=n("p"),y.innerHTML=bt,X=i(),f(x.$$.fragment),q=i(),J=n("p"),J.innerHTML=wt,K=i(),f(M.$$.fragment),tt=i(),_=n("p"),_.innerHTML=yt,et=i(),f(C.$$.fragment),at=i(),U=n("p"),U.textContent=xt,st=i(),H=n("p"),H.textContent=Jt,it=i(),L=n("p"),L.innerHTML=Mt,lt=i(),f(j.$$.fragment),nt=i(),k=n("p"),k.innerHTML=_t,ot=i(),f(S.$$.fragment),rt=i(),P=n("p"),P.innerHTML=Ct,ft=i(),f(I.$$.fragment),pt=i(),B=n("p"),B.textContent=Ut,dt=i(),E=n("p"),E.textContent=Ht,mt=i(),A=n("ul"),A.innerHTML=Lt,ut=i(),f(F.$$.fragment),ct=i(),Q=n("p"),this.h()},l(t){const e=Ft("svelte-u9bgzb",document.head);g=o(e,"META",{name:!0,content:!0}),e.forEach(a),z=l(t),G=o(t,"P",{}),jt(G).forEach(a),V=l(t),p(h.$$.fragment,t),W=l(t),p($.$$.fragment,t),Y=l(t),T=o(t,"P",{"data-svelte-h":!0}),r(T)!=="svelte-1sicc2g"&&(T.textContent=$t),O=l(t),v=o(t,"P",{"data-svelte-h":!0}),r(v)!=="svelte-rffpu1"&&(v.innerHTML=Tt),Z=l(t),p(b.$$.fragment,t),R=l(t),w=o(t,"P",{"data-svelte-h":!0}),r(w)!=="svelte-1scij8h"&&(w.innerHTML=vt),N=l(t),y=o(t,"P",{"data-svelte-h":!0}),r(y)!=="svelte-1p3cuco"&&(y.innerHTML=bt),X=l(t),p(x.$$.fragment,t),q=l(t),J=o(t,"P",{"data-svelte-h":!0}),r(J)!=="svelte-1l3jl1k"&&(J.innerHTML=wt),K=l(t),p(M.$$.fragment,t),tt=l(t),_=o(t,"P",{"data-svelte-h":!0}),r(_)!=="svelte-1gvdkiz"&&(_.innerHTML=yt),et=l(t),p(C.$$.fragment,t),at=l(t),U=o(t,"P",{"data-svelte-h":!0}),r(U)!=="svelte-irk0xr"&&(U.textContent=xt),st=l(t),H=o(t,"P",{"data-svelte-h":!0}),r(H)!=="svelte-24qwdr"&&(H.textContent=Jt),it=l(t),L=o(t,"P",{"data-svelte-h":!0}),r(L)!=="svelte-acor93"&&(L.innerHTML=Mt),lt=l(t),p(j.$$.fragment,t),nt=l(t),k=o(t,"P",{"data-svelte-h":!0}),r(k)!=="svelte-1bzrp3h"&&(k.innerHTML=_t),ot=l(t),p(S.$$.fragment,t),rt=l(t),P=o(t,"P",{"data-svelte-h":!0}),r(P)!=="svelte-13m965x"&&(P.innerHTML=Ct),ft=l(t),p(I.$$.fragment,t),pt=l(t),B=o(t,"P",{"data-svelte-h":!0}),r(B)!=="svelte-cp92ju"&&(B.textContent=Ut),dt=l(t),E=o(t,"P",{"data-svelte-h":!0}),r(E)!=="svelte-1s3m8si"&&(E.textContent=Ht),mt=l(t),A=o(t,"UL",{"data-svelte-h":!0}),r(A)!=="svelte-1uc6vgs"&&(A.innerHTML=Lt),ut=l(t),p(F.$$.fragment,t),ct=l(t),Q=o(t,"P",{}),jt(Q).forEach(a),this.h()},h(){kt(g,"name","hf:doc:metadata"),kt(g,"content",Vt)},m(t,e){Dt(document.head,g),s(t,z,e),s(t,G,e),s(t,V,e),d(h,t,e),s(t,W,e),d($,t,e),s(t,Y,e),s(t,T,e),s(t,O,e),s(t,v,e),s(t,Z,e),d(b,t,e),s(t,R,e),s(t,w,e),s(t,N,e),s(t,y,e),s(t,X,e),d(x,t,e),s(t,q,e),s(t,J,e),s(t,K,e),d(M,t,e),s(t,tt,e),s(t,_,e),s(t,et,e),d(C,t,e),s(t,at,e),s(t,U,e),s(t,st,e),s(t,H,e),s(t,it,e),s(t,L,e),s(t,lt,e),d(j,t,e),s(t,nt,e),s(t,k,e),s(t,ot,e),d(S,t,e),s(t,rt,e),s(t,P,e),s(t,ft,e),d(I,t,e),s(t,pt,e),s(t,B,e),s(t,dt,e),s(t,E,e),s(t,mt,e),s(t,A,e),s(t,ut,e),d(F,t,e),s(t,ct,e),s(t,Q,e),gt=!0},p:It,i(t){gt||(m(h.$$.fragment,t),m($.$$.fragment,t),m(b.$$.fragment,t),m(x.$$.fragment,t),m(M.$$.fragment,t),m(C.$$.fragment,t),m(j.$$.fragment,t),m(S.$$.fragment,t),m(I.$$.fragment,t),m(F.$$.fragment,t),gt=!0)},o(t){u(h.$$.fragment,t),u($.$$.fragment,t),u(b.$$.fragment,t),u(x.$$.fragment,t),u(M.$$.fragment,t),u(C.$$.fragment,t),u(j.$$.fragment,t),u(S.$$.fragment,t),u(I.$$.fragment,t),u(F.$$.fragment,t),gt=!1},d(t){t&&(a(z),a(G),a(V),a(W),a(Y),a(T),a(O),a(v),a(Z),a(R),a(w),a(N),a(y),a(X),a(q),a(J),a(K),a(tt),a(_),a(et),a(at),a(U),a(st),a(H),a(it),a(L),a(lt),a(nt),a(k),a(ot),a(rt),a(P),a(ft),a(pt),a(B),a(dt),a(E),a(mt),a(A),a(ut),a(ct),a(Q)),a(g),c(h,t),c($,t),c(b,t),c(x,t),c(M,t),c(C,t),c(j,t),c(S,t),c(I,t),c(F,t)}}}const Vt='{"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, Audio and Video datasets","local":"image-audio-and-video-datasets","sections":[],"depth":2}],"depth":1}';function Wt(ht){return Bt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Xt extends Et{constructor(g){super(),At(this,g,Wt,zt,Pt,{})}}export{Xt as component};
