refactor: deploy model

This commit is contained in:
jialin
2025-09-17 19:53:40 +08:00
parent 1ac63e36df
commit 4d9dec8511
19 changed files with 123 additions and 159 deletions
@@ -0,0 +1,40 @@
import llamaParameters from './llama-parameters';
import mindieParameters from './mindie-parameters';
import vllmParameters from './vllm-parameters';
export const backendOptionsMap = {
llamaBox: 'llama-box',
vllm: 'vllm',
voxBox: 'vox-box',
ascendMindie: 'ascend-mindie',
custom: 'custom'
};
export interface BackendParameter {
label: string;
value: string;
options?: Array<string | number>;
}
const generateBackendParameters = (options: BackendParameter[]) => {
return options.map((option) => {
return {
label: option.label,
value: option.value,
opts: option.options?.map((opt) => {
return {
label: opt,
value: opt
};
})
};
});
};
export default {
[backendOptionsMap.llamaBox]: generateBackendParameters(llamaParameters),
[backendOptionsMap.vllm]: generateBackendParameters(vllmParameters),
[backendOptionsMap.ascendMindie]: generateBackendParameters(mindieParameters),
[backendOptionsMap.voxBox]: [],
[backendOptionsMap.custom]: []
};
@@ -1,4 +1,6 @@
const options = [
import { BackendParameter } from './index';
const options: BackendParameter[] = [
{
label: '--verbose',
value: '--verbose'
@@ -611,17 +613,4 @@ const options = [
}
];
const resultList = options.map((option) => {
return {
label: option.label,
value: option.value,
opts: option.options?.map((opt) => {
return {
label: opt,
value: opt
};
})
};
});
export default resultList;
export default options;
@@ -1,4 +1,6 @@
const options = [
import { BackendParameter } from './index';
const options: BackendParameter[] = [
{
label: '--log-level',
value: '--log-level',
@@ -194,17 +196,4 @@ const options = [
}
];
const resultList = options.map((option) => {
return {
label: option.label,
value: option.value,
opts: option.options?.map((opt) => {
return {
label: `${opt}`,
value: opt
};
})
};
});
export default resultList;
export default options;
@@ -1,4 +1,6 @@
const options = [
import { BackendParameter } from './index';
const options: BackendParameter[] = [
{
label: '--uvicorn-log-level',
value: '--uvicorn-log-level',
@@ -774,17 +776,4 @@ const options = [
}
];
const resultList = options.map((option) => {
return {
label: option.label,
value: option.value,
opts: option.options.map((opt) => {
return {
label: opt,
value: opt
};
})
};
});
export default resultList;
export default options;
+28 -14
View File
@@ -1,6 +1,7 @@
import { StatusMaps } from '@/config';
import { EditOutlined } from '@ant-design/icons';
import _ from 'lodash';
import { backendOptionsMap } from './backend-parameters';
export const backendTipsList = [
{
@@ -41,18 +42,12 @@ export const localPathTipsList = [
}
];
export const backendOptionsMap = {
llamaBox: 'llama-box',
vllm: 'vllm',
voxBox: 'vox-box',
ascendMindie: 'ascend-mindie'
};
export const backendLabelMap = {
[backendOptionsMap.llamaBox]: 'llama-box',
[backendOptionsMap.vllm]: 'vLLM',
[backendOptionsMap.voxBox]: 'vox-box',
[backendOptionsMap.ascendMindie]: 'Ascend MindIE'
[backendOptionsMap.ascendMindie]: 'Ascend MindIE',
[backendOptionsMap.custom]: 'Custom'
};
export const backendParamsHolderTips = {
@@ -135,11 +130,6 @@ export const sourceOptions = [
value: modelSourceMap.huggingface_value,
key: 'huggingface'
},
{
label: 'Ollama Library',
value: modelSourceMap.ollama_library_value,
key: 'ollama_library'
},
{
label: 'ModelScope',
value: modelSourceMap.modelscope_value,
@@ -198,6 +188,30 @@ export const status: any = {
[InstanceStatusMap.Unreachable]: StatusMaps.error
};
export const ScheduleValueMap = {
Auto: 'auto',
Manual: 'manual',
SpecificGPUType: 'specific_gpu_type'
};
export const scheduleList = [
{
label: 'models.form.scheduletype.auto',
locale: true,
value: ScheduleValueMap.Auto
},
{
label: 'models.form.scheduletype.manual',
value: ScheduleValueMap.Manual,
locale: true
}
// {
// label: 'models.form.scheduletype.gpuType',
// value: ScheduleValueMap.SpecificGPUType,
// locale: true
// }
];
export const ActionList = [
{
label: 'common.button.edit',
@@ -414,7 +428,7 @@ export const defaultFormValues = {
description: '',
categories: null,
env: {},
scheduleType: 'auto',
scheduleType: ScheduleValueMap.Auto,
placement_strategy: 'spread',
gpu_ids: null,
gpu_selector: {},