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 f,A as Bt,h as o,f as a,c as l,j as Ht,u as p,x as d,k as jt,y as Et,a as s,v as u,d as m,t as c,w as g}from"../chunks/index.fcd4cc08.js";import{C as kt}from"../chunks/CodeBlock.db16bf50.js";import{H as F,E as Ft}from"../chunks/index.9f2da87a.js";function Dt(ct){let r,Q,D,V,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>.`,z,v,O,b,$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!',Z,w,Tt='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/split-configs-server.gif" alt="split-configs-server"/>',R,y,N,x,vt="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,bt='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,wt=`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,dt,I,_t=`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.`,rt,A,Ct="We provide two guides that you can check out:",ft,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> <li><a href="./datasets-video">How to create a video dataset</a></li>',pt,E,ut,G,mt;return h=new F({props:{title:"Data files Configuration",local:"data-files-configuration",headingTag:"h1"}}),v=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, Audio and Video datasets",local:"image-audio-and-video-datasets",headingTag:"h2"}}),E=new Ft({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/datasets-data-files-configuration.md"}}),{c(){r=n("meta"),Q=i(),D=n("p"),V=i(),f(h.$$.fragment),W=i(),$=n("p"),$.textContent=gt,Y=i(),T=n("p"),T.innerHTML=ht,z=i(),f(v.$$.fragment),O=i(),b=n("p"),b.innerHTML=$t,Z=i(),w=n("p"),w.innerHTML=Tt,R=i(),f(y.$$.fragment),N=i(),x=n("p"),x.innerHTML=vt,X=i(),f(J.$$.fragment),q=i(),M=n("p"),M.innerHTML=bt,K=i(),f(_.$$.fragment),tt=i(),C=n("p"),C.textContent=wt,et=i(),U=n("p"),U.textContent=yt,at=i(),H=n("p"),H.innerHTML=xt,st=i(),f(j.$$.fragment),it=i(),k=n("p"),k.innerHTML=Jt,lt=i(),f(L.$$.fragment),nt=i(),P=n("p"),P.innerHTML=Mt,ot=i(),f(S.$$.fragment),dt=i(),I=n("p"),I.textContent=_t,rt=i(),A=n("p"),A.textContent=Ct,ft=i(),B=n("ul"),B.innerHTML=Ut,pt=i(),f(E.$$.fragment),ut=i(),G=n("p"),this.h()},l(t){const e=Bt("svelte-u9bgzb",document.head);r=o(e,"META",{name:!0,content:!0}),e.forEach(a),Q=l(t),D=o(t,"P",{}),Ht(D).forEach(a),V=l(t),p(h.$$.fragment,t),W=l(t),$=o(t,"P",{"data-svelte-h":!0}),d($)!=="svelte-1sicc2g"&&($.textContent=gt),Y=l(t),T=o(t,"P",{"data-svelte-h":!0}),d(T)!=="svelte-rffpu1"&&(T.innerHTML=ht),z=l(t),p(v.$$.fragment,t),O=l(t),b=o(t,"P",{"data-svelte-h":!0}),d(b)!=="svelte-1scij8h"&&(b.innerHTML=$t),Z=l(t),w=o(t,"P",{"data-svelte-h":!0}),d(w)!=="svelte-1p3cuco"&&(w.innerHTML=Tt),R=l(t),p(y.$$.fragment,t),N=l(t),x=o(t,"P",{"data-svelte-h":!0}),d(x)!=="svelte-1l3jl1k"&&(x.innerHTML=vt),X=l(t),p(J.$$.fragment,t),q=l(t),M=o(t,"P",{"data-svelte-h":!0}),d(M)!=="svelte-1gvdkiz"&&(M.innerHTML=bt),K=l(t),p(_.$$.fragment,t),tt=l(t),C=o(t,"P",{"data-svelte-h":!0}),d(C)!=="svelte-irk0xr"&&(C.textContent=wt),et=l(t),U=o(t,"P",{"data-svelte-h":!0}),d(U)!=="svelte-24qwdr"&&(U.textContent=yt),at=l(t),H=o(t,"P",{"data-svelte-h":!0}),d(H)!=="svelte-acor93"&&(H.innerHTML=xt),st=l(t),p(j.$$.fragment,t),it=l(t),k=o(t,"P",{"data-svelte-h":!0}),d(k)!=="svelte-1bzrp3h"&&(k.innerHTML=Jt),lt=l(t),p(L.$$.fragment,t),nt=l(t),P=o(t,"P",{"data-svelte-h":!0}),d(P)!=="svelte-13m965x"&&(P.innerHTML=Mt),ot=l(t),p(S.$$.fragment,t),dt=l(t),I=o(t,"P",{"data-svelte-h":!0}),d(I)!=="svelte-cp92ju"&&(I.textContent=_t),rt=l(t),A=o(t,"P",{"data-svelte-h":!0}),d(A)!=="svelte-1s3m8si"&&(A.textContent=Ct),ft=l(t),B=o(t,"UL",{"data-svelte-h":!0}),d(B)!=="svelte-1uc6vgs"&&(B.innerHTML=Ut),pt=l(t),p(E.$$.fragment,t),ut=l(t),G=o(t,"P",{}),Ht(G).forEach(a),this.h()},h(){jt(r,"name","hf:doc:metadata"),jt(r,"content",Gt)},m(t,e){Et(document.head,r),s(t,Q,e),s(t,D,e),s(t,V,e),u(h,t,e),s(t,W,e),s(t,$,e),s(t,Y,e),s(t,T,e),s(t,z,e),u(v,t,e),s(t,O,e),s(t,b,e),s(t,Z,e),s(t,w,e),s(t,R,e),u(y,t,e),s(t,N,e),s(t,x,e),s(t,X,e),u(J,t,e),s(t,q,e),s(t,M,e),s(t,K,e),u(_,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),u(j,t,e),s(t,it,e),s(t,k,e),s(t,lt,e),u(L,t,e),s(t,nt,e),s(t,P,e),s(t,ot,e),u(S,t,e),s(t,dt,e),s(t,I,e),s(t,rt,e),s(t,A,e),s(t,ft,e),s(t,B,e),s(t,pt,e),u(E,t,e),s(t,ut,e),s(t,G,e),mt=!0},p:Pt,i(t){mt||(m(h.$$.fragment,t),m(v.$$.fragment,t),m(y.$$.fragment,t),m(J.$$.fragment,t),m(_.$$.fragment,t),m(j.$$.fragment,t),m(L.$$.fragment,t),m(S.$$.fragment,t),m(E.$$.fragment,t),mt=!0)},o(t){c(h.$$.fragment,t),c(v.$$.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),mt=!1},d(t){t&&(a(Q),a(D),a(V),a(W),a($),a(Y),a(T),a(z),a(O),a(b),a(Z),a(w),a(R),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(dt),a(I),a(rt),a(A),a(ft),a(B),a(pt),a(ut),a(G)),a(r),g(h,t),g(v,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, Audio and Video datasets","local":"image-audio-and-video-datasets","sections":[],"depth":2}],"depth":1}';function Qt(ct){return St(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ot extends It{constructor(r){super(),At(this,r,Qt,Dt,Lt,{})}}export{Ot as component};
