fix(style): unify casing of system terms

This commit is contained in:
jialin
2025-04-08 13:28:13 +08:00
parent a087677c6e
commit f6bc183972
19 changed files with 109 additions and 69 deletions
@@ -21,6 +21,7 @@ import { CheckboxChangeEvent } from 'antd/es/checkbox';
import _ from 'lodash';
import React, { useCallback, useMemo } from 'react';
import {
backendLabelMap,
backendOptionsMap,
backendParamsHolderTips,
modelCategories,
@@ -327,7 +328,7 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
id: 'models.form.backendVersion.tips'
},
{
backend: backend,
backend: backendLabelMap[backend],
link: backendParamsTips?.releases && (
<span
style={{
@@ -336,7 +337,7 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
>
<Typography.Link
className="flex-center"
style={{ lineHeight: 1 }}
style={{ display: 'inline' }}
href={backendParamsTips?.releases}
target="_blank"
>
@@ -375,12 +376,13 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
options={paramsConfig}
description={
backendParamsTips && (
<span>
<span style={{ marginLeft: 5 }}>
{intl.formatMessage(
{ id: 'models.form.backend_parameters.vllm.tips' },
{ backend: backendParamsTips.backend || '' }
)}{' '}
<Typography.Link
style={{ display: 'inline' }}
className="flex-center"
href={backendParamsTips.link}
target="_blank"
@@ -85,7 +85,8 @@ const CompatibilityAlert: React.FC<CompatibilityAlertProps> = (props) => {
}, [type]);
return (
show && (
show &&
!!message && (
<DivWrapper>
<AlertBlockInfo
ellipsis={false}
+5 -4
View File
@@ -9,6 +9,7 @@ import { Form } from 'antd';
import _ from 'lodash';
import React, { forwardRef, useImperativeHandle } from 'react';
import {
backendLabelMap,
backendOptionsMap,
backendTipsList,
excludeFields,
@@ -259,7 +260,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
options={
backendOptions ?? [
{
label: `llama-box`,
label: backendLabelMap[backendOptionsMap.llamaBox],
value: backendOptionsMap.llamaBox,
disabled:
props.source === modelSourceMap.local_path_value
@@ -267,7 +268,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
: !isGGUF
},
{
label: 'vLLM',
label: backendLabelMap[backendOptionsMap.vllm],
value: backendOptionsMap.vllm,
disabled:
props.source === modelSourceMap.local_path_value
@@ -275,7 +276,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
: isGGUF
},
{
label: 'Ascend Mindie',
label: backendLabelMap[backendOptionsMap.ascendMindie],
value: backendOptionsMap.ascendMindie,
disabled:
props.source === modelSourceMap.local_path_value
@@ -283,7 +284,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
: isGGUF
},
{
label: 'vox-box',
label: backendLabelMap[backendOptionsMap.voxBox],
value: backendOptionsMap.voxBox,
disabled:
props.source === modelSourceMap.local_path_value
@@ -10,6 +10,7 @@ import React, {
useRef,
useState
} from 'react';
import styled from 'styled-components';
import {
evaluationsModelSpec,
queryHuggingfaceModels,
@@ -26,6 +27,12 @@ import SearchStyle from '../style/search-result.less';
import SearchInput from './search-input';
import SearchResult from './search-result';
const UL = styled.ul`
list-style: decimal;
padding-left: 16px;
margin: 0;
`;
interface SearchInputProps {
hasLinuxWorker?: boolean;
modelSource: string;
@@ -315,7 +322,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
<Tooltip
overlayInnerStyle={{ width: 'max-content' }}
title={
<ul className="tips-desc-list">
<UL>
<li>{intl.formatMessage({ id: 'models.search.gguf.tips' })}</li>
<li>{intl.formatMessage({ id: 'models.search.vllm.tips' })}</li>
<li>
@@ -323,7 +330,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
id: 'models.search.voxbox.tips'
})}
</li>
</ul>
</UL>
}
>
GGUF
@@ -12,6 +12,7 @@ import { Button, Form, Modal, Typography } from 'antd';
import _ from 'lodash';
import React, { useEffect, useMemo, useRef } from 'react';
import {
backendLabelMap,
backendOptionsMap,
backendTipsList,
excludeFields,
@@ -504,7 +505,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
description={<TooltipList list={backendTipsList}></TooltipList>}
options={[
{
label: `llama-box`,
label: backendLabelMap[backendOptionsMap.llamaBox],
value: backendOptionsMap.llamaBox,
disabled:
formData?.source === modelSourceMap.local_path_value
@@ -512,7 +513,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
: !isGGUF
},
{
label: 'vLLM',
label: backendLabelMap[backendOptionsMap.vllm],
value: backendOptionsMap.vllm,
disabled:
formData?.source === modelSourceMap.local_path_value
@@ -520,7 +521,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
: isGGUF
},
{
label: 'Ascend Mindie',
label: backendLabelMap[backendOptionsMap.ascendMindie],
value: backendOptionsMap.ascendMindie,
disabled:
formData?.source === modelSourceMap.local_path_value
@@ -528,7 +529,7 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
: isGGUF
},
{
label: 'vox-box',
label: backendLabelMap[backendOptionsMap.voxBox],
value: backendOptionsMap.voxBox,
disabled:
formData?.source === modelSourceMap.local_path_value
+7
View File
@@ -135,6 +135,13 @@ export const backendOptionsMap = {
ascendMindie: 'ascend-mindie'
};
export const backendLabelMap = {
[backendOptionsMap.llamaBox]: 'llama-box',
[backendOptionsMap.vllm]: 'vLLM',
[backendOptionsMap.voxBox]: 'vox-box',
[backendOptionsMap.ascendMindie]: 'Ascend MindIE'
};
export const backendParamsHolderTips = {
[backendOptionsMap.llamaBox]: {
holder: 'models.form.backend_parameters.llamabox.placeholder',
+2 -2
View File
@@ -307,8 +307,8 @@ export const useCheckCompatibility = () => {
: compatibility_messages?.join(' ')
};
if (hasClaim) {
const ram = convertFileSize(resource_claim.ram, 1);
const vram = convertFileSize(resource_claim.vram, 1);
const ram = convertFileSize(resource_claim.ram, 2);
const vram = convertFileSize(resource_claim.vram, 2);
msgData = {
title: intl.formatMessage({ id: 'models.form.check.passed' }),
message: intl.formatMessage(
@@ -88,6 +88,21 @@ const ParamsSettings: React.FC<ParamsSettingsProps> = forwardRef(
[onValuesChange]
);
const renderDescription = useCallback(
(description: any) => {
let desc = description?.text;
if (description?.isLocalized) {
desc = intl.formatMessage({ id: description?.text });
}
if (description?.html) {
return <div dangerouslySetInnerHTML={{ __html: desc }}></div>;
}
return desc;
},
[intl]
);
const renderFields = useMemo(() => {
if (!paramsConfig?.length) {
return null;
@@ -108,11 +123,7 @@ const ParamsSettings: React.FC<ParamsSettingsProps> = forwardRef(
? item.disabledConfig?.when?.(formValues)
: item.disabled
}
description={
item.description?.isLocalized
? intl.formatMessage({ id: item.description.text })
: item.description?.text
}
description={renderDescription(item.description)}
onChange={null}
{..._.omit(item, [
'name',
+1
View File
@@ -64,5 +64,6 @@ export interface ParamsSchema {
text: string;
html?: boolean;
isLocalized?: boolean;
isLink?: boolean;
};
}
@@ -99,9 +99,9 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
className="font-size-12"
style={{ color: 'var(--ant-color-text-tertiary)' }}
dangerouslySetInnerHTML={{
__html: `(${intl.formatMessage({
__html: `${intl.formatMessage({
id: 'resources.worker.add.step2.tips'
})})`
})}`
}}
></span>
</h3>
@@ -42,7 +42,7 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
className="font-size-12"
style={{ color: 'var(--ant-color-text-tertiary)' }}
dangerouslySetInnerHTML={{
__html: `(${labels.step2Tips})`
__html: `${labels.step2Tips}`
}}
></span>
</h3>