fix: image stream data error

This commit is contained in:
jialin
2025-01-16 21:51:22 +08:00
parent b14c01f9f7
commit 214c5998c6
7 changed files with 44 additions and 20 deletions
@@ -1,11 +1,18 @@
import AutoTooltip from '@/components/auto-tooltip';
import PageTools from '@/components/page-tools';
import { modelCategoriesMap } from '@/pages/llmodels/config';
import { convertFileSize } from '@/utils';
import { useIntl } from '@umijs/max';
import { Col, Row, Table } from 'antd';
import { memo, useContext } from 'react';
import { DashboardContext } from '../config/dashboard-context';
const NACategories = [
modelCategoriesMap.llm,
modelCategoriesMap.embedding,
modelCategoriesMap.reranker
];
const ActiveTable = () => {
const intl = useIntl();
const data = useContext(DashboardContext).active_models || [];
@@ -48,9 +55,13 @@ const ActiveTable = () => {
key: 'token_count',
ellipsis: true,
render: (text: any, record: any) => {
let val = text;
if (!text) {
val = NACategories.includes(record.category?.[0]) ? 'N/A' : 0;
}
return (
<AutoTooltip ghost>
<span>{text || 'N/A'}</span>
<span>{val}</span>
</AutoTooltip>
);
}