fix: remove invalid parameter

This commit is contained in:
jialin
2024-10-24 10:25:18 +08:00
parent 90350f99ad
commit b463eedb3f
5 changed files with 39 additions and 6 deletions
+4
View File
@@ -708,6 +708,10 @@ body {
.ant-pro-page-container { .ant-pro-page-container {
background: transparent; background: transparent;
.ant-page-header-heading {
min-width: max-content;
}
} }
@keyframes skeleton-loading { @keyframes skeleton-loading {
@@ -1,3 +1,4 @@
import AutoTooltip from '@/components/auto-tooltip';
import PageTools from '@/components/page-tools'; import PageTools from '@/components/page-tools';
import { convertFileSize } from '@/utils'; import { convertFileSize } from '@/utils';
import { useIntl } from '@umijs/max'; import { useIntl } from '@umijs/max';
@@ -12,18 +13,27 @@ const ActiveTable = () => {
{ {
title: intl.formatMessage({ id: 'common.table.name' }), title: intl.formatMessage({ id: 'common.table.name' }),
dataIndex: 'name', dataIndex: 'name',
key: 'name' key: 'name',
ellipsis: true,
render: (text: any, record: any) => {
return (
<AutoTooltip ghost>
<span>{text}</span>
</AutoTooltip>
);
}
}, },
{ {
title: intl.formatMessage({ id: 'dashboard.allocatevram' }), title: intl.formatMessage({ id: 'dashboard.allocatevram' }),
dataIndex: 'resource_claim.memory', dataIndex: 'resource_claim.memory',
key: 'vram', key: 'vram',
ellipsis: true,
render: (text: any, record: any) => { render: (text: any, record: any) => {
return ( return (
<span> <AutoTooltip ghost>
{convertFileSize(record.resource_claim?.vram || 0)} /{' '} {convertFileSize(record.resource_claim?.vram || 0)} /{' '}
{convertFileSize(record.resource_claim?.ram || 0)} {convertFileSize(record.resource_claim?.ram || 0)}
</span> </AutoTooltip>
); );
} }
}, },
@@ -35,7 +45,15 @@ const ActiveTable = () => {
{ {
title: intl.formatMessage({ id: 'dashboard.tokens' }), title: intl.formatMessage({ id: 'dashboard.tokens' }),
dataIndex: 'token_count', dataIndex: 'token_count',
key: 'token_count' key: 'token_count',
ellipsis: true,
render: (text: any, record: any) => {
return (
<AutoTooltip ghost>
<span>{text}</span>
</AutoTooltip>
);
}
} }
]; ];
return ( return (
@@ -62,7 +62,8 @@ const GroundLeft: React.FC<MessageProps> = forwardRef((props, ref) => {
}, },
setCollapse() { setCollapse() {
setCollapse(!collapse); setCollapse(!collapse);
} },
collapse: collapse
}; };
}); });
@@ -29,7 +29,6 @@ const MultiCompare: React.FC<MultiCompareProps> = ({ modelList, loaded }) => {
stop: null, stop: null,
temperature: 1, temperature: 1,
top_p: 1, top_p: 1,
top_n: 0,
max_tokens: 1024 max_tokens: 1024
}); });
const [spans, setSpans] = useState<{ const [spans, setSpans] = useState<{
+11
View File
@@ -1,5 +1,7 @@
import IconFont from '@/components/icon-font'; import IconFont from '@/components/icon-font';
import breakpoints from '@/config/breakpoints';
import HotKeys from '@/config/hotkeys'; import HotKeys from '@/config/hotkeys';
import useWindowResize from '@/hooks/use-window-resize';
import { MessageOutlined, OneToOneOutlined } from '@ant-design/icons'; import { MessageOutlined, OneToOneOutlined } from '@ant-design/icons';
import { PageContainer } from '@ant-design/pro-components'; import { PageContainer } from '@ant-design/pro-components';
import { useIntl } from '@umijs/max'; import { useIntl } from '@umijs/max';
@@ -16,6 +18,7 @@ import './style/play-ground.less';
const Playground: React.FC = () => { const Playground: React.FC = () => {
const intl = useIntl(); const intl = useIntl();
const { size } = useWindowResize();
const [activeKey, setActiveKey] = useState('chat'); const [activeKey, setActiveKey] = useState('chat');
const groundLeftRef = useRef<any>(null); const groundLeftRef = useRef<any>(null);
const groundRerankerRef = useRef<any>(null); const groundRerankerRef = useRef<any>(null);
@@ -80,6 +83,14 @@ const Playground: React.FC = () => {
} }
]; ];
useEffect(() => {
if (size.width < breakpoints.lg) {
if (!groundLeftRef.current?.collapse) {
groundLeftRef.current?.setCollapse?.();
}
}
}, [size.width]);
useEffect(() => { useEffect(() => {
const getModelList = async () => { const getModelList = async () => {
try { try {