Skip to content

Commit decfbba

Browse files
author
Keivan Vosoughi
committed
DSE-45114: Add Data Augmentation
1 parent 29f244f commit decfbba

File tree

4 files changed

+42
-4
lines changed

4 files changed

+42
-4
lines changed

app/client/src/pages/DataGenerator/DataGenerator.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import isEmpty from 'lodash/isEmpty';
22
import isString from 'lodash/isString';
3-
import { useEffect, useRef, useState } from 'react';
3+
import { FunctionComponent, useEffect, useRef, useState } from 'react';
44
import { useLocation, useParams } from 'react-router-dom';
55

66
import { Button, Flex, Form, Layout, Steps } from 'antd';
@@ -20,10 +20,15 @@ import { DataGenWizardSteps, WizardStepConfig, WorkflowType } from './types';
2020
import { WizardCtx } from './utils';
2121
import { fetchDatasetDetails, useGetDatasetDetails } from '../DatasetDetails/hooks';
2222
import { useMutation } from '@tanstack/react-query';
23+
import { WizardModeType } from '../../types';
2324

2425
const { Content } = Layout;
2526
// const { Title } = Typography;
2627

28+
interface Props {
29+
mode?: WizardModeType;
30+
}
31+
2732
const StyledTitle = styled.div`
2833
margin-top: 10px;
2934
font-family: Roboto, -apple-system, 'Segoe UI', sans-serif;
@@ -95,7 +100,8 @@ const steps: WizardStepConfig[] = [
95100
/**
96101
* Wizard component for Synthetic Data Generation workflow
97102
*/
98-
const DataGenerator = () => {
103+
const DataGenerator: FunctionComponent<Props> = ({ mode }) => {
104+
console.log('DataGenerator mode: ', mode);
99105
const [current, setCurrent] = useState(0);
100106
const [maxStep, setMaxStep] = useState(0);
101107
const [isStepValid, setIsStepValid] = useState<boolean>(false);

app/client/src/pages/Home/HomePage.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import EvaluationsTab from './EvaluationsTab';
77
import DatasetIcon from '../../assets/ic-datasets.svg';
88
import ArrowRightIcon from '../../assets/ic-arrow-right.svg';
99
import EvaluateIcon from '../../assets/ic-evaluations.svg';
10+
import DataAugmentationIcon from '../../assets/ic-data-augmentation.svg';
1011
import EvaluateButton from './EvaluateButton';
1112
import ExportsTab from './ExportsTab';
1213

@@ -116,6 +117,25 @@ const HomePage: React.FC = () => {
116117
</div>
117118
</div>
118119
</HeaderSection>
120+
<HeaderSection>
121+
<div className="left-section">
122+
<img src={DataAugmentationIcon} alt="Datasets" />
123+
</div>
124+
<div className="middle-section">
125+
<div className="section-title">Data Augmentation</div>
126+
<div className="section-description">
127+
<p>Generate multi-dimension datasets using LLM custom prompts</p>
128+
</div>
129+
</div>
130+
<div className="right-section">
131+
<div>
132+
<Button href="/data-augmentation">
133+
Get Started
134+
<img src={ArrowRightIcon} alt="Get Started" />
135+
</Button>
136+
</div>
137+
</div>
138+
</HeaderSection>
119139
<HeaderSection style={{ marginLeft: '1rem' }}>
120140
<div className="left-section evaluate-icon">
121141
<img src={EvaluateIcon} alt="Datasets" />

app/client/src/routes.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Navigate, createBrowserRouter } from "react-router-dom";
22
import Layout from "./Container";
33
import DataGenerator from "./pages/DataGenerator";
44
import HomePage from "./pages/Home";
5-
import { Pages } from "./types";
5+
import { Pages, WizardModeType } from "./types";
66
import EvaluatorPage from "./pages/Evaluator";
77
import ReevaluatorPage from "./pages/Evaluator/ReevaluatorPage";
88
import DatasetDetailsPage from "./pages/DatasetDetails/DatasetDetailsPage";
@@ -35,7 +35,13 @@ const router = createBrowserRouter([
3535
},
3636
{
3737
path: Pages.GENERATOR,
38-
element: <DataGenerator key={Pages.GENERATOR}/>,
38+
element: <DataGenerator key={Pages.GENERATOR} mode={WizardModeType.DATA_GENERATION}/>,
39+
errorElement: <ErrorPage />,
40+
loader: async () => null
41+
},
42+
{
43+
path: Pages.GENERATOR,
44+
element: <DataGenerator key={Pages.DATA_AUGMENTATION} mode={WizardModeType.DATA_AUGMENTATION}/>,
3945
errorElement: <ErrorPage />,
4046
loader: async () => null
4147
},

app/client/src/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export enum Pages {
22
GENERATOR = 'data-generator',
3+
DATA_AUGMENTATION = 'data-augmentation',
34
REGENERATE = 're-generate',
45
EVALUATOR = 'evaluator',
56
HISTORY = 'history',
@@ -52,4 +53,9 @@ export interface UseCase {
5253
id: string;
5354
label: string;
5455
value: string;
56+
}
57+
58+
export enum WizardModeType {
59+
DATA_GENERATION = 'data-generation',
60+
DATA_AUGMENTATION = 'data-augmention'
5561
}

0 commit comments

Comments
 (0)