Skip to content

Commit c53e950

Browse files
author
Keivan Vosoughi
committed
Fix for Display output for Success View
Fix for showing Total Dataset Size for Data Augmentation flow
1 parent 6541ecd commit c53e950

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ const Configure: FunctionComponent = () => {
266266
<UseCaseSelector form={form} hidden={formData?.workflow_type === WorkflowType.CUSTOM_DATA_GENERATION} />
267267

268268
{(
269-
formData?.workflow_type === WorkflowType.FREE_FORM_DATA_GENERATION ||
270-
(formData?.workflow_type === WorkflowType.CUSTOM_DATA_GENERATION &&
271-
formData?.use_case === 'custom')) &&
269+
(formData?.workflow_type === WorkflowType.FREE_FORM_DATA_GENERATION ||
270+
formData?.workflow_type === WorkflowType.CUSTOM_DATA_GENERATION) &&
271+
formData?.use_case === 'custom') &&
272272
<Form.Item
273273
noStyle
274274
shouldUpdate={(prevValues, currentValues) =>
@@ -285,7 +285,7 @@ const Configure: FunctionComponent = () => {
285285

286286
<Form.Item
287287
name='doc_paths'
288-
label={(useCase === 'custom' && formData?.workflow_type === WorkflowType.FREE_FORM_DATA_GENERATION) ? 'Context' : 'Input File'}
288+
label={'Context'}
289289
labelCol={labelCol}
290290
dependencies={['workflow_type', 'use_case]']}
291291
shouldUpdate

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ const Finish = () => {
202202
}
203203

204204
let topicTabs = [];
205-
console.log('Preparing topics...', formValues.workflow_type === WorkflowType.CUSTOM_DATA_GENERATION)
206-
if (!hasDocSeeds && formValues.workflow_type === WorkflowType.CUSTOM_DATA_GENERATION && formValues.use_case !== 'custom' &&
205+
console.log('Preparing topics...', formValues.workflow_type === WorkflowType.FREE_FORM_DATA_GENERATION)
206+
if (!hasDocSeeds && formValues.workflow_type === WorkflowType.FREE_FORM_DATA_GENERATION && formValues.use_case !== 'custom' &&
207207
hasTopics(genDatasetResp) && !isEmpty(genDatasetResp?.results)) {
208208
const values = Object.values(genDatasetResp?.results);
209209

@@ -301,7 +301,8 @@ const Finish = () => {
301301
console.log('Finish >> ');
302302
console.log('hasTopics', hasTopics(genDatasetResp));
303303
console.log('formValues', formValues);
304-
console.log('isDemo', isDemo, topicTabs);
304+
console.log('isDemo', isDemo);
305+
console.log('topicTabs', topicTabs);
305306

306307
return (
307308
<div>
@@ -327,7 +328,7 @@ const Finish = () => {
327328
</StyledButton>
328329
</Flex>
329330
)}
330-
{(isDemo && formValues.workflow_type === WorkflowType.CUSTOM_DATA_GENERATION && formValues.use_case !== 'custom' && hasTopics(genDatasetResp) && !hasDocSeeds) && (
331+
{(isDemo && formValues.workflow_type === WorkflowType.FREE_FORM_DATA_GENERATION && formValues.use_case !== 'custom' && hasTopics(genDatasetResp) && !hasDocSeeds) && (
331332
<TabsContainer title={'Generated Dataset'}>
332333
<Tabs tabPosition='left' items={topicTabs}/>
333334
</TabsContainer>

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ const Prompt = () => {
107107
doc_paths,
108108
input_key,
109109
input_value,
110-
output_key
110+
output_key,
111+
useCase
111112
);
112113

113114
console.log('values', form.getFieldsValue(true));
@@ -301,7 +302,7 @@ const Prompt = () => {
301302

302303
</div>
303304
{((workflow_type === WorkflowType.CUSTOM_DATA_GENERATION && !isEmpty(doc_paths)) ||
304-
(workflow_type === WorkflowType.SUPERVISED_FINE_TUNING && !isEmpty(doc_paths))) &&
305+
(workflow_type === WorkflowType.FREE_FORM_DATA_GENERATION && !isEmpty(doc_paths))) &&
305306
<StyledFormItem
306307
name={'num_questions'}
307308
label={

app/client/src/pages/DataGenerator/hooks.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,11 @@ export const useDatasetSize = (
211211
doc_paths: string[],
212212
input_key: string,
213213
input_value: string,
214-
output_key: string
214+
output_key: string,
215+
use_case: string
215216
) => {
216-
if (workflow_type !== WorkflowType.CUSTOM_DATA_GENERATION && isEmpty(doc_paths)) {
217+
if ((workflow_type === WorkflowType.CUSTOM_DATA_GENERATION && use_case === 'custom' && isEmpty(doc_paths))
218+
|| workflow_type === WorkflowType.FREE_FORM_DATA_GENERATION) {
217219
return {
218220
data: 0
219221
}

0 commit comments

Comments
 (0)