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.next': 'Next {lines} Lines',
|
||||
'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.next': '下一 {lines} 行',
|
||||
'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 ListInput from '@/components/list-input';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
@@ -138,6 +139,7 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
||||
cpu_offloading: true
|
||||
});
|
||||
}
|
||||
form.setFieldValue('backend_version', '');
|
||||
}, []);
|
||||
|
||||
const collapseItems = useMemo(() => {
|
||||
@@ -270,6 +272,14 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
||||
}
|
||||
></SealSelect>
|
||||
</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">
|
||||
<ListInput
|
||||
placeholder={
|
||||
|
||||
@@ -63,6 +63,7 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
||||
label: 'common.button.viewlog',
|
||||
key: 'viewlog',
|
||||
status: [
|
||||
InstanceStatusMap.Initializing,
|
||||
InstanceStatusMap.Running,
|
||||
InstanceStatusMap.Error,
|
||||
InstanceStatusMap.Downloading
|
||||
@@ -104,6 +105,7 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
||||
<div>
|
||||
{intl.formatMessage({ id: 'models.form.backend' })}:{' '}
|
||||
{modelData?.backend || ''}
|
||||
{modelData.backend_version ? `(${modelData.backend_version})` : ''}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
updateModel
|
||||
} from '../apis';
|
||||
import {
|
||||
InstanceStatusMap,
|
||||
InstanceRealLogStatus,
|
||||
getSourceRepoConfigValue,
|
||||
modelSourceMap
|
||||
} from '../config';
|
||||
@@ -357,7 +357,7 @@ const Models: React.FC<ModelsProps> = ({
|
||||
status: row.state,
|
||||
id: row.id,
|
||||
modelId: row.model_id,
|
||||
tail: row.state === InstanceStatusMap.Downloading ? undefined : PageSize
|
||||
tail: InstanceRealLogStatus.includes(row.state) ? undefined : PageSize
|
||||
});
|
||||
setOpenLogModal(true);
|
||||
} catch (error) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useIntl } from '@umijs/max';
|
||||
import { Modal } from 'antd';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { MODELS_API } from '../apis';
|
||||
import { InstanceStatusMap } from '../config';
|
||||
import { InstanceRealLogStatus } from '../config';
|
||||
|
||||
type ViewModalProps = {
|
||||
open: boolean;
|
||||
@@ -36,7 +36,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
|
||||
const updateHandler = (list: any) => {
|
||||
const data = list?.find((item: any) => item.data.id === props.id);
|
||||
if (data) {
|
||||
setEnableScorllLoad(InstanceStatusMap.Downloading !== data?.data?.state);
|
||||
setEnableScorllLoad(!InstanceRealLogStatus.includes(data?.data?.state));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -104,6 +104,11 @@ export const InstanceStatusMap = {
|
||||
Analyzing: 'analyzing'
|
||||
};
|
||||
|
||||
export const InstanceRealLogStatus = [
|
||||
InstanceStatusMap.Downloading,
|
||||
InstanceStatusMap.Initializing
|
||||
];
|
||||
|
||||
export const InstanceStatusMapValue = {
|
||||
[InstanceStatusMap.Initializing]: 'Initializing',
|
||||
[InstanceStatusMap.Pending]: 'Pending',
|
||||
|
||||
@@ -4,6 +4,7 @@ export interface ListItem {
|
||||
reranker: boolean;
|
||||
huggingface_repo_id: string;
|
||||
huggingface_file_name: string;
|
||||
backend_version?: string;
|
||||
huggingface_filename: string;
|
||||
ollama_library_model_name: string;
|
||||
model_scope_file_path: string;
|
||||
@@ -29,6 +30,7 @@ export interface ListItem {
|
||||
export interface FormData {
|
||||
backend?: string;
|
||||
backend_parameters?: string[];
|
||||
backend_version?: string;
|
||||
source: string;
|
||||
repo_id: string;
|
||||
file_name: string;
|
||||
|
||||
Reference in New Issue
Block a user