Skip to content

Commit 1ba7fc3

Browse files
mliu-clouderaewilliams-clouderaactions-userbaasitsharief
authored
Better advanced parsing validation (#299)
* better handling for adv parsing * Update release version to dev-testing * wip on a regenerate response functionality * Implement in-place message regeneration and enhance chat history management * feat: add RagStudioChatMessageStatus for chat message state management * fix bug with form updates * Revert "feat: add RagStudioChatMessageStatus for chat message state management" This reverts commit 622f384. * Revert "Implement in-place message regeneration and enhance chat history management" This reverts commit dd7a263. * Revert "wip on a regenerate response functionality" This reverts commit 1171249. * Update release version to dev-testing * swap out the tooltip * Update release version to dev-testing --------- Co-authored-by: Elijah Williams <ewilliams@cloudera.com> Co-authored-by: actions-user <actions@github.com> Co-authored-by: Baasit Sharief <baasitsharief@gmail.com>
1 parent 10f2519 commit 1ba7fc3

File tree

5 files changed

+37
-8
lines changed

5 files changed

+37
-8
lines changed

prebuilt_artifacts/fe-dist.tar.gz

1.33 KB
Binary file not shown.
65 Bytes
Binary file not shown.

prebuilt_artifacts/rag-api.jar

1.74 KB
Binary file not shown.

scripts/release_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export RELEASE_TAG=1.28.1
1+
export RELEASE_TAG=dev-testing

ui/src/pages/Settings/ProcessingFields.tsx

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,19 @@
3737
******************************************************************************/
3838

3939
import { ProjectConfig } from "src/api/ampMetadataApi.ts";
40-
import { Flex, Form, Switch } from "antd";
40+
import { Flex, Form, Switch, Typography } from "antd";
41+
import { cdlWhite } from "src/cuix/variables.ts";
4142

4243
export const ProcessingFields = ({
4344
projectConfig,
4445
}: {
4546
projectConfig?: ProjectConfig | null;
4647
}) => {
48+
const sufficientResources = Boolean(
49+
projectConfig &&
50+
projectConfig.application_config.num_of_gpus > 0 &&
51+
projectConfig.application_config.memory_size_gb >= 16,
52+
);
4753
return (
4854
<Flex vertical style={{ maxWidth: 600 }}>
4955
<Form.Item
@@ -52,21 +58,40 @@ export const ProcessingFields = ({
5258
initialValue={projectConfig?.use_enhanced_pdf_processing}
5359
valuePropName="checked"
5460
tooltip={
55-
"Use enhanced PDF processing for better text extraction. This option makes PDF parsing take significantly longer. A GPU and at least 16GB of RAM is required for this option."
61+
sufficientResources
62+
? "Use enhanced PDF processing for better text extraction. This option makes PDF parsing take significantly longer. A GPU and at least 16GB of RAM is required for this option."
63+
: {
64+
title: (
65+
<div>
66+
<Typography.Title
67+
level={5}
68+
style={{ color: cdlWhite, marginTop: 0 }}
69+
>
70+
Insufficient resources to use advanced parsing
71+
</Typography.Title>
72+
<Typography.Paragraph style={{ color: cdlWhite }}>
73+
The CML Application has insufficient resources to enable
74+
advanced parsing. Please make sure you have at least 16GB
75+
of RAM and a GPU available. Failure to do so may crash the
76+
application. Resources can be modified from within the CML
77+
Application settings.
78+
</Typography.Paragraph>
79+
</div>
80+
),
81+
placement: "bottom",
82+
}
5683
}
5784
validateTrigger="onChange"
5885
rules={[
5986
({ getFieldValue }) => ({
6087
validator() {
6188
if (
62-
projectConfig &&
63-
(projectConfig.application_config.num_of_gpus === 0 ||
64-
projectConfig.application_config.memory_size_gb < 16) &&
89+
!sufficientResources &&
6590
getFieldValue("use_enhanced_pdf_processing")
6691
) {
6792
return Promise.reject(
6893
new Error(
69-
"Insufficient resources available for enhanced PDF processing. Please make sure you have at least 16GB of RAM and a GPU available. Failure to do so may crash the application.",
94+
"Insufficient resources available for enhanced PDF processing. Please make sure you have at least 16GB of RAM and a GPU available. Failure to do so may crash the application. Resources can be modified from within the CML Project.",
7095
),
7196
);
7297
}
@@ -75,7 +100,11 @@ export const ProcessingFields = ({
75100
}),
76101
]}
77102
>
78-
<Switch />
103+
<Switch
104+
disabled={
105+
!sufficientResources && !projectConfig?.use_enhanced_pdf_processing
106+
}
107+
/>
79108
</Form.Item>
80109
</Flex>
81110
);

0 commit comments

Comments
 (0)