Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(FR-404): show or hide model folder related info #3049

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.toml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enableModelStore = false # Enable model store feature. (From Back
enableLLMPlayground = false # Enable LLM Playground feature. (From Backend.AI 24.03)
enableExtendLoginSession = false # If true, enables login session extension UI. (From Backend.AI 24.09)
enableImportFromHuggingFace = false # Enable import from Hugging Face feature. (From Backend.AI 24.09)
enableModelFolders = true # Enable model folders feature. (From Backend.AI 23.03)

[wsproxy]
proxyURL = "[Proxy URL]"
Expand Down
4 changes: 3 additions & 1 deletion react/src/components/FolderCreateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ const FolderCreateModal: React.FC<FolderCreateModalProps> = ({
<Form.Item label={t('data.UsageMode')} name={'usage_mode'}>
<Radio.Group>
<Radio value={'general'}>General</Radio>
<Radio value={'model'}>Model</Radio>
{baiClient._config.enableModelFolders ? (
<Radio value={'model'}>Model</Radio>
) : null}
</Radio.Group>
</Form.Item>
<Divider />
Expand Down
1 change: 1 addition & 0 deletions react/src/hooks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ type BackendAIConfig = {
enableLLMPlayground: boolean;
enableImportFromHuggingFace: boolean;
enableContainerCommit: boolean;
enableModelFolders: boolean;
appDownloadUrl: string;
systemSSHImage: string;
fasttrackEndpoint: string;
Expand Down
2 changes: 1 addition & 1 deletion react/src/pages/VFolderListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const VFolderListPage: React.FC<VFolderListPageProps> = (props) => {
key: 'automount',
tab: t('data.AutomountFolders'),
},
{
baiClient._config.enableModelFolders && {
key: 'model',
tab: t('data.Models'),
},
Expand Down
10 changes: 10 additions & 0 deletions src/components/backend-ai-login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export default class BackendAILogin extends BackendAIPage {
@property({ type: Boolean }) enableLLMPlayground = false;
@property({ type: Boolean }) enableImportFromHuggingFace = false;
@property({ type: Boolean }) enableExtendLoginSession = false;
@property({ type: Boolean }) enableModelFolders = true;
@property({ type: Boolean }) showNonInstalledImages = false;
@property({ type: String }) eduAppNamePrefix;
@property({ type: String }) pluginPages;
Expand Down Expand Up @@ -880,6 +881,13 @@ export default class BackendAILogin extends BackendAIPage {
value: generalConfig?.enableExtendLoginSession,
} as ConfigValueObject,
) as boolean;

// Enable model folders support
this.enableModelFolders = this._getConfigValueByExists(generalConfig, {
valueType: 'boolean',
defaultValue: true,
value: generalConfig?.enableModelFolders,
} as ConfigValueObject) as boolean;
}

/**
Expand Down Expand Up @@ -1916,6 +1924,8 @@ export default class BackendAILogin extends BackendAIPage {
this.enableImportFromHuggingFace;
globalThis.backendaiclient._config.enableExtendLoginSession =
this.enableExtendLoginSession;
globalThis.backendaiclient._config.enableModelFolders =
this.enableModelFolders;
globalThis.backendaiclient._config.pluginPages = this.pluginPages;
globalThis.backendaiclient._config.blockList = this.blockList;
globalThis.backendaiclient._config.inactiveList = this.inactiveList;
Expand Down
Loading