diff --git a/src/pages/benchmark/components/left-actions.tsx b/src/pages/benchmark/components/left-actions.tsx index 75b83a92..87eba1bb 100644 --- a/src/pages/benchmark/components/left-actions.tsx +++ b/src/pages/benchmark/components/left-actions.tsx @@ -1,4 +1,5 @@ import BaseSelect from '@/components/seal-form/base/select'; +import { modelCategoriesMap } from '@/pages/llmodels/config'; import { SearchOutlined, SyncOutlined } from '@ant-design/icons'; import { useIntl } from '@umijs/max'; import { Button, Input, Space } from 'antd'; @@ -31,6 +32,15 @@ const RightActions: React.FC = ({ const handleGPUChange = debounceUpdateFilter; + const modelOptions = modelList + ?.filter((item) => { + return item.categories.includes(modelCategoriesMap.llm); + }) + .map((item) => ({ + label: item.label, + value: item.label + })); + return ( = ({ id: 'benchmark.table.filter.bymodel' })} style={{ width: 200 }} - options={modelList} + options={modelOptions} onChange={(value, option) => handleQueryChange({ model_name: value, diff --git a/src/pages/benchmark/components/row-actions.tsx b/src/pages/benchmark/components/row-actions.tsx index 36dc93fd..41cbd966 100644 --- a/src/pages/benchmark/components/row-actions.tsx +++ b/src/pages/benchmark/components/row-actions.tsx @@ -33,6 +33,7 @@ const actionList = [ { key: 'export', label: 'benchmark.table.export.results', + status: [BenchmarkStatusValueMap.Completed], icon: ( ) diff --git a/src/pages/benchmark/components/summary/instance.tsx b/src/pages/benchmark/components/summary/instance.tsx index 7062c6b7..c941b4ff 100644 --- a/src/pages/benchmark/components/summary/instance.tsx +++ b/src/pages/benchmark/components/summary/instance.tsx @@ -123,6 +123,23 @@ const Instance: React.FC = () => { ) }, + { + key: '2', + label: intl.formatMessage({ id: 'models.form.env' }), + children: ( + + {instanceData?.env + ? Object.entries(instanceData?.env || {}).map( + ([key, value], index: number) => ( + + {`${key}=${value}`} + + ) + ) + : '-'} + + ) + }, { key: '4', label: intl.formatMessage({ @@ -158,23 +175,6 @@ const Instance: React.FC = () => { )} ) - }, - { - key: '2', - label: intl.formatMessage({ id: 'models.form.env' }), - children: ( - - {instanceData?.env - ? Object.entries(instanceData?.env || {}).map( - ([key, value], index: number) => ( - - {`${key}=${value}`} - - ) - ) - : '-'} - - ) } ]; }, [detailData]); diff --git a/src/pages/benchmark/forms/dataset.tsx b/src/pages/benchmark/forms/dataset.tsx index 8dd887e9..2b0e11bc 100644 --- a/src/pages/benchmark/forms/dataset.tsx +++ b/src/pages/benchmark/forms/dataset.tsx @@ -99,7 +99,7 @@ const DatasetForm: React.FC = () => { : false } > - {intl.formatMessage({ id: item?.label || '' })} + {item?.label} ))} diff --git a/src/pages/benchmark/hooks/use-benchmark-columns.tsx b/src/pages/benchmark/hooks/use-benchmark-columns.tsx index 3a7d8e68..c09633cf 100644 --- a/src/pages/benchmark/hooks/use-benchmark-columns.tsx +++ b/src/pages/benchmark/hooks/use-benchmark-columns.tsx @@ -20,7 +20,11 @@ const useBenchmarkColumns = (params: { return useMemo(() => { return [ { - title: intl.formatMessage({ id: 'common.table.name' }), + title: ( + + {intl.formatMessage({ id: 'common.table.name' })} + + ), dataIndex: 'name', sorter: tableSorter(1), render: (text: string, record) => ( @@ -33,7 +37,11 @@ const useBenchmarkColumns = (params: { }, ...columns, { - title: intl.formatMessage({ id: 'common.table.operation' }), + title: ( + + {intl.formatMessage({ id: 'common.table.operation' })} + + ), dataIndex: 'operations', ellipsis: { showTitle: false diff --git a/src/pages/benchmark/hooks/use-column-settings.tsx b/src/pages/benchmark/hooks/use-column-settings.tsx index 16670039..7fe04bcf 100644 --- a/src/pages/benchmark/hooks/use-column-settings.tsx +++ b/src/pages/benchmark/hooks/use-column-settings.tsx @@ -178,7 +178,7 @@ const useColumnSettings = (options: { sorter: tableSorter(1), render: (text: string) => ( - {_.round(text, 0)} + {_.round(text, 2)} ) }, @@ -253,8 +253,11 @@ const useColumnSettings = (options: { const metadataColumns = [ { - title: renderTitle(intl.formatMessage({ id: 'clusters.title' })), - pos: 1, + title: ( + + {intl.formatMessage({ id: 'clusters.title' })} + + ), dataIndex: 'cluster_id', render: (text: number) => ( @@ -353,7 +356,7 @@ const useColumnSettings = (options: { (fieldSortPos[a.dataIndex] || 0) - (fieldSortPos[b.dataIndex] || 0) ); return selected; - }, [selectedColumns, clusterList]); + }, [selectedColumns, clusterList, intl, profileOptions]); const SettingsButton = ( { }); const handleExportData = () => { - const firstSelectedRow = dataSource.dataList.find( - (item) => item.id === rowSelection.selectedRowKeys[0] - ); - const name = firstSelectedRow ? firstSelectedRow.name : 'benchmark'; - exportData(rowSelection.selectedRowKeys, name); + exportData(rowSelection.selectedRowKeys); }; return ( diff --git a/src/pages/benchmark/services/use-export-benchmark.ts b/src/pages/benchmark/services/use-export-benchmark.ts index a21435fe..83eade3f 100644 --- a/src/pages/benchmark/services/use-export-benchmark.ts +++ b/src/pages/benchmark/services/use-export-benchmark.ts @@ -13,7 +13,7 @@ const matchFilename = (disposition: string | null): string | undefined => { }; export function useExportBenchmark() { - const exportData = async (data: any[], name: string) => { + const exportData = async (data: any[], name?: string) => { const date = dayjs().format('YYYYMMDD_HHmmss'); const fileName = `${name || 'benchmark'}_${date}`; try { diff --git a/src/pages/benchmark/services/use-query-profiles.ts b/src/pages/benchmark/services/use-query-profiles.ts index 462f3678..825ac468 100644 --- a/src/pages/benchmark/services/use-query-profiles.ts +++ b/src/pages/benchmark/services/use-query-profiles.ts @@ -31,8 +31,9 @@ export default function useQueryProfiles() { const list = res?.profiles?.map((item) => { + const label = profileMap.get(item.name)?.label; return { - label: profileMap.get(item.name)?.label || item.name, + label: label ? intl.formatMessage({ id: label }) : item.name, tips: profileMap.get(item.name)?.tips || '', value: item.name, config: {