Skip to content

Commit 7feb574

Browse files
author
Keivan Vosoughi
committed
Regenerate Issues using PDF Files
1 parent 17d811b commit 7feb574

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

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

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,27 @@ const Configure: FunctionComponent = () => {
258258
<UseCaseSelector form={form} />}
259259

260260
{(
261-
formData?.workflow_type === WorkflowType.SUPERVISED_FINE_TUNING ||
262-
formData?.workflow_type === WorkflowType.CUSTOM_DATA_GENERATION) &&
261+
formData?.workflow_type === WorkflowType.FREE_FORM_DATA_GENERATION ||
262+
formData?.use_case === 'custom') &&
263+
<Form.Item
264+
noStyle
265+
shouldUpdate={(prevValues, currentValues) =>
266+
prevValues.doc_paths !== currentValues.doc_paths ||
267+
prevValues.use_case !== currentValues.use_case
268+
}
269+
>
270+
{({}) => {
271+
const useCase = form.getFieldValue('use_case');
272+
if (useCase === 'custom') {
273+
274+
}
275+
return (
276+
263277
<Form.Item
264278
name='doc_paths'
265-
label='Input File'
279+
label={useCase === 'custom' ? 'Context' : 'Input File'}
266280
labelCol={labelCol}
267-
dependencies={['workflow_type']}
281+
dependencies={['workflow_type', 'use_case]']}
268282
shouldUpdate
269283
validateTrigger="['onBlur','onChange']"
270284
tooltip='Select a file from your project that contains the initial data to be augmented.'
@@ -302,9 +316,9 @@ const Configure: FunctionComponent = () => {
302316
>
303317
<Flex>
304318
<Select placeholder={'Select project files'} mode="multiple" value={selectedFiles || []} onChange={onFilesChange} allowClear/>
305-
<FileSelectorButton onAddFiles={onAddFiles} workflowType={form.getFieldValue('workflow_type')} allowFileTypes={['pdf', 'docx']}/>
319+
<FileSelectorButton onAddFiles={onAddFiles} workflowType={form.getFieldValue('workflow_type')} allowFileTypes={['pdf', 'docx', 'json']}/>
306320
</Flex>
307-
</Form.Item>}
321+
</Form.Item>)}}</Form.Item>}
308322
{formData?.workflow_type === WorkflowType.CUSTOM_DATA_GENERATION &&
309323
<>
310324
<Form.Item

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const Examples: FunctionComponent = () => {
149149
</Space>
150150
</StyledTitle>
151151
<Flex align='center' gap={15}>
152-
{workflowType === WorkflowType.FREE_FORM_DATA_GENERATION &&
152+
{(workflowType === WorkflowType.FREE_FORM_DATA_GENERATION || workflowType === WorkflowType.CUSTOM_DATA_GENERATION) &&
153153
<>
154154
<Form.Item
155155
name="example_path"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ const Prompt = () => {
293293

294294

295295
</div>
296-
{((workflow_type === WorkflowType.CUSTOM_DATA_GENERATION && !isEmpty(doc_paths)) ||
296+
{((workflow_type === WorkflowType.FREE_FORM_DATA_GENERATION && !isEmpty(doc_paths)) ||
297297
(workflow_type === WorkflowType.SUPERVISED_FINE_TUNING && !isEmpty(doc_paths))) &&
298298
<StyledFormItem
299299
name={'num_questions'}

0 commit comments

Comments
 (0)