style: framework options
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import SealInput from '@/components/seal-form/seal-input';
|
import SealInput from '@/components/seal-form/seal-input';
|
||||||
|
import { Global } from '@/config/global';
|
||||||
import { MinusOutlined } from '@ant-design/icons';
|
import { MinusOutlined } from '@ant-design/icons';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Button, Tooltip } from 'antd';
|
import { Button, Tooltip } from 'antd';
|
||||||
@@ -99,6 +100,7 @@ const LabelItem: React.FC<LabelItemProps> = ({
|
|||||||
<div className="label-value">
|
<div className="label-value">
|
||||||
{valueAddon ?? (
|
{valueAddon ?? (
|
||||||
<SealInput.Input
|
<SealInput.Input
|
||||||
|
trim={false}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
checkStatus={label.value ? 'success' : ''}
|
checkStatus={label.value ? 'success' : ''}
|
||||||
label={intl.formatMessage({ id: 'common.input.value' })}
|
label={intl.formatMessage({ id: 'common.input.value' })}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ const SealInput: React.FC<InputProps & SealFormItemProps> = (props) => {
|
|||||||
setIsFocus(false);
|
setIsFocus(false);
|
||||||
}
|
}
|
||||||
if (!trim) {
|
if (!trim) {
|
||||||
e.target.value = e.target.value?.trimRight?.();
|
e.target.value = e.target.value?.trim?.();
|
||||||
props.onChange?.(e);
|
props.onChange?.(e);
|
||||||
}
|
}
|
||||||
props.onBlur?.(e);
|
props.onBlur?.(e);
|
||||||
|
|||||||
Vendored
+3
-1
@@ -1,3 +1,5 @@
|
|||||||
|
import { PageActionType } from './types';
|
||||||
|
|
||||||
declare namespace Global {
|
declare namespace Global {
|
||||||
type WithFalse<T> = T | false;
|
type WithFalse<T> = T | false;
|
||||||
interface Pagination {
|
interface Pagination {
|
||||||
@@ -61,7 +63,7 @@ declare namespace Global {
|
|||||||
|
|
||||||
interface ScrollerModalProps<T = unknown, U = unknown> {
|
interface ScrollerModalProps<T = unknown, U = unknown> {
|
||||||
title?: string;
|
title?: string;
|
||||||
action?: 'create' | 'update' | 'view' | 'edit';
|
action?: PageActionType;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
currentData?: T | null;
|
currentData?: T | null;
|
||||||
onOk?: (values: U) => void;
|
onOk?: (values: U) => void;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default {
|
|||||||
'backend.form.healthCheckPath': 'Health Check Path',
|
'backend.form.healthCheckPath': 'Health Check Path',
|
||||||
'backend.form.defaultExecuteCommand': 'Default Execution Command',
|
'backend.form.defaultExecuteCommand': 'Default Execution Command',
|
||||||
'backend.form.defaultExecuteCommand.tips':
|
'backend.form.defaultExecuteCommand.tips':
|
||||||
'{{model_path}} is the model path, and {{port}} is the service port. These variable names cannot be modified.',
|
'{{model_path}} is the model path, {{port}} is the service port, and {{model_name}} is the model name. Do not change these variables.',
|
||||||
'backend.form.defaultBackendParameters': 'Default Backend Parameters',
|
'backend.form.defaultBackendParameters': 'Default Backend Parameters',
|
||||||
'backend.form.versionConfig': 'Versions Config',
|
'backend.form.versionConfig': 'Versions Config',
|
||||||
'backend.form.addParameter': 'Add Parameter',
|
'backend.form.addParameter': 'Add Parameter',
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ export default {
|
|||||||
'models.form.performance': 'Performance',
|
'models.form.performance': 'Performance',
|
||||||
'models.form.gpus.notfound': 'No GPUs found',
|
'models.form.gpus.notfound': 'No GPUs found',
|
||||||
'models.form.extendedkvcache': 'Enable Extended KV Cache',
|
'models.form.extendedkvcache': 'Enable Extended KV Cache',
|
||||||
'models.form.chunkSize': 'Size Of Cache Chunks',
|
'models.form.chunkSize': 'Size of Cache Chunks',
|
||||||
'models.form.maxCPUSize': 'Maximum CPU Cache Size (GiB)',
|
'models.form.maxCPUSize': 'Maximum CPU Cache Size (GiB)',
|
||||||
'models.form.remoteURL': 'Remote Storage URL',
|
'models.form.remoteURL': 'Remote Storage URL',
|
||||||
'models.form.remoteURL.tips':
|
'models.form.remoteURL.tips':
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default {
|
|||||||
'backend.form.healthCheckPath': 'Health Check Path',
|
'backend.form.healthCheckPath': 'Health Check Path',
|
||||||
'backend.form.defaultExecuteCommand': 'Default Execution Command',
|
'backend.form.defaultExecuteCommand': 'Default Execution Command',
|
||||||
'backend.form.defaultExecuteCommand.tips':
|
'backend.form.defaultExecuteCommand.tips':
|
||||||
'{{model_path}} is the model path, and {{port}} is the service port. These variable names cannot be modified.',
|
'{{model_path}} is the model path, {{port}} is the service port, and {{model_name}} is the model name. Do not change these variables.',
|
||||||
'backend.form.defaultBackendParameters': 'Default Backend Parameters',
|
'backend.form.defaultBackendParameters': 'Default Backend Parameters',
|
||||||
'backend.form.versionConfig': 'Versions Config',
|
'backend.form.versionConfig': 'Versions Config',
|
||||||
'backend.form.addParameter': 'Add Parameter',
|
'backend.form.addParameter': 'Add Parameter',
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ export default {
|
|||||||
'models.form.performance': 'Performance',
|
'models.form.performance': 'Performance',
|
||||||
'models.form.gpus.notfound': 'No GPUs found',
|
'models.form.gpus.notfound': 'No GPUs found',
|
||||||
'models.form.extendedkvcache': 'Enable Extended KV Cache',
|
'models.form.extendedkvcache': 'Enable Extended KV Cache',
|
||||||
'models.form.chunkSize': 'Size Of Cache Chunks',
|
'models.form.chunkSize': 'Size of Cache Chunks',
|
||||||
'models.form.maxCPUSize': 'Maximum CPU Cache Size (GiB)',
|
'models.form.maxCPUSize': 'Maximum CPU Cache Size (GiB)',
|
||||||
'models.form.remoteURL': 'Remote Storage URL',
|
'models.form.remoteURL': 'Remote Storage URL',
|
||||||
'models.form.remoteURL.tips':
|
'models.form.remoteURL.tips':
|
||||||
@@ -279,7 +279,7 @@ export default {
|
|||||||
// 20. 'models.form.performance': 'Performance',
|
// 20. 'models.form.performance': 'Performance',
|
||||||
// 21. 'models.form.gpus.notfound': 'No GPUs found',
|
// 21. 'models.form.gpus.notfound': 'No GPUs found',
|
||||||
// 22. 'models.form.extendedkvcache': 'Enable Extended KV Cache',
|
// 22. 'models.form.extendedkvcache': 'Enable Extended KV Cache',
|
||||||
// 23. 'models.form.chunkSize': 'Size Of Cache Chunks',
|
// 23. 'models.form.chunkSize': 'Size of Cache Chunks',
|
||||||
// 24. 'models.form.maxCPUSize': 'Maximum CPU Cache Size (GiB)',
|
// 24. 'models.form.maxCPUSize': 'Maximum CPU Cache Size (GiB)',
|
||||||
// 25. 'models.form.remoteURL': 'Remote Storage URL',
|
// 25. 'models.form.remoteURL': 'Remote Storage URL',
|
||||||
// 26. 'models.form.runCommandPlaceholder': 'e.g., vllm serve Qwen/Qwen2.5-1.5B-Instruct',
|
// 26. 'models.form.runCommandPlaceholder': 'e.g., vllm serve Qwen/Qwen2.5-1.5B-Instruct',
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default {
|
|||||||
'backend.form.healthCheckPath': 'Путь проверки здоровья',
|
'backend.form.healthCheckPath': 'Путь проверки здоровья',
|
||||||
'backend.form.defaultExecuteCommand': 'Команда выполнения по умолчанию',
|
'backend.form.defaultExecuteCommand': 'Команда выполнения по умолчанию',
|
||||||
'backend.form.defaultExecuteCommand.tips':
|
'backend.form.defaultExecuteCommand.tips':
|
||||||
'{{model_path}} is the model path, and {{port}} is the service port. These variable names cannot be modified.',
|
'{{model_path}} is the model path, {{port}} is the service port, and {{model_name}} is the model name. Do not change these variables.',
|
||||||
'backend.form.defaultBackendParameters': 'Параметры бэкенда по умолчанию',
|
'backend.form.defaultBackendParameters': 'Параметры бэкенда по умолчанию',
|
||||||
'backend.form.versionConfig': 'Конфигурация версий',
|
'backend.form.versionConfig': 'Конфигурация версий',
|
||||||
'backend.form.addParameter': 'Добавить параметр',
|
'backend.form.addParameter': 'Добавить параметр',
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default {
|
|||||||
'backend.form.healthCheckPath': '健康检查路径',
|
'backend.form.healthCheckPath': '健康检查路径',
|
||||||
'backend.form.defaultExecuteCommand': '默认执行命令',
|
'backend.form.defaultExecuteCommand': '默认执行命令',
|
||||||
'backend.form.defaultExecuteCommand.tips':
|
'backend.form.defaultExecuteCommand.tips':
|
||||||
'{{model_path}} 为模型文件路径,{{port}} 为服务端口,这两个变量名不可更改。',
|
'{{model_path}} 为模型文件路径,{{port}} 为服务端口,{{model_name}} 为模型名称,这三个变量名不可更改。',
|
||||||
'backend.form.defaultBackendParameters': '默认后端参数',
|
'backend.form.defaultBackendParameters': '默认后端参数',
|
||||||
'backend.form.versionConfig': '版本配置',
|
'backend.form.versionConfig': '版本配置',
|
||||||
'backend.form.addParameter': '添加参数',
|
'backend.form.addParameter': '添加参数',
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ import VoxBoxLogo from '@/assets/logo/voxbox.png';
|
|||||||
import icons from '@/components/icon-font/icons';
|
import icons from '@/components/icon-font/icons';
|
||||||
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
import { GPUSTACK_API_BASE_URL } from '@/config/settings';
|
||||||
import { backendOptionsMap } from '@/pages/llmodels/config/backend-parameters';
|
import { backendOptionsMap } from '@/pages/llmodels/config/backend-parameters';
|
||||||
|
import {
|
||||||
|
GPUDriverMap,
|
||||||
|
ManufacturerMap
|
||||||
|
} from '@/pages/resources/config/gpu-driver';
|
||||||
import jsYaml from 'js-yaml';
|
import jsYaml from 'js-yaml';
|
||||||
import { trim } from 'lodash';
|
import { trim } from 'lodash';
|
||||||
|
|
||||||
@@ -135,35 +139,51 @@ export const builtInBackendFields = [
|
|||||||
export const frameworks = [
|
export const frameworks = [
|
||||||
{
|
{
|
||||||
label: 'CUDA',
|
label: 'CUDA',
|
||||||
value: 'cuda'
|
value: GPUDriverMap.NVIDIA,
|
||||||
|
tips: ManufacturerMap[GPUDriverMap.NVIDIA],
|
||||||
|
locale: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'ROCm',
|
label: 'ROCm',
|
||||||
value: 'rocm'
|
value: GPUDriverMap.AMD,
|
||||||
|
tips: ManufacturerMap[GPUDriverMap.AMD],
|
||||||
|
locale: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'CANN',
|
label: 'CANN',
|
||||||
value: 'cann'
|
value: GPUDriverMap.ASCEND,
|
||||||
|
tips: ManufacturerMap[GPUDriverMap.ASCEND],
|
||||||
|
locale: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'DTK',
|
label: 'DTK',
|
||||||
value: 'dtk'
|
value: GPUDriverMap.HYGON,
|
||||||
|
tips: ManufacturerMap[GPUDriverMap.HYGON],
|
||||||
|
locale: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'MACA',
|
label: 'MACA',
|
||||||
value: 'maca'
|
value: GPUDriverMap.METAX,
|
||||||
|
tips: ManufacturerMap[GPUDriverMap.METAX],
|
||||||
|
locale: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'CoreX',
|
label: 'CoreX',
|
||||||
value: 'corex'
|
value: GPUDriverMap.ILUVATAR,
|
||||||
|
tips: ManufacturerMap[GPUDriverMap.ILUVATAR],
|
||||||
|
locale: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'MUSA',
|
label: 'MUSA',
|
||||||
value: 'musa'
|
value: GPUDriverMap.MOORE_THREADS,
|
||||||
|
tips: ManufacturerMap[GPUDriverMap.MOORE_THREADS],
|
||||||
|
locale: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Neuware',
|
label: 'Neuware',
|
||||||
value: 'neuware'
|
value: GPUDriverMap.CAMBRICON,
|
||||||
|
tips: ManufacturerMap[GPUDriverMap.CAMBRICON],
|
||||||
|
locale: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'CPU',
|
label: 'CPU',
|
||||||
|
|||||||
@@ -62,7 +62,10 @@ const BasicForm: React.FC<AddModalProps> = ({ action, currentData }) => {
|
|||||||
})}
|
})}
|
||||||
placeholder={intl.formatMessage(
|
placeholder={intl.formatMessage(
|
||||||
{ id: 'common.help.eg' },
|
{ id: 'common.help.eg' },
|
||||||
{ content: 'vllm serve {{model_path}} --port {{port}}' }
|
{
|
||||||
|
content:
|
||||||
|
'vllm serve {{model_path}} --port {{port}} --served-model-name {{model_name}}'
|
||||||
|
}
|
||||||
)}
|
)}
|
||||||
autoSize={{ minRows: 2, maxRows: 4 }}
|
autoSize={{ minRows: 2, maxRows: 4 }}
|
||||||
label={intl.formatMessage({
|
label={intl.formatMessage({
|
||||||
|
|||||||
@@ -157,6 +157,22 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
|||||||
console.log('Version changed:', e.target.value);
|
console.log('Version changed:', e.target.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const optionRender = (option: any) => {
|
||||||
|
const { data } = option;
|
||||||
|
return (
|
||||||
|
<span>
|
||||||
|
{option.label}
|
||||||
|
{data.tips ? (
|
||||||
|
data.locale ? (
|
||||||
|
<span className="text-tertiary m-l-4">{` [${intl.formatMessage({ id: data.tips })}]`}</span>
|
||||||
|
) : (
|
||||||
|
<span className="text-tertiary m-l-4">{` [${data.tips}]`}</span>
|
||||||
|
)
|
||||||
|
) : null}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Title>
|
<Title>
|
||||||
@@ -315,8 +331,10 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
|||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<SealSelect
|
<SealSelect
|
||||||
|
listHeight={288}
|
||||||
label={intl.formatMessage({ id: 'backend.framework' })}
|
label={intl.formatMessage({ id: 'backend.framework' })}
|
||||||
options={frameworks}
|
options={frameworks}
|
||||||
|
optionRender={optionRender}
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -9,15 +9,15 @@ export const GPUDriverMap = {
|
|||||||
METAX: 'maca'
|
METAX: 'maca'
|
||||||
};
|
};
|
||||||
|
|
||||||
const ManufacturerMap = {
|
export const ManufacturerMap = {
|
||||||
[GPUDriverMap.NVIDIA]: 'NVIDIA',
|
[GPUDriverMap.NVIDIA]: 'NVIDIA',
|
||||||
[GPUDriverMap.AMD]: 'AMD',
|
[GPUDriverMap.AMD]: 'AMD',
|
||||||
[GPUDriverMap.ASCEND]: 'Huawei',
|
[GPUDriverMap.ASCEND]: 'vendor.ascend',
|
||||||
[GPUDriverMap.HYGON]: 'Hygon',
|
[GPUDriverMap.HYGON]: 'vendor.hygon',
|
||||||
[GPUDriverMap.MOORE_THREADS]: 'Moore Threads',
|
[GPUDriverMap.MOORE_THREADS]: 'vendor.moorthreads',
|
||||||
[GPUDriverMap.ILUVATAR]: 'Iluvatar',
|
[GPUDriverMap.ILUVATAR]: 'vendor.iluvatar',
|
||||||
[GPUDriverMap.CAMBRICON]: 'Cambricon',
|
[GPUDriverMap.CAMBRICON]: 'vendor.cambricon',
|
||||||
[GPUDriverMap.METAX]: 'MetaX'
|
[GPUDriverMap.METAX]: 'vendor.metax'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const GPUsConfigs: Record<
|
export const GPUsConfigs: Record<
|
||||||
|
|||||||
Reference in New Issue
Block a user