Skip to content

Commit bb8e5d6

Browse files
authored
Improve help text for YAML and HF catalog sources (kubeflow#2186)
Signed-off-by: manaswinidas <dasmanaswini10@gmail.com>
1 parent 1f4fd01 commit bb8e5d6

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

clients/ui/frontend/src/app/pages/modelCatalogSettings/components/ModelVisibilitySection.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import {
1616
FORM_LABELS,
1717
PLACEHOLDERS,
1818
DESCRIPTIONS,
19-
FIELD_HELPER_TEXT,
2019
getFilterInfoWithOrg,
2120
getAllowedModelsHelp,
2221
getExcludedModelsHelp,
22+
getModelsFieldHelperText,
2323
} from '~/app/pages/modelCatalogSettings/constants';
2424
import { CatalogSourceType } from '~/app/modelCatalogTypes';
2525

@@ -44,6 +44,7 @@ const ModelVisibilitySection: React.FC<ModelVisibilitySectionProps> = ({
4444

4545
const allowedModelsHelp = getAllowedModelsHelp(organization);
4646
const excludedModelsHelp = getExcludedModelsHelp(organization);
47+
const modelsFieldHelperText = getModelsFieldHelperText(isHuggingFaceMode);
4748

4849
const allowedModelsPlaceholder = isHuggingFaceMode
4950
? PLACEHOLDERS.ALLOWED_MODELS_HF
@@ -101,7 +102,7 @@ const ModelVisibilitySection: React.FC<ModelVisibilitySectionProps> = ({
101102
</FormHelperText>
102103
<FormHelperText>
103104
<HelperText>
104-
<HelperTextItem>{FIELD_HELPER_TEXT.INCLUDED_MODELS}</HelperTextItem>
105+
<HelperTextItem>{modelsFieldHelperText}</HelperTextItem>
105106
</HelperText>
106107
</FormHelperText>
107108
</FormGroup>
@@ -115,7 +116,7 @@ const ModelVisibilitySection: React.FC<ModelVisibilitySectionProps> = ({
115116
</FormHelperText>
116117
<FormHelperText>
117118
<HelperText>
118-
<HelperTextItem>{FIELD_HELPER_TEXT.EXCLUDED_MODELS}</HelperTextItem>
119+
<HelperTextItem>{modelsFieldHelperText}</HelperTextItem>
119120
</HelperText>
120121
</FormHelperText>
121122
</FormGroup>

clients/ui/frontend/src/app/pages/modelCatalogSettings/constants.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ export const HELP_TEXT = {
4242
export const PLACEHOLDERS = {
4343
ORGANIZATION: 'Example: Google',
4444
ALLOWED_MODELS_HF: 'Enter model names, one per line (e.g., gemma-7b*)',
45-
ALLOWED_MODELS_GENERIC: 'Example: Llama*, Llama-3.1-8B-Instruct',
45+
ALLOWED_MODELS_GENERIC: 'Example: Google/gemma-7b*, Meta/Llama-3.1-8B-Instruct',
4646
EXCLUDED_MODELS_HF: 'Enter model names, one per line (e.g., gemma-7b-test*)',
47-
EXCLUDED_MODELS_GENERIC: 'Example: Llama*, Llama-3.1-8B-Instruct',
47+
EXCLUDED_MODELS_GENERIC: 'Example: Google/gemma-7b-test*, Meta/Llama*',
4848
} as const;
4949

5050
export const DESCRIPTIONS = {
@@ -72,9 +72,7 @@ export const getExcludedModelsHelp = (organization?: string): string =>
7272
? `Enter the names of ${organization} models to exclude from this source. These models will not appear in the model catalog.`
7373
: 'Enter the names of models to exclude from this source. These models will not appear in the model catalog.';
7474

75-
export const FIELD_HELPER_TEXT = {
76-
INCLUDED_MODELS:
77-
'Separate model names using commas. To include all models with a specific prefix, enter the prefix followed by an asterisk. Example, Llama*',
78-
EXCLUDED_MODELS:
79-
'Separate model names using commas. To exclude all models with a specific prefix, enter the prefix followed by an asterisk. Example, Llama*',
80-
} as const;
75+
export const getModelsFieldHelperText = (isHuggingFaceSource: boolean): string =>
76+
isHuggingFaceSource
77+
? 'Separate model names using commas. Use an asterisk for prefix matching. Example: Llama*'
78+
: 'Separate model names using commas, including the organization prefix. Use an asterisk for prefix matching. Example: Google/gemma*';

0 commit comments

Comments
 (0)