1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="dd810405-9d05-491d-8954-36496508ae6d",e._sentryDebugIdIdentifier="sentry-dbid-dd810405-9d05-491d-8954-36496508ae6d")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1050],{493:(e,t,a)=>{"use strict";a.d(t,{$l:()=>u,Cc:()=>p,QL:()=>c,f7:()=>f});var n=a(29408),r=a(16743),s=a.n(r),l=a(42476),i=a(42869),o=a(21161),d=a(45944),c=function(e,t){var a=(0,d.X)();return(0,l.I)({queryKey:["getDataset",e],queryFn:function(){return a.datasets.get(e)},enabled:!!e&&"00000000-0000-0000-0000-000000000000"!==e,refetchInterval:t||!1})},u=function(e){var t,a,n=null!=(t=null==e?void 0:e.query)?t:{};n.limit||(n.limit=200);var r=(0,d.X)();return(0,l.I)({queryKey:["listDataset",null==n?void 0:n.offset,null==n?void 0:n.limit,null==n?void 0:n.datasetType,null==n?void 0:n.before,null==n?void 0:n.after,null==n?void 0:n.validationStatus],queryFn:function(){return r.datasets.list(n)},refetchOnWindowFocus:!0,refetchInterval:null==e?void 0:e.refetchInterval,enabled:null==(a=null==e?void 0:e.enabled)||a})},f=function(){var e=(0,i.jE)(),t=(0,d.X)();return(0,o.n)({mutationFn:function(e){var a=e.id;return t.datasets.delete(a)},onSuccess:function(t,a){var n=a.id;e.invalidateQueries({queryKey:["listDataset"]}),e.invalidateQueries({queryKey:["getDataset",n]})}})},p=function(){var e,t=(0,d.X)();return(0,o.n)({mutationFn:(e=(0,n.A)(s().mark(function e(a){var n,r,l,i;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.trainingFile,r=a.validationFile,l=a.request,e.next=3,t.datasets.create(n,r,l);case 3:return i=e.sent,e.abrupt("return",i);case 5:case"end":return e.stop()}},e)})),function(t){return e.apply(this,arguments)})})}},1487:(e,t,a)=>{var n=a(50206),r=a(42296),s=a(71140),l=a(11158);e.exports=function(e){return function(t){var a=r(t=l(t))?s(t):void 0,i=a?a[0]:t.charAt(0),o=a?n(a,1).join(""):t.slice(1);return i[e]()+o}}},3791:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(64154),r=a(64255);let s=function(e){var t=JSON.parse(e.sample);return(0,r.jsxs)("div",{className:"flex flex-col overflow-y-auto rounded-lg border border-marble-500 bg-marble-200 p-3","data-component":"EmbedPreview","data-source-file":"EmbedPreview.tsx",children:[(0,r.jsx)(n.EY,{styleAs:"caption","data-element":"Text","data-source-file":"EmbedPreview.tsx",children:"{"}),Object.keys(t).map(function(e,a){return(0,r.jsx)(n.EY,{styleAs:"caption",className:"whitespace-nowrap pl-3",children:'"'.concat(e,'": ').concat(JSON.stringify(t[e]),",")},a)}),(0,r.jsx)(n.EY,{styleAs:"caption","data-element":"Text","data-source-file":"EmbedPreview.tsx",children:"}"})]})}},7669:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSP:()=>G,default:()=>Q});var n=a(33464),r=a(29408),s=a(16743),l=a.n(s),i=a(22868),o=a(41695),d=a(77882),c=a(64154),u=a(59011),f=a(5254),p=a(64255),m=[{endpoint:u.Hr.embed,value:d.Cohere.DatasetType.EmbedInput,title:"Embed input",description:"A file containing text to be embedded"}],x=function(e){var t=e.handleChangeEndpoint,a=e.datasetType;return(0,p.jsxs)("section",{className:"space-y-16","data-component":"DatasetTypeStep","data-source-file":"index.tsx",children:[(0,p.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,p.jsx)(c.EY,{as:"h5","data-element":"Text","data-source-file":"index.tsx",children:"Choose a dataset type"}),(0,p.jsxs)(c.EY,{className:"max-w-[624px]","data-element":"Text","data-source-file":"index.tsx",children:["Select a"," ",(0,p.jsx)(c.gH,{href:u.sH.datasetTypes,label:"dataset type",target:"_blank","data-element":"InlineLink","data-source-file":"index.tsx"})," ","depending on what downstream task you plan to create with the data after. The uploaded dataset can be reused for that specific task only."]})]}),(0,p.jsx)("div",{className:"flex flex-col gap-4 md:flex-row md:flex-wrap",children:m.map(function(e){var n=(null==a?void 0:a.value)===e.value;return(0,p.jsxs)("article",{onClick:function(){t(e)},className:(0,u.cn)("cursor-pointer space-y-6 rounded-lg border border-marble-400 bg-marble-200 p-6 transition-colors hover:bg-marble-300 md:max-w-[240px]",{"border-green-300 bg-green-100 hover:bg-green-100":n}),children:[(0,p.jsxs)("header",{className:"flex items-center justify-between",children:[(0,p.jsx)(c.EY,{styleAs:"p-lg",children:e.title}),n&&(0,p.jsx)(f.rH,{endpoint:e.endpoint,size:"lg",color:"green"})]}),(0,p.jsx)(c.EY,{children:e.description})]},e.endpoint)})})]})},v=a(89095),h=a(80707);function b(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,n)}return a}function g(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};
1t%2?b(Object(a),!0).forEach(function(t){(0,n.A)(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):b(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}var y=function(e){var t,a,n,r=e.createRequest,s=e.createResponse,l=e.setCreateRequest,i=null==s||null==(t=s.metrics)||null==(t=t.embedData)||null==(t=t.fields)?void 0:t.sort(function(e,t){return"text"===e.name?-1:1}),d=null==s?void 0:s.datasetParts,f=(0,o.useState)(null!=(a=null==i?void 0:i.reduce(function(e,t){return t.name&&t.count&&e.push({name:t.name,count:t.count,status:"text"===t.name?"keep":"optional"}),e},[]))?a:[]),m=f[0],x=f[1];if(!i||!d||!(null!=r&&r.name))return(0,p.jsx)(c.EY,{className:"text-danger-500",children:"Something went wrong"});var v=function(e,t){x(m.map(function(a){return a.name===e?g(g({},a),{},{status:t}):a}));var a=[],n=[];m.map(function(e){"keep"===e.status&&a.push(e.name),"optional"===e.status&&n.push(e.name)}),l(g(g({},r),{},{keepFields:a,optionalFields:n}))},h=null!=(n=d[0].numRows)?n:1;return(0,p.jsxs)("section",{className:"w-full max-w-3xl space-y-10","data-component":"MetadataStep","data-source-file":"index.tsx",children:[(0,p.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,p.jsx)(c.EY,{as:"h5","data-element":"Text","data-source-file":"index.tsx",children:"Choose metadata"}),(0,p.jsx)(c.EY,{"data-element":"Text","data-source-file":"index.tsx",children:"These are the metadata (keys or column headers) found in your file. Select fields based on what you would like to preserve. If you donât make a selection, we only keep the âtextâ key or header by default."}),(0,p.jsxs)(c.EY,{"data-element":"Text","data-source-file":"index.tsx",children:["Learn more about"," ",(0,p.jsx)(c.gH,{href:u.sH.datasetsConstructingEmbedJobs,label:"Optional and Keep fields",target:"_blank","data-element":"InlineLink","data-source-file":"index.tsx"})]})]}),(0,p.jsx)("div",{className:"flex flex-col gap-y-3",children:(0,p.jsxs)("div",{role:"table",children:[(0,p.jsxs)("div",{className:"grid grid-cols-3 items-center divide-x divide-green-200 rounded-t-lg border-x border-t border-green-200 bg-green-100 text-volcanic-700",children:[(0,p.jsx)(j,{"data-element":"TableHeaderCell","data-source-file":"index.tsx",children:"Metadata"}),(0,p.jsx)(j,{"data-element":"TableHeaderCell","data-source-file":"index.tsx",children:"Present In"}),(0,p.jsx)(j,{hasTooltip:!0,"data-element":"TableHeaderCell","data-source-file":"index.tsx",children:"Field"})]}),(0,p.jsx)("div",{className:"rounded-b-lg border-x border-b border-green-200 bg-green-50",children:m.map(function(e,t){var a;return(0,p.jsxs)("div",{className:"grid grid-cols-3 divide-x divide-green-200 border-t border-green-200",children:[(0,p.jsxs)(c.EY,{className:"p-3",children:[e.name,"text"===e.name&&(0,p.jsx)("span",{className:"pl-2 font-code text-label uppercase text-volcanic-700",children:"(Required)"})]}),(0,p.jsx)(c.EY,{className:"p-3 text-volcanic-700",children:(a=e.count)===h?"All examples":"".concat((0,u.HY)(a)," ").concat((0,u.td)("example",a)," (").concat((0,u.Nj)(a/h),")")}),(0,p.jsx)("div",{className:"px-3 py-2",children:(0,p.jsx)(w,{value:e.status,disabled:"text"===e.name,disableKeep:e.count!==h,onChange:function(t){return v(e.name,t)}})})]},t)})})]})})]})},j=function(e){var t=e.children,a=e.hasTooltip;return(0,p.jsxs)(c.EY,{role:"columnheader",styleAs:"label",className:"flex items-center gap-x-2 p-3","data-element":"Text","data-component":"TableHeaderCell","data-source-file":"index.tsx",children:[t,void 0!==a&&a&&(0,p.jsx)(c.m_,{label:(0,p.jsxs)(c.EY,{className:"flex max-w-card-sm flex-col text-volcanic-700",children:[(0,p.jsx)("span",{className:"font-medium",children:"Keep fields"}),"Validation will expect this metadata to have a valid entry for every row or lines.",(0,p.jsx)("br",{}),(0,p.jsx)("br",{}),(0,p.jsx)("span",{className:"font-medium",children:"Optional fields"}),"If this metadata is empty for certain rows or lines, there will be no validation error."]}),showOutline:!1,iconClassName:"text-green-700",hover:!0})]})}
1,w=function(e){var t=e.value,a=e.disabled,n=e.onChange,r=e.disableKeep,s=["keep","optional","drop"];return(0,p.jsx)(v.WF,{onChange:n,as:"div",className:"relative cursor-pointer text-volcanic-900",disabled:a,"data-element":"Listbox","data-component":"StatusDropdown","data-source-file":"index.tsx",children:function(e){var n=e.open;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(v.WF.Button,{className:(0,u.cn)("flex w-full items-center justify-between rounded-t-lg border-x border-t border-marble-500 bg-marble-100 px-3 py-2.5",{"rounded-b-lg border-b":!n,"pb-[11px]":n,"cursor-not-allowed bg-marble-300 text-volcanic-700":a}),children:[(0,p.jsx)(c.EY,{children:(0,h.capitalize)(t)}),!a&&(0,p.jsx)(f.In,{name:n?"chevron-up":"chevron-down",className:"text-volcanic-700"})]}),(0,p.jsx)(v.WF.Options,{className:(0,u.cn)("rounded-b-lg border-x border-b border-marble-500 bg-marble-100","absolute left-0 z-dropdown w-full"),children:s.map(function(e,t){var a=r&&"keep"===e;return(0,p.jsx)(v.WF.Option,{value:e,disabled:a,className:(0,u.cn)("px-3",{"cursor-not-allowed text-volcanic-700":a,"hover:bg-green-50 hover:font-medium hover:text-green-700":!a}),children:(0,p.jsx)(c.EY,{className:"border-t border-marble-400 py-3",children:(0,h.capitalize)(e)})},t)})})]})}})},N=a(3259),E=a(3791),F=a(49614),O=function(e){var t=e.datasetType,a=e.dryRunResults,n=e.trainingFile,r=e.validationFile,s=(0,o.useState)(0),l=s[0],i=s[1],d=Array.isArray(null==a?void 0:a.datasetParts)?a.datasetParts.sort(function(e){return"eval"===e.partKind?1:-1}):[void 0,void 0],u=(0,N.A)(d,2),f=u[0],m=u[1];if(!a||!t||!n||!f)return(0,p.jsx)(c.EY,{className:"text-danger-500",children:"Something went wrong"});var x=(0,F.r)(a,t.value,"train",n),v=(0,F.r)(a,t.value,"eval",r),h=void 0!==v;return(0,p.jsxs)("section",{className:"w-full max-w-3xl space-y-6","data-component":"PreviewStep","data-source-file":"index.tsx",children:[(0,p.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,p.jsxs)(c.EY,{as:"h5","data-element":"Text","data-source-file":"index.tsx",children:["Preview your ",h?"files":"file"]}),(0,p.jsxs)(c.EY,{"data-element":"Text","data-source-file":"index.tsx",children:["Here are the details weâve gathered from your ",h?"files":"file",". Ensure this is correct before you start uploading. Upon completion, youâll get an email when your dataset is ready to use. Weâll provide you a Dataset ID to call it in our API."]})]}),h?(0,p.jsxs)(c.tU,{panelsClassName:"pt-6",tabs:["Training","Validation"],onChange:function(e){i(e)},selectedIndex:l,children:[(0,p.jsx)(S,{datasetType:t,dryRunResults:a,partSamples:f.samples,tableData:x}),(0,p.jsx)(S,{datasetType:t,dryRunResults:a,partSamples:null==m?void 0:m.samples,tableData:v})]}):(0,p.jsx)(S,{datasetType:t,dryRunResults:a,partSamples:f.samples,tableData:x})]})},S=function(e){var t=e.datasetType,a=e.partSamples,n=e.tableData,r=null==t?void 0:t.endpoint,s=(0,o.useState)(0),l=s[0],i=s[1],d=r===u.Hr.embed?"Line":"";return(0,p.jsxs)(p.Fragment,{children:[n&&(0,p.jsx)("div",{className:"flex flex-col gap-y-2",children:(0,p.jsxs)("div",{className:"space-y-3 divide-y divide-green-200 rounded-lg border border-green-200 bg-green-50 px-3 py-4",children:[(0,p.jsx)("div",{className:"grid grid-cols-".concat(n.length," flex items-end"),children:n.map(function(e,t){return(0,p.jsx)(c.EY,{styleAs:"label",className:"pr-8 text-volcanic-700",children:e.header},t)})}),(0,p.jsx)("div",{className:"grid grid-cols-".concat(n.length," pt-6"),children:n.map(function(e,t){return(0,p.jsx)(c.EY,{children:e.value},t)})})]})}),a&&(0,p.jsxs)("div",{className:"flex flex-col space-y-6 pt-4",children:[(0,p.jsx)(c.EY,{children:"Below are the first 3 samples of your file. This is how the model will ingest your data when you use the dataset. If your entries are not separating correctly, consider reformatting your file according to the examples in the previous step."}),(0,p.jsx)(c.tU,{panelsClassName:"pt-6 lg:pt-6",tabs:["".concat(d," 1"),"".concat(d," 2"),"".concat(d," 3")],onChange:function(e){i(e)},selectedIndex:l,children:a.slice(0,3).map(function(e,a){return(null==t?void 0:t.endpoint)===u.Hr.embed?(0,p.jsx)(E.A,{sample:e},a):void 0})})]})]})},k=a(77068),T=a.n(k),C=a(36898),D=a(67489),P=function(e){var t=e.file,a=e.allowedFiles,n=e.isPending,r=e.onChange;return t?n?(0,p.jsxs)("div",{className:"flex flex-col gap-y-3",children:[(0,p.jsx)(A,{file:t}),(0,p.jsx)(D.A,{theme:"green"})]}):(0,p.jsxs)("article",{className:"flex flex-col gap-0.5 rounded-lg border border-volcanic-500 p-3",children:[(0,p.jsx)(c.EY,{styleAs:"label",children:"File"}),(0,p.jsx)(A,{file:t,onRemove:function(){r(void 0)}})]}):(0,p.jsx)(c.iu,{subLabel:"".concat(a.join(" or ")," - Max 2 GB"),onChange:function(e){var t;r(null==(t=e.target.files)?void 0:t[0])},multiple:!1,accept:a,theme:"green","data-element":"DragDropFileInput","data-component":"DropFile","data-source-file":"DropFile.tsx"})},A=function(e){var t=e.file,a=e.onRemove;return(0,p.jsxs)("div",{className:"flex items-center justify-between","data-component":"FilePreview","data-source-file":"DropFile.tsx",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[(0,p.jsx)(f.In,{name:"file",kind:"outline","data-element":"Icon","data-source-file":"DropFile.tsx"}),(0,p.jsx)(c.EY,{"data-element":"Text","data-source-file":"DropFile.tsx",children:t.name}),(0,p.jsxs)(c.EY,{styleAs:"caption",className:"text-volcanic-700","data-element":"Text","data-source-file":"DropFile.tsx",children:["(",(0,u.v7)(t.size),")"]})]}),a&&(0,p.jsx)(c.$n,{onClick:a,startIcon:"close",kind:"secondary",animate:!1})]})},Y="embed",I=function(e){var t=e.requirements,a=e.validationWarning,n=e.unexpectedWarnings;return(0,p.jsxs)("ul",{className:"space-y-4","data-component":"RequirementsList","data-source-file":"RequirementsList.tsx",children:[t.map(function(e,t){var a=e.display,n=e.description,r=e.errorMessages;return(0,p.jsxs)(c.EY,{as:"li",className:"flex items-baseline",children:[("default"===a||"pending"===e.display)&&(0,p.jsx)("div",{className:(0,u.cn)("mr-3 h-[9px] w-[9px] flex-shrink-0 rounded-full border",{"border-volcanic-600":"pending"===a,"border-volcanic-900":"default"===a})}),"invalid"===a&&(0,p.jsx)("span",{className:"mr-3 text-danger-500",children:(0,p.jsx)(f.In,{name:"close",size:"sm"})}),"valid"===a&&(0,p.jsx)("span",{className:"mr-3 text-success-500",children:(0,p.jsx)(f.In,{name:"check-mark",size:"sm"})}),(0,p.jsxs)("div",{children:[(0,p.jsx)(c.EY,{className:(0,u.cn)({"text-volcanic-600":"pending"===a}),children:n}),r&&r.length>0&&(0,p.jsx)(c.lZ,{theme:"error",className:"mt-3 max-h-[140px] overflow-y-auto",size:"sm",children:r.map(function(e,t){return(0,p.jsx)(o.Fragment,{children:(0,h.capitalize)(e)},t)})})]})]},t)}),a&&a,n&&(0,p.jsx)(c.lZ,{theme:"neutral",className:"mt-3 max-h-[140px] overflow-y-auto",size:"sm",children:n.map(function(e,t){return(0,p.jsx)(o.Fragment,{children:(0,h.capitalize)(e)},t)})})]})};function R(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,n)}return a}var L=function(e,t){var a=t.match(e);return a?a[1]:null},q=function(e){var t=e.type,a=e.validationInfo,r=[{regex:/dataset has 0 valid eval rows. dataset will be auto-split/,cleaned:function(e){return(0,p.jsx)(p.Fragment,{children:"Validation dataset was not provided; dataset will be auto-split."})}},{regex:/dataset has (\d+) duplicate rows/,cleaned:function(e){return(0,p.jsxs)(p.Fragment,{children:["We will remove ",L(/dataset has (\d+) duplicate rows/,e)," duplicate examples."]})}},{regex:/dataset has (\d+) rows with too many tokens/,cleaned:function(e){return(0,p.jsxs)(p.Fragment,{children:["We will remove ",L(/dataset has (\d+) rows with too many tokens/,e)," rows that are over the maximum sequence length."]})}},{regex:/^train dataset has conversations with too many tokens/,cleaned:function(e){var t=e.match(/train dataset has conversations with too many tokens. conversation number: number of turns with too many tokens is as follows, (.*)/),a=new File([JSON.stringify(function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};
1t%2?R(Object(a),!0).forEach(function(t){(0,n.A)(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):R(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}({warningMessage:e},t&&{conversationsOverTokenLimit:t[1].split(", ").map(function(e){return e.split(":1")[0]})}))],"conversation.txt",{type:"text/plain"}),r=URL.createObjectURL(a);return(0,p.jsxs)(p.Fragment,{children:["We will remove turns that are over the maximum sequence length."," ",(0,p.jsx)(c.gH,{label:(0,p.jsx)("a",{href:r,target:"_blank",rel:"noreferrer noopener",children:"See the list of turns"}),endIcon:"arrow-up-right",target:"_blank",href:r})]})}},{regex:/dataset has (\d+) rows with invalid encoding (not utf-8)/,cleaned:function(e){return(0,p.jsxs)(p.Fragment,{children:["We will remove"," ",L(/dataset has (\d+) rows with invalid encoding (not utf-8)/,e)," labels with invalid encoding."]})}}],s={embed:[{description:"You'll need your data in a .csv or .jsonl file. For the formats of the .csv and .jsonl file, refer to the diagrams below.",display:"default",regTest:/file format:/},{description:'Each row or line must contain a "text" value. For .csv, there must be only one column header named âtextâ. For .jsonl, each row or line must contain a {âtextâ: âstringâ} key-value pair.',display:"default",regTest:/missing required field text:/}]}[t],l=[],i=[],o=[];if(!a)return{requirements:s};var d=a.validationErrors,u=a.validationStatus,f=a.validationWarnings;if(s.forEach(function(e){e.errorMessages=[],"validated"===u?e.display="valid":e.display="pending"}),d)return d.map(function(e){var t=s.find(function(t){var a;return null==(a=t.regTest)?void 0:a.test(e)});t?(t.display="invalid",t.errorMessages||(t.errorMessages=[]),t.errorMessages.push((0,h.capitalize)(e))):l.push(e)}),{requirements:s,unexpectedErrors:l};if(f){var m=f.map(function(e){var t=r.find(function(t){return t.regex.test(e)});if(t)return t.cleaned(e);i.push(e)}).filter(function(e){return void 0!==e});m&&o.push((0,p.jsx)(c.lZ,{theme:"neutral",className:"mt-3 max-h-[140px] overflow-y-auto",size:"sm",children:m}))}return{requirements:s,unexpectedErrors:l,warningMessage:o.length>0?o:void 0,unexpectedWarnings:i.length>0?i:void 0}},_=["url","title","text"],H=[["https://en.wikipedia.org/wiki?curid=69407798","Voronoi","In mathematics, a Voronoi diagram is a partition of a plane into regions close to each of a given set of objects."],["https://en.wikipedia.org/wiki?curid=3524766","A tessellation","A tessellation or tiling is the covering of a surface, often a plane, using one or more geometric shapes, called tiles, with no overlaps and no gaps."]],B=(0,p.jsxs)(c.EY,{as:"div",className:"overflow-hidden rounded-lg border border-green-200 bg-green-50",children:[(0,p.jsx)("div",{className:"grid grid-cols-3 border-b border-green-200 bg-green-100",children:_.map(function(e,t){return(0,p.jsx)("div",{className:(0,u.cn)("p-2 uppercase text-volcanic-700",{"border-r border-green-200":t<_.length-1}),children:e},t)})}),H.map(function(e,t){return(0,p.jsxs)("div",{className:(0,u.cn)("grid grid-cols-3",{"border-b border-green-200":t<H.length-1}),children:[(0,p.jsxs)("div",{className:"flex border-r border-green-200",children:[(0,p.jsx)("div",{className:"p-2 text-green-700",children:t+1}),(0,p.jsx)("div",{className:"break-all p-2",children:e[0]})]}),(0,p.jsx)("div",{className:"border-r border-green-200 p-2",children:e[1]}),(0,p.jsx)("div",{className:"p-2",children:e[2]})]},t)})]}),M=function(){return(0,p.jsxs)("div",{className:"flex flex-col gap-6","data-component":"EmbedJobFileFormat","data-source-file":"EmbedJob.tsx",children:[(0,p.jsxs)("div",{className:"space-y-3",children:[B,(0,p.jsx)(c.EY,{styleAs:"caption",className:"text-volcanic-700","data-element":"Text","data-source-file":"EmbedJob.tsx",children:"CSV format"})]}),(0,p.jsxs)("div",{className:"space-y-3",children:[(0,p.jsx)("div",{className:"overflow-auto rounded-lg border border-green-200 bg-green-50 p-2",children:(0,p.jsx)(c.EY,{styleAs:"caption",as:"pre","data-element":"Text","data-source-file":"EmbedJob.tsx",children:'{\n "url": "https://en.wikipedia.org/wiki?curid=69407798",\n "title": "Voronoi",\n "text": "In mathematics, a Voronoi diagram is a partition of a plane into regi
1ons close to each of a given set of objects.â\n}\n\n{\n "url": "https://en.wikipedia.org/wiki?curid=3524766",\n "title": "Tessellation",\n "text": "A tessellation or tiling is the covering of a surface, often a plane, using one or more geometric shapes, called tiles, with no overlaps and no gaps.â\n}'})}),(0,p.jsx)(c.EY,{styleAs:"caption",className:"text-volcanic-700","data-element":"Text","data-source-file":"EmbedJob.tsx",children:"JSONL format"})]})]})},V=a(98506);let W=function(e){var t=e.options,a=e.value,n=e.onChange,r=e.disabled,s=void 0!==r&&r;return(0,p.jsx)(V.z6,{value:a,onChange:n,className:(0,u.cn)("flex items-center gap-6",{"cursor-not-allowed":s}),disabled:s,"data-element":"Radio","data-component":"RadioGroup","data-source-file":"RadioGroup.tsx",children:t.map(function(e){return(0,p.jsx)(V.z6.Option,{value:e.value,children:function(t){var a=t.checked;return(0,p.jsxs)("div",{className:(0,u.cn)("flex cursor-pointer items-center gap-2",{"cursor-not-allowed":s}),children:[(0,p.jsx)("div",{className:(0,u.cn)("relative h-4 w-4 flex-shrink-0 rounded-full border border-marble-400 bg-white",{"border-green-500":a}),children:(0,p.jsx)("div",{className:(0,u.cn)("h-2 w-2 rounded-full bg-white","absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform","transition-colors duration-200 ease-in-out",{"bg-green-500":a})})}),(0,p.jsx)(c.EY,{children:e.label})]})}},e.value)})})};var z=a(493),K=[{label:"Training only",value:"single"},{label:"Training and Validation",value:"multiple"}],U=function(e){var t,a=e.hasEvalFile,n=e.datasetType,s=e.trainingFile,i=e.validationFile,d=e.datasetName,f=e.dryRunResults,m=e.setDryRunResults,x=e.setDatasetName,v=e.setHasEvalFile,h=e.setDisableNext,b=e.setCreateRequest,g=e.onChangeTrainingFile,y=e.onChangeValidationFile,j=(0,z.Cc)(),w=j.mutateAsync,N=j.error,E=((null==n||n.endpoint)===u.Hr.embed,{acceptedFileTypes:[".csv",".jsonl"],type:Y}),F=E.type,O=E.acceptedFileTypes,S=F===Y,k=(0,o.useState)(!1),D=k[0],A=k[1],R=(0,o.useState)(q({type:F,validationInfo:null!=f?f:void 0})),L=R[0],_=R[1],H=(0,o.useState)([]),B=H[0],V=H[1];(0,o.useEffect)(function(){if(s&&!a||a&&i&&s){!f&&d&&J();return}U()},[s,i,a,n]);var U=function(){m(void 0),V([]),h(!0),_(q({type:F,validationInfo:void 0}))},J=(t=(0,r.A)(l().mark(function e(){var t,r,o,c;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s){e.next=2;break}return e.abrupt("return");case 2:return t={name:d,type:null==n?void 0:n.value,dryRun:!0},(null==n?void 0:n.endpoint)===u.Hr.embed&&(t.optionalFields="*"),b(t),e.prev=5,A(!0),e.next=9,w({trainingFile:s,validationFile:a?i:void 0,request:t});case 9:m(o=e.sent),_(c=q({type:F,validationInfo:o})),V(null!=(r=c.unexpectedErrors)?r:[]),h("validated"!==o.validationStatus),e.next=22;break;case 17:e.prev=17,e.t0=e.catch(5),U(),V([(0,C._)(e.t0)?e.t0.message:"There was an error validating your file"]),console.error(e.t0);case 22:return e.prev=22,A(!1),e.finish(22);case 25:case"end":return e.stop()}},e,null,[[5,17,22,25]])})),function(){return t.apply(this,arguments)}),X=(0,o.useMemo)(function(){return"embed"===F?M:null},[F]);return(0,p.jsxs)("section",{className:"w-full space-y-16","data-component":"SelectFilesStep","data-source-file":"index.tsx",children:[(0,p.jsxs)("div",{className:"flex w-full flex-col gap-y-2",children:[(0,p.jsxs)(c.EY,{as:"h5","data-element":"Text","data-source-file":"index.tsx",children:["Select and validate your ",null==n?void 0:n.title," files"]}),(0,p.jsx)(c.EY,{className:"max-w-[624px]","data-element":"Text","data-source-file":"index.tsx",children:S?"Select a file for your Embed input dataset. When the dataset is created, you can easily launch an Embed job with it.":"Select a training file (and optionally a separate validation file) for your\n ".concat(null==n?void 0:n.title,"\n dataset. When the dataset is created, you can easily create multiple\n ").concat(T()(null==n?void 0:n.endpoint)," fine-tunes with it.")})]}),(0,p.jsxs)("div",{className:"flex w-full flex-col space-y-8 divide-marble-400 md:flex-row md:divide-x",children:[(0,p.jsxs)("div",{className:"flex flex-col space-y-6 md:w-1/2 md:pr-7",children:[!S&&(0,p.jsxs)("article",{className:"space-y-2",children:[(0,p.jsx)(c.EY,{styleAs:"overline",className:"text-volcanic-700",children:"FILE/S"}
1),(0,p.jsx)(W,{options:K,value:a?"multiple":"single",onChange:function(e){"multiple"===e?(v(!0),m()):v(!1)}})]}),(0,p.jsxs)("section",{className:"space-y-2",children:[(0,p.jsx)(c.EY,{styleAs:"overline",className:"text-volcanic-900","data-element":"Text","data-source-file":"index.tsx",children:"TRAINING FILE"}),(0,p.jsx)(P,{file:s,onChange:function(e){g(e),e?x(e.name.replace(/\.[^/.]+$/,"")):x("")},allowedFiles:O,isPending:D,"data-element":"DropFile","data-source-file":"index.tsx"})]}),a&&!S&&(0,p.jsxs)("section",{className:"space-y-2",children:[(0,p.jsxs)(c.EY,{styleAs:"overline",as:"div",className:"flex items-center gap-x-2 text-volcanic-900",children:["VALIDATION FILE",(0,p.jsx)(c.m_,{label:(0,p.jsxs)("div",{className:"flex flex-col gap-y-2",children:[(0,p.jsx)(c.EY,{className:"font-medium",children:"Validation sets"}),(0,p.jsx)(c.EY,{children:"Model performance is measured by metrics based on validation data. You may specify a validation set, else the training set will be automatically split to create one."})]}),hover:!0})]}),(0,p.jsx)(P,{file:i,onChange:y,allowedFiles:O,isPending:D})]}),(B&&B.length>0||N)&&(0,p.jsx)(c.lZ,{theme:"error",children:N?T()(N.message):B.map(function(e){return T()(e)}).join(". ")}),s&&(0,p.jsxs)("div",{className:"space-y-2",children:[(0,p.jsx)(c.EY,{styleAs:"overline",className:"text-volcanic-700",children:"DATASET NAME"}),(0,p.jsx)(c.pd,{required:!0,label:"Name",placeholder:"Enter a name for your dataset",className:"w-full",value:d,onChange:function(e){return x(e.target.value)},disabled:D}),(0,p.jsxs)(c.EY,{styleAs:"caption",className:"text-volcanic-700",children:["Give your dataset a name so you can easily find it under"," ",(0,p.jsx)(c.gH,{href:"/datasets",label:"Datasets",target:"_blank",theme:"volcanic",className:"text-volcanic-700"}),"."]})]})]}),(0,p.jsxs)("div",{className:"flex flex-col space-y-6 md:w-1/2 md:pl-7",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)(c.EY,{styleAs:"overline",className:"mb-2 text-volcanic-700","data-element":"Text","data-source-file":"index.tsx",children:"Data requirements"}),(0,p.jsx)(c.EY,{"data-element":"Text","data-source-file":"index.tsx",children:"embed"===F?"To upload a dataset for an an embed job, we need text-based data that satisfy the following requirements:":"To create a ".concat(T()(F)," dataset, your file").concat(a?"s":""," must satisfy all requirements:")})]}),L&&(0,p.jsx)(I,{requirements:L.requirements,unexpectedWarnings:L.unexpectedWarnings,validationWarning:L.warningMessage}),(0,p.jsx)("div",{className:"pt-4",children:X&&(0,p.jsx)(X,{})})]})]})]})},J=a(53546);function X(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,n)}return a}function $(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?X(Object(a),!0).forEach(function(t){(0,n.A)(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):X(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}var G=!0;let Q=function(){var e,t=(0,o.useState)(0),a=t[0],n=t[1],s=(0,o.useState)(!0),f=s[0],m=s[1],v=(0,o.useState)(),h=v[0],b=v[1],g=(0,o.useState)(!1),j=g[0],w=g[1],N=(0,o.useState)(),E=N[0],F=N[1],S=(0,o.useState)(),k=S[0],T=S[1],C=(0,o.useState)(""),D=C[0],P=C[1],A=(0,o.useState)(),Y=A[0],I=A[1],R=(0,o.useState)(),L=R[0],q=R[1],_=(0,o.useMemo)(function(){var e=(null==h?void 0:h.value)===d.Cohere.DatasetType.EmbedInput,t=[{label:"Dataset type",nextButtonLabel:"Select files",activeLabel:"Choose a dataset type",disableNext:!0},{label:"Files",nextButtonLabel:"Preview data",activeLabel:"Select files",disableNext:!0},{label:"Preview",nextButtonLabel:"Start uploading",activeLabel:"Preview file",disableNext:!1}];return e&&(t[1]={label:"File",nextButtonLabel:"Specify metadata",activeLabel:"Select file",disableNext:!0},t.splice(2,0,{label:"Metadata",nextButtonLabel:"Preview data",activeLabel:"Specify metadata",disableNext:!1})),t},[h]);
1(0,o.useEffect)(function(){0===a?m(!h):m(!E||j&&!k||(null==L?void 0:L.validationStatus)!=="validated"||!Y)},[a,h,j,E,k,Y,L]);var H=(0,z.Cc)().mutateAsync,B=(0,i.useRouter)(),M=(e=(0,r.A)(l().mark(function e(){var t,a,n;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(!E||!h)){e.next=2;break}return e.abrupt("return");case 2:return t=h.value,a=$($({},Y),{},{type:t,dryRun:!1,name:D}),e.prev=4,e.next=7,H({trainingFile:E,validationFile:j?k:void 0,request:a});case 7:var r;(n=e.sent).id&&B.push((r=n.id,"/datasets/".concat(r))),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),console.error(e.t0);case 14:case"end":return e.stop()}},e,null,[[4,11]])})),function(){return e.apply(this,arguments)}),V=function(e){"back"===e?a>0&&n(a-1):"next"===e&&(a===_.length-1?(m(!0),M()):n(a+1))};return(0,p.jsxs)(J.Ay,{title:"Create a Dataset",mainClassName:"overflow-y-auto","data-element":"Page","data-component":"CreateDatasetPage","data-source-file":"create.tsx",children:[(0,p.jsx)(J.zY,{"data-element":"PageHeader","data-source-file":"create.tsx",children:(0,p.jsx)(c.$n,{className:"w-fit",label:"Back to Datasets",kind:"secondary",href:"/datasets",startIcon:"arrow-left","data-element":"Button","data-source-file":"create.tsx"})}),(0,p.jsx)(J.PE,{"data-element":"PageMain","data-source-file":"create.tsx",children:(0,p.jsx)("div",{className:"flex flex-col gap-y-8 md:gap-y-12",children:(0,p.jsxs)("div",{className:(0,u.cn)("flex flex-col","items-center md:items-start","gap-y-5 pb-6 md:gap-y-12 md:pb-5"),children:[(0,p.jsx)(c.EY,{as:"h3","data-element":"Text","data-source-file":"create.tsx",children:"Upload a dataset"}),(0,p.jsx)("div",{className:"flex w-full border-b border-marble-200 pb-4",children:(0,p.jsx)(c.fH,{currentStep:a,steps:_.map(function(e){return e.label}),labelShowState:"always",className:"justify-start",activeLabels:_.map(function(e){return{label:e.label,activeLabel:e.activeLabel}}),"data-element":"StepTracker","data-source-file":"create.tsx"})}),0===a&&(0,p.jsx)(x,{handleChangeEndpoint:function(e){q(void 0),F(void 0),T(void 0),P(""),I(void 0),w(!1),b(e)},datasetType:h}),1===a&&h&&(0,p.jsx)(U,{hasEvalFile:j,setHasEvalFile:w,datasetType:h,onChangeTrainingFile:F,onChangeValidationFile:T,trainingFile:E,validationFile:k,datasetName:D,setDatasetName:P,dryRunResults:L,setDryRunResults:q,setDisableNext:m,setCreateRequest:I}),2===a&&(null==h?void 0:h.value)===d.Cohere.DatasetType.EmbedInput&&(0,p.jsx)(y,{createRequest:Y,createResponse:L,setCreateRequest:I}),a===_.length-1&&(0,p.jsx)(O,{datasetType:h,dryRunResults:L,trainingFile:E,validationFile:k})]})})}),(0,p.jsx)(J.FM,{"data-element":"PageFooter","data-source-file":"create.tsx",children:(0,p.jsxs)("div",{className:"flex w-full flex-col-reverse items-center justify-center gap-y-6 md:flex-row md:justify-between",children:[(0,p.jsx)(c.$n,{className:(0,u.cn)({"hidden md:invisible md:block":0===a}),kind:"secondary",label:"Back",onClick:function(){return V("back")},"data-element":"Button","data-source-file":"create.tsx"}),(0,p.jsx)(c.$n,{kind:"primary",label:_[a].nextButtonLabel,disabled:f,onClick:function(){return V("next")},splitIcon:"arrow-right",className:"w-full md:w-fit","data-element":"Button","data-source-file":"create.tsx"})]})})]})}},11158:(e,t,a)=>{var n=a(50686);e.exports=function(e){return null==e?"":n(e)}},27854:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},33260:e=>{e.exports=function(e){return e.split("")}},35315:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/datasets/create",function(){return a(7669)}])},42296:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},45944:(e,t,a)=>{"use strict";a.d(t,{X:()=>d,Yp:()=>c});var n=a(29408),r=a(16743),s=a.n(r),l=a(1015),i=a(77882),o=a(8500),d=function(){var e,t=(0,l.Q)();return new i.CohereClient({environment:o._.NEXT_PUBLIC_COHERE_API_URL,clientName:"dashboard",token:(e=(0,n.A)(s().mark(function e(){var a;return s().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getOrCreateDefaultAPIKey({canReturnProductionKey:!0});case 2:return a=e.sent.rawKey,e.abrupt("return",a);case 5:case"end":return e.stop()}},e)})),function(){return e.apply(this,arguments)})})},c=function(e){if(!e)return null;if(e instanceof i.CohereError){var t=e.body;return t&&"object"==typeof t&&"message"in t&&"string"==typeof t.message?t.message:e.message}return"Something went wrong. Please try again later."}},49614:(e,t,a)=>{"use strict";a.d(t,{S:()=>r,r:()=>s});var n=a(77882),r=function(e){switch(e){case n.Cohere.DatasetValidationStatus.Validated:case n.Cohere.DatasetValidationStatus.Skipped:return"Ready";case n.Cohere.DatasetValidationStatus.Queued:case n.Cohere.DatasetValidationStatus.Processing:return"Uploading";case n.Cohere.DatasetValidationStatus.Failed:return"Failed";default:return e}},s=function(e,t,a,n){if(Array.isArray(null==e?void 0:e.datasetParts)){var r,s,l,i="train"===a?e.datasetParts[0]:e.datasetParts.find(function(e){return"eval"===e.partKind}),o=null!=(r=null==i?void 0:i.name)?r:null==n?void 0:n.name;if(i&&o)if("embed-input"!==t)return;else{if(!n)return;return[{header:"Dataset Type",value:"Embed input"},{header:"lines of texts",value:null!=(s=i.numRows)?s:0},{header:"size",value:"".concat((1e-6*n.size).toFixed(2)," MB")}
1,{header:"File",value:(null!=(l=i.name)?l:n.name).split(".")[0]}]}}}},50206:(e,t,a)=>{var n=a(93252);e.exports=function(e,t,a){var r=e.length;return a=void 0===a?r:a,!t&&a>=r?e:n(e,t,a)}},50686:(e,t,a)=>{var n=a(52387),r=a(83898),s=a(65148),l=a(80014),i=1/0,o=n?n.prototype:void 0,d=o?o.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(s(t))return r(t,e)+"";if(l(t))return d?d.call(t):"";var a=t+"";return"0"==a&&1/t==-i?"-0":a}},52387:(e,t,a)=>{e.exports=a(63735).Symbol},61204:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},62718:(e,t,a)=>{var n=a(52387),r=a(76671),s=a(61204),l=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?r(e):s(e)}},62964:(e,t,a)=>{e.exports=a(1487)("toUpperCase")},63735:(e,t,a)=>{var n=a(78474),r="object"==typeof self&&self&&self.Object===Object&&self;e.exports=n||r||Function("return this")()},65148:e=>{e.exports=Array.isArray},67489:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});var n=a(59011),r=a(64255);let s=function(e){var t=e.theme,a=void 0===t?"coral":t;return(0,r.jsx)("div",{className:(0,n.cn)("relative mx-auto my-0 w-full rounded-full bg-marble-300 p-0.5",'before:contents-[""] before:absolute before:rounded-full'),"data-component":"LoadingBar","data-source-file":"LoadingBar.tsx",children:(0,r.jsx)("div",{className:(0,n.cn)("animate-borealisBar","absolute bottom-0 left-0 right-full top-0 w-0 rounded-full",{"bg-coral-300":"coral"===a,"bg-green-300":"green"===a})})})}},71140:(e,t,a)=>{var n=a(33260),r=a(42296),s=a(89204);e.exports=function(e){return r(e)?s(e):n(e)}},76671:(e,t,a)=>{var n=a(52387),r=Object.prototype,s=r.hasOwnProperty,l=r.toString,i=n?n.toStringTag:void 0;e.exports=function(e){var t=s.call(e,i),a=e[i];try{e[i]=void 0;var n=!0}catch(e){}var r=l.call(e);return n&&(t?e[i]=a:delete e[i]),r}},77068:(e,t,a)=>{var n=a(11158),r=a(62964);e.exports=function(e){return r(n(e).toLowerCase())}},78474:(e,t,a)=>{e.exports="object"==typeof a.g&&a.g&&a.g.Object===Object&&a.g},80014:(e,t,a)=>{var n=a(62718),r=a(27854);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==n(e)}},83898:e=>{e.exports=function(e,t){for(var a=-1,n=null==e?0:e.length,r=Array(n);++a<n;)r[a]=t(e[a],a,e);return r}},89204:e=>{var t="\\ud800-\\udfff",a="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",r="[^"+t+"]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",l="[\\ud800-\\udbff][\\udc00-\\udfff]",i="(?:"+a+"|"+n+")?",o="[\\ufe0e\\ufe0f]?",d="(?:\\u200d(?:"+[r,s,l].join("|")+")"+o+i+")*",c=RegExp(n+"(?="+n+")|"+("(?:"+[r+a+"?",a,s,l,"["+t+"]"].join("|"))+")"+(o+i+d),"g");e.exports=function(e){return e.match(c)||[]}},93252:e=>{e.exports=function(e,t,a){var n=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(a=a>r?r:a)<0&&(a+=r),r=t>a?0:a-t>>>0,t>>>=0;for(var s=Array(r);++n<r;)s[n]=e[n+t];return s}}},e=>{e.O(0,[1180,5133,636,6593,8792],()=>e(e.s=35315)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.