feat: add backend version field
This commit is contained in:
@@ -70,5 +70,8 @@ export default {
|
|||||||
'models.logs.pagination.prev': 'Previous {lines} Lines',
|
'models.logs.pagination.prev': 'Previous {lines} Lines',
|
||||||
'models.logs.pagination.next': 'Next {lines} Lines',
|
'models.logs.pagination.next': 'Next {lines} Lines',
|
||||||
'models.form.localPath': 'Local Path',
|
'models.form.localPath': 'Local Path',
|
||||||
'models.form.filePath': 'Model Path'
|
'models.form.filePath': 'Model Path',
|
||||||
|
'model.form.backendVersion': 'Backend Version',
|
||||||
|
'models.form.backendVersion.tips':
|
||||||
|
'Pin a specific version to keep the backend stable across GPUStack upgrades.'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -68,5 +68,8 @@ export default {
|
|||||||
'models.logs.pagination.prev': '上一 {lines} 行',
|
'models.logs.pagination.prev': '上一 {lines} 行',
|
||||||
'models.logs.pagination.next': '下一 {lines} 行',
|
'models.logs.pagination.next': '下一 {lines} 行',
|
||||||
'models.form.localPath': '本地路径',
|
'models.form.localPath': '本地路径',
|
||||||
'models.form.filePath': '模型路径'
|
'models.form.filePath': '模型路径',
|
||||||
|
'model.form.backendVersion': '后端版本',
|
||||||
|
'model.form.backendVersion.tips':
|
||||||
|
'固定指定版本以保持后端在 GPUStack 升级过程中的稳定性'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import LabelSelector from '@/components/label-selector';
|
import LabelSelector from '@/components/label-selector';
|
||||||
import ListInput from '@/components/list-input';
|
import ListInput from '@/components/list-input';
|
||||||
|
import SealInput from '@/components/seal-form/seal-input';
|
||||||
import SealSelect from '@/components/seal-form/seal-select';
|
import SealSelect from '@/components/seal-form/seal-select';
|
||||||
import { PageAction } from '@/config';
|
import { PageAction } from '@/config';
|
||||||
import { PageActionType } from '@/config/types';
|
import { PageActionType } from '@/config/types';
|
||||||
@@ -138,6 +139,7 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
|||||||
cpu_offloading: true
|
cpu_offloading: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
form.setFieldValue('backend_version', '');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const collapseItems = useMemo(() => {
|
const collapseItems = useMemo(() => {
|
||||||
@@ -270,6 +272,14 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
|||||||
}
|
}
|
||||||
></SealSelect>
|
></SealSelect>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item name="backend_version">
|
||||||
|
<SealInput.Input
|
||||||
|
label={intl.formatMessage({ id: 'model.form.backendVersion' })}
|
||||||
|
description={intl.formatMessage({
|
||||||
|
id: 'model.form.backendVersion.tips'
|
||||||
|
})}
|
||||||
|
></SealInput.Input>
|
||||||
|
</Form.Item>
|
||||||
<Form.Item<FormData> name="backend_parameters">
|
<Form.Item<FormData> name="backend_parameters">
|
||||||
<ListInput
|
<ListInput
|
||||||
placeholder={
|
placeholder={
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
|||||||
label: 'common.button.viewlog',
|
label: 'common.button.viewlog',
|
||||||
key: 'viewlog',
|
key: 'viewlog',
|
||||||
status: [
|
status: [
|
||||||
|
InstanceStatusMap.Initializing,
|
||||||
InstanceStatusMap.Running,
|
InstanceStatusMap.Running,
|
||||||
InstanceStatusMap.Error,
|
InstanceStatusMap.Error,
|
||||||
InstanceStatusMap.Downloading
|
InstanceStatusMap.Downloading
|
||||||
@@ -104,6 +105,7 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
|||||||
<div>
|
<div>
|
||||||
{intl.formatMessage({ id: 'models.form.backend' })}:{' '}
|
{intl.formatMessage({ id: 'models.form.backend' })}:{' '}
|
||||||
{modelData?.backend || ''}
|
{modelData?.backend || ''}
|
||||||
|
{modelData.backend_version ? `(${modelData.backend_version})` : ''}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import {
|
|||||||
updateModel
|
updateModel
|
||||||
} from '../apis';
|
} from '../apis';
|
||||||
import {
|
import {
|
||||||
InstanceStatusMap,
|
InstanceRealLogStatus,
|
||||||
getSourceRepoConfigValue,
|
getSourceRepoConfigValue,
|
||||||
modelSourceMap
|
modelSourceMap
|
||||||
} from '../config';
|
} from '../config';
|
||||||
@@ -357,7 +357,7 @@ const Models: React.FC<ModelsProps> = ({
|
|||||||
status: row.state,
|
status: row.state,
|
||||||
id: row.id,
|
id: row.id,
|
||||||
modelId: row.model_id,
|
modelId: row.model_id,
|
||||||
tail: row.state === InstanceStatusMap.Downloading ? undefined : PageSize
|
tail: InstanceRealLogStatus.includes(row.state) ? undefined : PageSize
|
||||||
});
|
});
|
||||||
setOpenLogModal(true);
|
setOpenLogModal(true);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useIntl } from '@umijs/max';
|
|||||||
import { Modal } from 'antd';
|
import { Modal } from 'antd';
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { MODELS_API } from '../apis';
|
import { MODELS_API } from '../apis';
|
||||||
import { InstanceStatusMap } from '../config';
|
import { InstanceRealLogStatus } from '../config';
|
||||||
|
|
||||||
type ViewModalProps = {
|
type ViewModalProps = {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
@@ -36,7 +36,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
|||||||
const updateHandler = (list: any) => {
|
const updateHandler = (list: any) => {
|
||||||
const data = list?.find((item: any) => item.data.id === props.id);
|
const data = list?.find((item: any) => item.data.id === props.id);
|
||||||
if (data) {
|
if (data) {
|
||||||
setEnableScorllLoad(InstanceStatusMap.Downloading !== data?.data?.state);
|
setEnableScorllLoad(!InstanceRealLogStatus.includes(data?.data?.state));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,11 @@ export const InstanceStatusMap = {
|
|||||||
Analyzing: 'analyzing'
|
Analyzing: 'analyzing'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const InstanceRealLogStatus = [
|
||||||
|
InstanceStatusMap.Downloading,
|
||||||
|
InstanceStatusMap.Initializing
|
||||||
|
];
|
||||||
|
|
||||||
export const InstanceStatusMapValue = {
|
export const InstanceStatusMapValue = {
|
||||||
[InstanceStatusMap.Initializing]: 'Initializing',
|
[InstanceStatusMap.Initializing]: 'Initializing',
|
||||||
[InstanceStatusMap.Pending]: 'Pending',
|
[InstanceStatusMap.Pending]: 'Pending',
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export interface ListItem {
|
|||||||
reranker: boolean;
|
reranker: boolean;
|
||||||
huggingface_repo_id: string;
|
huggingface_repo_id: string;
|
||||||
huggingface_file_name: string;
|
huggingface_file_name: string;
|
||||||
|
backend_version?: string;
|
||||||
huggingface_filename: string;
|
huggingface_filename: string;
|
||||||
ollama_library_model_name: string;
|
ollama_library_model_name: string;
|
||||||
model_scope_file_path: string;
|
model_scope_file_path: string;
|
||||||
@@ -29,6 +30,7 @@ export interface ListItem {
|
|||||||
export interface FormData {
|
export interface FormData {
|
||||||
backend?: string;
|
backend?: string;
|
||||||
backend_parameters?: string[];
|
backend_parameters?: string[];
|
||||||
|
backend_version?: string;
|
||||||
source: string;
|
source: string;
|
||||||
repo_id: string;
|
repo_id: string;
|
||||||
file_name: string;
|
file_name: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user