style: adjust ram prcision

This commit is contained in:
jialin
2025-11-19 18:47:55 +08:00
parent ca43c0b4b2
commit 2687fb187d
11 changed files with 20 additions and 30 deletions
+1 -1
View File
@@ -274,7 +274,7 @@ export const ExtraContent = () => {
{originNode} {originNode}
<Divider style={{ marginBlock: 4 }} /> <Divider style={{ marginBlock: 4 }} />
<CustomItem onClick={handleLogout} className="border-top"> <CustomItem onClick={handleLogout} className="border-top">
<LogoutOutlined /> <LogoutOutlined rotate={180} />
<span>{intl?.formatMessage?.({ id: 'common.button.logout' })}</span> <span>{intl?.formatMessage?.({ id: 'common.button.logout' })}</span>
</CustomItem> </CustomItem>
</DropdownWrapper> </DropdownWrapper>
+1 -1
View File
@@ -206,7 +206,7 @@ export default {
'models.form.gpusAllocationType.auto': 'Auto', 'models.form.gpusAllocationType.auto': 'Auto',
'models.form.gpusAllocationType.custom': 'Custom', 'models.form.gpusAllocationType.custom': 'Custom',
'models.form.gpusAllocationType.auto.tips': 'models.form.gpusAllocationType.auto.tips':
'System calculates GPUs per replica automatically.', 'The system automatically calculates the GPU count per replica, using powers of two by default and capped by the selected GPUs.',
'models.form.gpusAllocationType.custom.tips': 'models.form.gpusAllocationType.custom.tips':
'You can specify the exact number of GPUs per replica.', 'You can specify the exact number of GPUs per replica.',
'models.mymodels.status.inactive': 'Stopped', 'models.mymodels.status.inactive': 'Stopped',
+2 -2
View File
@@ -206,7 +206,7 @@ export default {
'models.form.gpusAllocationType.auto': 'Auto', 'models.form.gpusAllocationType.auto': 'Auto',
'models.form.gpusAllocationType.custom': 'Custom', 'models.form.gpusAllocationType.custom': 'Custom',
'models.form.gpusAllocationType.auto.tips': 'models.form.gpusAllocationType.auto.tips':
'System calculates GPUs per replica automatically.', 'The system automatically calculates the GPU count per replica, using powers of two by default and capped by the selected GPUs.',
'models.form.gpusAllocationType.custom.tips': 'models.form.gpusAllocationType.custom.tips':
'You can specify the exact number of GPUs per replica.', 'You can specify the exact number of GPUs per replica.',
'models.mymodels.status.inactive': 'Stopped', 'models.mymodels.status.inactive': 'Stopped',
@@ -293,7 +293,7 @@ export default {
// 34. 'models.form.gpusAllocationType': 'GPU Allocation Type', // 34. 'models.form.gpusAllocationType': 'GPU Allocation Type',
// 35. 'models.form.gpusAllocationType.auto': 'Auto', // 35. 'models.form.gpusAllocationType.auto': 'Auto',
// 36. 'models.form.gpusAllocationType.custom': 'Custom', // 36. 'models.form.gpusAllocationType.custom': 'Custom',
// 37. 'models.form.gpusAllocationType.auto.tips': 'System calculates GPUs per replica automatically.', // 37. 'models.form.gpusAllocationType.auto.tips': 'The system automatically calculates the GPU count per replica, using powers of two by default and capped by the selected GPUs.',
// 38. 'models.form.gpusAllocationType.custom.tips': 'You can specify the exact number of GPUs per replica.', // 38. 'models.form.gpusAllocationType.custom.tips': 'You can specify the exact number of GPUs per replica.',
// 39. 'models.mymodels.status.inactive': 'Stopped', // 39. 'models.mymodels.status.inactive': 'Stopped',
// 41. 'models.mymodels.status.degrade': 'Abnormal', // 41. 'models.mymodels.status.degrade': 'Abnormal',
+2 -1
View File
@@ -206,7 +206,7 @@ export default {
'models.form.gpusAllocationType.auto': 'Авто', 'models.form.gpusAllocationType.auto': 'Авто',
'models.form.gpusAllocationType.custom': 'Вручную', 'models.form.gpusAllocationType.custom': 'Вручную',
'models.form.gpusAllocationType.auto.tips': 'models.form.gpusAllocationType.auto.tips':
'Система автоматически рассчитывает количество GPU на реплику.', 'The system automatically calculates the GPU count per replica, using powers of two by default and capped by the selected GPUs.',
'models.form.gpusAllocationType.custom.tips': 'models.form.gpusAllocationType.custom.tips':
'Вы можете указать точное количество GPU на реплику.', 'Вы можете указать точное количество GPU на реплику.',
'models.mymodels.status.inactive': 'Остановлен', 'models.mymodels.status.inactive': 'Остановлен',
@@ -264,4 +264,5 @@ export default {
// 4. 'models.form.backend.voxbox': 'Only supports NVIDIA GPUs and CPUs.', // 4. 'models.form.backend.voxbox': 'Only supports NVIDIA GPUs and CPUs.',
// 5. 'models.form.backend.mindie': 'Only supports Ascend NPUs.', // 5. 'models.form.backend.mindie': 'Only supports Ascend NPUs.',
// 6. 'models.form.backend.sglang': 'Built-in support for NVIDIA/AMD GPUs and Ascend NPUs.', // 6. 'models.form.backend.sglang': 'Built-in support for NVIDIA/AMD GPUs and Ascend NPUs.',
// 7. 'models.form.gpusAllocationType.auto.tips': 'The system automatically calculates the GPU count per replica, using powers of two by default and capped by the selected GPUs.',
// ========== End of To-Do List ========== // ========== End of To-Do List ==========
+3 -3
View File
@@ -195,7 +195,7 @@ export default {
'models.form.gpusAllocationType.auto': '自动', 'models.form.gpusAllocationType.auto': '自动',
'models.form.gpusAllocationType.custom': '自定义', 'models.form.gpusAllocationType.custom': '自定义',
'models.form.gpusAllocationType.auto.tips': 'models.form.gpusAllocationType.auto.tips':
'系统自动计算每个副本的 GPU 数量。', '系统自动计算每个副本的 GPU 数量,默认是 2 的幂,不超过选择的 GPU 数量。',
'models.form.gpusAllocationType.custom.tips': '您可以指定每个副本的 GPU 数量', 'models.form.gpusAllocationType.custom.tips': '您可以指定每个副本的 GPU 数量',
'models.mymodels.status.inactive': '已停止', 'models.mymodels.status.inactive': '已停止',
'models.mymodels.status.degrade': '异常', 'models.mymodels.status.degrade': '异常',
@@ -217,8 +217,8 @@ export default {
'models.form.numDraftTokens': '草稿生成 Token 数', 'models.form.numDraftTokens': '草稿生成 Token 数',
'models.form.ngramMinMatchLength': 'N-gram 最小匹配长度', 'models.form.ngramMinMatchLength': 'N-gram 最小匹配长度',
'models.form.ngramMaxMatchLength': 'N-gram 最大匹配长度', 'models.form.ngramMaxMatchLength': 'N-gram 最大匹配长度',
'models.form.mode.throughput': '吞吐', 'models.form.mode.throughput': '吞吐',
'models.form.mode.latency': '延迟', 'models.form.mode.latency': '延迟',
'models.form.mode.baseline': '标准', 'models.form.mode.baseline': '标准',
'models.form.mode.throughput.tips': '在高并发请求下优化吞吐性能。', 'models.form.mode.throughput.tips': '在高并发请求下优化吞吐性能。',
'models.form.mode.latency.tips': '在低并发请求下优化响应延迟。', 'models.form.mode.latency.tips': '在低并发请求下优化响应延迟。',
@@ -63,20 +63,21 @@ const UtilizationOvertime: React.FC<{
const legendData: string[] = []; const legendData: string[] = [];
const xAxisData: string[] = []; const xAxisData: string[] = [];
let seriesData: { value: number; time: string; type: string }[] = []; let seriesData: { value: number; time: string; type: string }[] = [];
seriesData = _.map(typeList, (item: string) => { seriesData = _.map(typeList, (label: string) => {
const itemConfig = _.get(TypeKeyMap, item, {}); const itemConfig = _.get(TypeKeyMap, label, {});
const name = itemConfig.intl const name = itemConfig.intl
? intl.formatMessage({ id: itemConfig.label }) ? intl.formatMessage({ id: itemConfig.label })
: itemConfig.label; : itemConfig.label;
legendData.push(name); legendData.push(name);
const itemDataList = _.get(data, item, []); const itemDataList = _.get(data, label, []);
return { return {
name: name, name: name,
color: itemConfig.color, color: itemConfig.color,
data: _.map(itemDataList, (item: any) => { data: _.map(itemDataList, (item: any) => {
xAxisData.push(dayjs(item.timestamp * 1000).format('HH:mm:ss')); const time = dayjs(item.timestamp * 1000).format('HH:mm:ss');
xAxisData.push(time);
return { return {
time: dayjs(item.timestamp * 1000).format('HH:mm:ss'), time: item,
value: _.round(_.get(item, 'value', 0), 1) value: _.round(_.get(item, 'value', 0), 1)
}; };
}) })
@@ -57,7 +57,7 @@ const SystemLoad = () => {
const fetchClusters = async () => { const fetchClusters = async () => {
try { try {
const res = await queryClusterList({ page: -1 }); const res = await queryClusterList({ page: -1 });
const options = res.items.map((cluster) => ({ const options = res.items.map((cluster: any) => ({
label: cluster.name, label: cluster.name,
value: cluster.id value: cluster.id
})); }));
+2 -7
View File
@@ -24,7 +24,6 @@ const Catalog: React.FC = () => {
const intl = useIntl(); const intl = useIntl();
const { saveScrollHeight, restoreScrollHeight } = useBodyScroll(); const { saveScrollHeight, restoreScrollHeight } = useBodyScroll();
const navigate = useNavigate(); const navigate = useNavigate();
const [activeId, setActiveId] = React.useState(-1);
const [dataSource, setDataSource] = useState<{ const [dataSource, setDataSource] = useState<{
dataList: CatalogItemType[]; dataList: CatalogItemType[];
loading: boolean; loading: boolean;
@@ -50,7 +49,7 @@ const Catalog: React.FC = () => {
current: {}, current: {},
source: modelSourceMap.huggingface_value source: modelSourceMap.huggingface_value
}); });
const [modelsExpandKeys, setModelsExpandKeys] = useAtom(modelsExpandKeysAtom); const [, setModelsExpandKeys] = useAtom(modelsExpandKeysAtom);
const [, setModelsSession] = useAtom(modelsSessionAtom); const [, setModelsSession] = useAtom(modelsSessionAtom);
const cacheData = React.useRef<CatalogItemType[]>([]); const cacheData = React.useRef<CatalogItemType[]>([]);
const sourceRef = React.useRef<string>(''); const sourceRef = React.useRef<string>('');
@@ -109,7 +108,6 @@ const Catalog: React.FC = () => {
...queryParams, ...queryParams,
...query ...query
}); });
console.log('error', error);
} }
}); });
@@ -119,12 +117,10 @@ const Catalog: React.FC = () => {
show: false show: false
}); });
restoreScrollHeight(); restoreScrollHeight();
setActiveId(-1);
}; };
const handleOnDeploy = useCallback(async (item: CatalogItemType) => { const handleOnDeploy = useCallback(async (item: CatalogItemType) => {
saveScrollHeight(); saveScrollHeight();
setActiveId(item.id);
setOpenDeployModal({ setOpenDeployModal({
show: true, show: true,
source: sourceRef.current, source: sourceRef.current,
@@ -185,7 +181,6 @@ const Catalog: React.FC = () => {
}); });
const handleDeployFromOtherHubs = async () => { const handleDeployFromOtherHubs = async () => {
console.log('sourceRef.current', sourceRef.current);
try { try {
setModelsSession({ setModelsSession({
source: sourceRef.current || modelSourceMap.huggingface_value source: sourceRef.current || modelSourceMap.huggingface_value
@@ -203,7 +198,7 @@ const Catalog: React.FC = () => {
const getCatalogSource = async () => { const getCatalogSource = async () => {
try { try {
const id = dataSource.dataList?.[0]?.id; const id = dataSource.dataList?.[0]?.id;
const res: any = await queryCatalogItemSpec({ id }); const res: any = await queryCatalogItemSpec({ id, cluster_id: 0 });
sourceRef.current = res?.items?.[0]?.source; sourceRef.current = res?.items?.[0]?.source;
} catch (error) {} } catch (error) {}
}; };
+1 -5
View File
@@ -45,14 +45,10 @@ const CheckboxField: React.FC<{
const Scaling: React.FC = () => { const Scaling: React.FC = () => {
const intl = useIntl(); const intl = useIntl();
const { onValuesChange, onQuantizationChange } = useFormContext(); const { onValuesChange } = useFormContext();
const { getRuleMessage } = useAppUtils(); const { getRuleMessage } = useAppUtils();
const form = Form.useFormInstance(); const form = Form.useFormInstance();
const handleOnQuantizationChange = (val: any) => {
onQuantizationChange?.(val);
};
return ( return (
<> <>
<div style={{ paddingBottom: 22, paddingLeft: 10 }}> <div style={{ paddingBottom: 22, paddingLeft: 10 }}>
-3
View File
@@ -11,7 +11,6 @@ import { useIntl } from '@umijs/max';
import { Form } from 'antd'; import { Form } from 'antd';
import { useMemo } from 'react'; import { useMemo } from 'react';
import { sourceOptions } from '../config'; import { sourceOptions } from '../config';
import { useFormContext } from '../config/form-context';
import { FormData } from '../config/types'; import { FormData } from '../config/types';
import BackendForm from './backend'; import BackendForm from './backend';
import CatalogFrom from './catalog'; import CatalogFrom from './catalog';
@@ -39,9 +38,7 @@ const BasicForm: React.FC<BasicFormProps> = (props) => {
onSourceChange onSourceChange
} = props; } = props;
const intl = useIntl(); const intl = useIntl();
const { formKey } = useFormContext();
const { getRuleMessage } = useAppUtils(); const { getRuleMessage } = useAppUtils();
const form = Form.useFormInstance();
const handleOnSourceChange = (val: string) => { const handleOnSourceChange = (val: string) => {
onSourceChange?.(val); onSourceChange?.(val);
+1 -1
View File
@@ -106,7 +106,7 @@ const KVCacheForm = () => {
)} )}
min={0} min={0}
step={1} step={1}
precision={0} precision={1}
/> />
</Form.Item> </Form.Item>
<Form.Item<FormData> name={['extended_kv_cache', 'chunk_size']}> <Form.Item<FormData> name={['extended_kv_cache', 'chunk_size']}>