chore: evaluate error message
This commit is contained in:
@@ -147,5 +147,6 @@ export default {
|
|||||||
'models.table.apiAccessInfo.openaiCompatible': 'OpenAI Compatible',
|
'models.table.apiAccessInfo.openaiCompatible': 'OpenAI Compatible',
|
||||||
'models.table.apiAccessInfo.jinaCompatible': 'Jina Compatible',
|
'models.table.apiAccessInfo.jinaCompatible': 'Jina Compatible',
|
||||||
'models.table.apiAccessInfo.gotoCreate': 'Go to Create',
|
'models.table.apiAccessInfo.gotoCreate': 'Go to Create',
|
||||||
'models.search.parts': '{n} parts'
|
'models.search.parts': '{n} parts',
|
||||||
|
'models.search.evaluate.error': 'An error occurred during evaluation: '
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -144,7 +144,8 @@ export default {
|
|||||||
'models.table.apiAccessInfo.openaiCompatible': 'OpenAI Compatible',
|
'models.table.apiAccessInfo.openaiCompatible': 'OpenAI Compatible',
|
||||||
'models.table.apiAccessInfo.jinaCompatible': 'Jina Compatible',
|
'models.table.apiAccessInfo.jinaCompatible': 'Jina Compatible',
|
||||||
'models.table.apiAccessInfo.gotoCreate': 'Go to Create',
|
'models.table.apiAccessInfo.gotoCreate': 'Go to Create',
|
||||||
'models.search.parts': '{n} parts'
|
'models.search.parts': '{n} parts',
|
||||||
|
'models.search.evaluate.error': 'An error occurred during evaluation: '
|
||||||
};
|
};
|
||||||
|
|
||||||
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
||||||
@@ -176,5 +177,6 @@ export default {
|
|||||||
// 26. 'models.form.backend.vllm',
|
// 26. 'models.form.backend.vllm',
|
||||||
// 27. 'models.form.backend.voxbox',
|
// 27. 'models.form.backend.voxbox',
|
||||||
// 28. 'models.form.backend.mindie',
|
// 28. 'models.form.backend.mindie',
|
||||||
// 29. 'models.search.parts'
|
// 29. 'models.search.parts',
|
||||||
|
// 30. 'models.search.evaluate.error',
|
||||||
// ========== End of To-Do List ==========
|
// ========== End of To-Do List ==========
|
||||||
|
|||||||
@@ -148,9 +148,10 @@ export default {
|
|||||||
'models.table.apiAccessInfo.openaiCompatible': 'Совместимо с OpenAI',
|
'models.table.apiAccessInfo.openaiCompatible': 'Совместимо с OpenAI',
|
||||||
'models.table.apiAccessInfo.jinaCompatible': 'Совместимо с Jina',
|
'models.table.apiAccessInfo.jinaCompatible': 'Совместимо с Jina',
|
||||||
'models.table.apiAccessInfo.gotoCreate': 'Перейти к созданию',
|
'models.table.apiAccessInfo.gotoCreate': 'Перейти к созданию',
|
||||||
'models.search.parts': '{n} частей'
|
'models.search.parts': '{n} частей',
|
||||||
|
'models.search.evaluate.error': 'An error occurred during evaluation: '
|
||||||
};
|
};
|
||||||
|
|
||||||
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
||||||
|
// 1. 'models.search.evaluate.error'
|
||||||
// ========== End of To-Do List ==========
|
// ========== End of To-Do List ==========
|
||||||
|
|||||||
@@ -140,5 +140,6 @@ export default {
|
|||||||
'models.table.apiAccessInfo.openaiCompatible': 'OpenAI 兼容',
|
'models.table.apiAccessInfo.openaiCompatible': 'OpenAI 兼容',
|
||||||
'models.table.apiAccessInfo.jinaCompatible': 'Jina 兼容',
|
'models.table.apiAccessInfo.jinaCompatible': 'Jina 兼容',
|
||||||
'models.table.apiAccessInfo.gotoCreate': '去创建',
|
'models.table.apiAccessInfo.gotoCreate': '去创建',
|
||||||
'models.search.parts': '{n} 个文件'
|
'models.search.parts': '{n} 个文件',
|
||||||
|
'models.search.evaluate.error': '评估过程中发生了错误:'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const DivWrapper = styled.div`
|
|||||||
const CloseWrapper = styled.div`
|
const CloseWrapper = styled.div`
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 14px;
|
top: 16px;
|
||||||
right: 28px;
|
right: 28px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@@ -19,12 +19,6 @@ const CompatibleTag = styled(Tag)`
|
|||||||
padding-inline: 0;
|
padding-inline: 0;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const ClaimTag = styled(Tag)`
|
|
||||||
margin: 0;
|
|
||||||
opacity: 0.7;
|
|
||||||
border-radius: var(--border-radius-base);
|
|
||||||
`;
|
|
||||||
|
|
||||||
const IncompatibleInfo = styled.div`
|
const IncompatibleInfo = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -35,10 +29,13 @@ const IncompatibleInfo = styled.div`
|
|||||||
padding-left: 16px;
|
padding-left: 16px;
|
||||||
color: var(--color-white-secondary);
|
color: var(--color-white-secondary);
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
&.error-msg {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
li {
|
li {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
li::before {
|
li.normal::before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
content: '';
|
content: '';
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -56,8 +53,29 @@ const SMTitle = styled.div<{ $isTitle?: boolean }>`
|
|||||||
font-weight: ${(props) => (props.$isTitle ? 'bold' : 'normal')};
|
font-weight: ${(props) => (props.$isTitle ? 'bold' : 'normal')};
|
||||||
font-size: var(--font-size-small);
|
font-size: var(--font-size-small);
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const MessageList = ({
|
||||||
|
messageList,
|
||||||
|
error
|
||||||
|
}: {
|
||||||
|
messageList: string[];
|
||||||
|
error?: boolean;
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<ul className={`${error ? 'error-msg' : ''}`}>
|
||||||
|
{messageList.map((item, index) => (
|
||||||
|
<li key={index} className={`${!error ? 'normal' : 'error'}`}>
|
||||||
|
{item}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const IncompatiableInfo: React.FC<IncompatiableInfoProps> = (props) => {
|
const IncompatiableInfo: React.FC<IncompatiableInfoProps> = (props) => {
|
||||||
const { data, isEvaluating } = props;
|
const { data, isEvaluating } = props;
|
||||||
|
const { error, error_message, compatibility_messages, scheduling_messages } =
|
||||||
|
data || {};
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
if (isEvaluating) {
|
if (isEvaluating) {
|
||||||
@@ -72,30 +90,28 @@ const IncompatiableInfo: React.FC<IncompatiableInfoProps> = (props) => {
|
|||||||
if (!data || data?.compatible) {
|
if (!data || data?.compatible) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
const messageList = [
|
||||||
|
...(compatibility_messages || []),
|
||||||
|
...(scheduling_messages || []),
|
||||||
|
...(error_message ? [error_message] : [])
|
||||||
|
];
|
||||||
return (
|
return (
|
||||||
<TooltipOverlayScroller
|
<TooltipOverlayScroller
|
||||||
maxHeight={200}
|
maxHeight={200}
|
||||||
title={
|
title={
|
||||||
<IncompatibleInfo>
|
<IncompatibleInfo>
|
||||||
<SMTitle $isTitle={true}>
|
<SMTitle $isTitle={true}>
|
||||||
{intl.formatMessage({ id: 'models.form.incompatible' })}
|
{error
|
||||||
|
? intl.formatMessage({ id: 'models.search.evaluate.error' })
|
||||||
|
: intl.formatMessage({ id: 'models.form.incompatible' })}
|
||||||
</SMTitle>
|
</SMTitle>
|
||||||
{
|
<MessageList messageList={messageList} error={error}></MessageList>
|
||||||
<ul>
|
|
||||||
{data?.compatibility_messages.map((item, index) => (
|
|
||||||
<li key={index}>{item}</li>
|
|
||||||
))}
|
|
||||||
{data?.scheduling_messages.map((item, index) => (
|
|
||||||
<li key={index}>{item}</li>
|
|
||||||
))}
|
|
||||||
</ul>
|
|
||||||
}
|
|
||||||
</IncompatibleInfo>
|
</IncompatibleInfo>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<CompatibleTag
|
<CompatibleTag
|
||||||
icon={<WarningOutlined />}
|
icon={<WarningOutlined />}
|
||||||
color="warning"
|
color={error ? 'error' : 'warning'}
|
||||||
bordered={false}
|
bordered={false}
|
||||||
></CompatibleTag>
|
></CompatibleTag>
|
||||||
</TooltipOverlayScroller>
|
</TooltipOverlayScroller>
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
|||||||
token: checkTokenRef.current?.token
|
token: checkTokenRef.current?.token
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
return evaluations.results || [];
|
return evaluations.results;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -218,6 +218,8 @@ export interface EvaluateResult {
|
|||||||
compatibility_messages: string[];
|
compatibility_messages: string[];
|
||||||
scheduling_messages: string[];
|
scheduling_messages: string[];
|
||||||
default_spec: Record<string, any>;
|
default_spec: Record<string, any>;
|
||||||
|
error?: boolean;
|
||||||
|
error_message?: string;
|
||||||
resource_claim?: {
|
resource_claim?: {
|
||||||
ram: number;
|
ram: number;
|
||||||
vram: number;
|
vram: number;
|
||||||
|
|||||||
@@ -292,9 +292,21 @@ export const useCheckCompatibility = () => {
|
|||||||
compatible,
|
compatible,
|
||||||
compatibility_messages = [],
|
compatibility_messages = [],
|
||||||
scheduling_messages = [],
|
scheduling_messages = [],
|
||||||
resource_claim
|
resource_claim,
|
||||||
|
error,
|
||||||
|
error_message
|
||||||
} = evaluateResult || {};
|
} = evaluateResult || {};
|
||||||
|
|
||||||
|
// error message
|
||||||
|
if (error) {
|
||||||
|
return {
|
||||||
|
show: true,
|
||||||
|
type: 'danger',
|
||||||
|
title: intl.formatMessage({ id: 'models.search.evaluate.error' }),
|
||||||
|
message: error_message || ''
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const hasClaim = !!resource_claim?.ram || !!resource_claim?.vram;
|
const hasClaim = !!resource_claim?.ram || !!resource_claim?.vram;
|
||||||
|
|
||||||
let msgData = {
|
let msgData = {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useIntl } from '@umijs/max';
|
|||||||
import { Spin } from 'antd';
|
import { Spin } from 'antd';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import 'overlayscrollbars/overlayscrollbars.css';
|
import 'overlayscrollbars/overlayscrollbars.css';
|
||||||
import {
|
import React, {
|
||||||
forwardRef,
|
forwardRef,
|
||||||
useImperativeHandle,
|
useImperativeHandle,
|
||||||
useMemo,
|
useMemo,
|
||||||
@@ -144,7 +144,7 @@ const GroundLeft: React.FC<MessageProps> = forwardRef((props, ref) => {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
</div>
|
</div>
|
||||||
{tokenResult && (
|
{tokenResult && !loading && (
|
||||||
<div style={{ height: 40 }}>
|
<div style={{ height: 40 }}>
|
||||||
<ReferenceParams usage={tokenResult}></ReferenceParams>
|
<ReferenceParams usage={tokenResult}></ReferenceParams>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -260,7 +260,9 @@ const ModelItem: React.FC<ModelItemProps> = forwardRef((props, ref) => {
|
|||||||
}}
|
}}
|
||||||
></Select>
|
></Select>
|
||||||
</span>
|
</span>
|
||||||
<ReferenceParams usage={tokenResult} scaleable></ReferenceParams>
|
{tokenResult && !loading && (
|
||||||
|
<ReferenceParams usage={tokenResult} scaleable></ReferenceParams>
|
||||||
|
)}
|
||||||
<span className="action">
|
<span className="action">
|
||||||
<Dropdown
|
<Dropdown
|
||||||
menu={{
|
menu={{
|
||||||
|
|||||||
Reference in New Issue
Block a user