style: adjust some ui statements

This commit is contained in:
jialin
2025-11-20 11:47:09 +08:00
parent 5d383ec39b
commit 8f9562d6a4
15 changed files with 53 additions and 66 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ export default {
'backend.form.healthCheckPath': 'Health Check Path',
'backend.form.defaultExecuteCommand': 'Default Execution Command',
'backend.form.defaultExecuteCommand.tips':
'{{model_path}} is the model path, {{port}} is the service port, and {{model_name}} is the model name. Do not change these variables.',
'{{model_path}}, {{port}}, {{worker_ip}} and {{model_name}} are placeholders that will be substituted with the actual values during deployment.',
'backend.form.defaultBackendParameters': 'Default Backend Parameters',
'backend.form.versionConfig': 'Versions Config',
'backend.form.addParameter': 'Add Parameter',
+1 -1
View File
@@ -20,7 +20,7 @@ export default {
'backend.form.healthCheckPath': 'Health Check Path',
'backend.form.defaultExecuteCommand': 'Default Execution Command',
'backend.form.defaultExecuteCommand.tips':
'{{model_path}} is the model path, {{port}} is the service port, and {{model_name}} is the model name. Do not change these variables.',
'{{model_path}}, {{port}}, {{worker_ip}} and {{model_name}} are placeholders that will be substituted with the actual values during deployment.',
'backend.form.defaultBackendParameters': 'Default Backend Parameters',
'backend.form.versionConfig': 'Versions Config',
'backend.form.addParameter': 'Add Parameter',
+2 -2
View File
@@ -20,7 +20,7 @@ export default {
'backend.form.healthCheckPath': 'Путь проверки здоровья',
'backend.form.defaultExecuteCommand': 'Команда выполнения по умолчанию',
'backend.form.defaultExecuteCommand.tips':
'{{model_path}} is the model path, {{port}} is the service port, and {{model_name}} is the model name. Do not change these variables.',
'{{model_path}}, {{port}}, {{worker_ip}} and {{model_name}} are placeholders that will be substituted with the actual values during deployment.',
'backend.form.defaultBackendParameters': 'Параметры бэкенда по умолчанию',
'backend.form.versionConfig': 'Конфигурация версий',
'backend.form.addParameter': 'Добавить параметр',
@@ -36,5 +36,5 @@ export default {
};
// ========== To-Do: Translate Keys (Remove After Translation) ==========
// 1. {{model_path}}, {{port}}, {{worker_ip}} and {{model_name}} are placeholders that will be substituted with the actual values during deployment.
// ========== End of To-Do List ==========
+1 -1
View File
@@ -20,7 +20,7 @@ export default {
'backend.form.healthCheckPath': '健康检查路径',
'backend.form.defaultExecuteCommand': '默认执行命令',
'backend.form.defaultExecuteCommand.tips':
'{{model_path}} 为模型文件路径,{{port}} 为服务端口,{{model_name}} 为模型名称,这三个变量名不可更改。',
'{{model_path}}、{{port}}、{{worker_ip}} 和 {{model_name}} 都是占位符,在部署过程中会被替换为实际的值。',
'backend.form.defaultBackendParameters': '默认后端参数',
'backend.form.versionConfig': '版本配置',
'backend.form.addParameter': '添加参数',
+2 -2
View File
@@ -198,11 +198,11 @@ default_version: v0.11.0
health_check_path: /${GPUSTACK_API_BASE_URL}/models
default_backend_param:
- --host
default_run_command: vllm serve {{model_path}} --port {{port}} --served-model-name {{model_name}}
default_run_command: vllm serve {{model_path}} --port {{port}} --worker-ip {{worker_ip}} --served-model-name {{model_name}}
version_configs:
v0.11.0:
image_name: lm/vllm:latest
run_command: vllm serve {{model_path}} --port {{port}} --served-model-name {{model_name}}
run_command: vllm serve {{model_path}} --port {{port}} --worker-ip {{worker_ip}} --served-model-name {{model_name}}
custom_framework: cuda
v0.10.0:
image_name: lm/vllm:test
+2 -5
View File
@@ -46,10 +46,7 @@ const BasicForm: React.FC<AddModalProps> = ({ action, currentData }) => {
>
<SealInput.Input
trim
placeholder={intl.formatMessage(
{ id: 'common.help.default' },
{ content: `/${GPUSTACK_API_BASE_URL}/models` }
)}
placeholder={`/${GPUSTACK_API_BASE_URL}/models`}
label={intl.formatMessage({ id: 'backend.form.healthCheckPath' })}
></SealInput.Input>
</Form.Item>
@@ -64,7 +61,7 @@ const BasicForm: React.FC<AddModalProps> = ({ action, currentData }) => {
{ id: 'common.help.eg' },
{
content:
'vllm serve {{model_path}} --port {{port}} --served-model-name {{model_name}}'
'vllm serve {{model_path}} --port {{port}} --worker-ip {{worker_ip}} --served-model-name {{model_name}}'
}
)}
autoSize={{ minRows: 2, maxRows: 4 }}
@@ -54,15 +54,5 @@ export default [
icon: icons.AliCloud,
description: 'cluster.provider.comingsoon',
group: 'clusters.create.provider.cloud'
},
{
label: 'Tencent Cloud',
locale: false,
disabled: true,
value: ProviderValueMap.TencentCloud,
key: ProviderValueMap.TencentCloud,
icon: icons.TencentCloud,
description: 'cluster.provider.comingsoon',
group: 'clusters.create.provider.cloud'
}
];
@@ -4,6 +4,9 @@ import mindieParameters from './mindie';
import sglangParameters from './sglang';
import vllmParameters from './vllm';
/**
* backend label map
*/
export const backendOptionsMap = {
llamaBox: 'llama-box',
vllm: 'vLLM',
+5 -4
View File
@@ -4,19 +4,19 @@ import { backendOptionsMap } from './backend-parameters';
export const backendTipsList = [
{
title: 'vLLM',
title: backendOptionsMap.vllm,
tips: 'models.form.backend.vllm'
},
{
title: 'SGLang',
title: backendOptionsMap.SGLang,
tips: 'models.form.backend.sglang'
},
{
title: 'Ascend MindIE',
title: backendOptionsMap.ascendMindie,
tips: 'models.form.backend.mindie'
},
{
title: 'vox-box',
title: backendOptionsMap.voxBox,
tips: 'models.form.backend.voxbox'
}
];
@@ -356,6 +356,7 @@ export const DO_NOT_TRIGGER_CHECK_COMPATIBILITY = [
'run_command',
'image_name',
'extended_kv_cache.enabled',
'extended_kv_cache.ram_size',
'speculative_config.enabled',
'speculative_config.draft_model'
];
-9
View File
@@ -5,7 +5,6 @@ import useAppUtils from '@/hooks/use-app-utils';
import { useIntl } from '@umijs/max';
import { Form, Typography } from 'antd';
import React, { useMemo } from 'react';
import styled from 'styled-components';
import {
backendLabelMap,
backendTipsList,
@@ -14,14 +13,6 @@ import {
import { backendOptionsMap } from '../config/backend-parameters';
import { useFormContext } from '../config/form-context';
const Box = styled.div`
&.default-backend {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}
`;
const BackendFields: React.FC = () => {
const intl = useIntl();
const { getRuleMessage } = useAppUtils();
+1 -1
View File
@@ -55,7 +55,7 @@ const CustomBackend: React.FC = () => {
{ id: 'common.help.eg' },
{
content:
'vllm serve {{model_path}} --port {{port}} --served-model-name {{model_name}}'
'vllm serve {{model_path}} --port {{port}} --worker-ip {{worker_ip}} --served-model-name {{model_name}}'
}
)}
></SealTextArea>
+1 -1
View File
@@ -454,7 +454,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
enabled: false,
algorithm: '',
draft_model: null,
num_draft_tokens: 3,
num_draft_tokens: 4,
ngram_min_match_length: 1,
ngram_max_match_length: 10
},
+18 -1
View File
@@ -2,6 +2,7 @@ import CheckboxField from '@/components/seal-form/checkbox-field';
import SealInputNumber from '@/components/seal-form/input-number';
import { useIntl } from '@umijs/max';
import { Form } from 'antd';
import _ from 'lodash';
import { useMemo, useRef } from 'react';
import { backendOptionsMap } from '../config/backend-parameters';
import { useFormContext } from '../config/form-context';
@@ -50,6 +51,22 @@ const KVCacheForm = () => {
}
};
const handleRamSizeInput = (value: number | null | string) => {
if (!value) {
form.setFieldValue(['extended_kv_cache', 'ram_size'], null);
} else {
form.setFieldValue(['extended_kv_cache', 'ram_size'], _.round(value));
}
onValuesChange?.(
{
extended_kv_cache: {
ram_size: value
}
},
form.getFieldsValue()
);
};
const builtInBackend = useMemo(() => {
const currentBackend = backendOptions.find(
(item) => item.value === backend
@@ -96,7 +113,7 @@ const KVCacheForm = () => {
</Form.Item>
<Form.Item<FormData> name={['extended_kv_cache', 'ram_size']}>
<SealInputNumber
onChange={(value) => handleRamRatioChange(value, 'ram_size')}
onInput={(value) => handleRamSizeInput(value)}
label={intl.formatMessage({ id: 'models.form.ramSize' })}
description={intl.formatMessage(
{
@@ -49,7 +49,7 @@ const SpeculativeDecode = () => {
algorithm:
speculativeConfigRef.current.algorithm || AlgorithmMap.Eagle3,
draft_model: speculativeConfigRef.current.draft_model || '',
num_draft_tokens: speculativeConfigRef.current.num_draft_tokens || 3,
num_draft_tokens: speculativeConfigRef.current.num_draft_tokens || 4,
ngram_min_match_length:
speculativeConfigRef.current.ngram_min_match_length || 1,
ngram_max_match_length:
+15 -27
View File
@@ -27,30 +27,25 @@ const API_MAP: Record<
[modelCategoriesMap.embedding]: {
api: EMBEDDING_API,
parameters: {
query: 'What are the benefits of regular exercise?',
documents: [
'Regular physical activity helps improve cardiovascular health and mental well-being.',
'Eating too much sugar can lead to health issues.',
'Exercise is often done in gyms or outdoors.'
]
query: '',
documents: []
},
generateCurlCode: generateEmbeddingCurlCode
},
[modelCategoriesMap.llm]: {
api: CHAT_API,
parameters: {
messages: [
{
role: 'user',
content: 'Hello, introduce yourself'
}
]
messages: []
},
generateCurlCode: generateLLmCurlCode
},
[modelCategoriesMap.image]: {
api: CREAT_IMAGE_API,
parameters: {},
parameters: {
n: 1,
size: '512x512',
response_format: 'b64_json'
},
generateCurlCode: generateImageCurlCode
},
[modelCategoriesMap.text_to_speech]: {
@@ -63,18 +58,15 @@ const API_MAP: Record<
},
[modelCategoriesMap.speech_to_text]: {
api: AUDIO_SPEECH_TO_TEXT_API,
parameters: {},
parameters: {
language: 'auto'
},
generateCurlCode: generateSpeechToTextCurlCode
},
[modelCategoriesMap.reranker]: {
api: RERANKER_API,
parameters: {
messages: [
{
role: 'user',
content: 'Hello, introduce yourself'
}
]
messages: []
},
generateCurlCode: generateRerankCurlCode
}
@@ -102,12 +94,7 @@ const useGenericProxy = () => {
category: modelCategoriesMap.llm,
api: CHAT_API,
parameters: {
messages: [
{
role: 'user',
content: 'Hello, introduce yourself'
}
]
messages: []
},
generateCurlCode: generateLLmCurlCode
};
@@ -123,7 +110,8 @@ const useGenericProxy = () => {
api,
modelProxy: true,
parameters: {
model: data?.name || ''
model: data?.name || '',
...parameters
}
})
});