style: adjust some ui statements
This commit is contained in:
@@ -5,7 +5,6 @@ import useAppUtils from '@/hooks/use-app-utils';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form, Typography } from 'antd';
|
||||
import React, { useMemo } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import {
|
||||
backendLabelMap,
|
||||
backendTipsList,
|
||||
@@ -14,14 +13,6 @@ import {
|
||||
import { backendOptionsMap } from '../config/backend-parameters';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
|
||||
const Box = styled.div`
|
||||
&.default-backend {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16px;
|
||||
}
|
||||
`;
|
||||
|
||||
const BackendFields: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
const { getRuleMessage } = useAppUtils();
|
||||
|
||||
@@ -55,7 +55,7 @@ const CustomBackend: React.FC = () => {
|
||||
{ id: 'common.help.eg' },
|
||||
{
|
||||
content:
|
||||
'vllm serve {{model_path}} --port {{port}} --served-model-name {{model_name}}'
|
||||
'vllm serve {{model_path}} --port {{port}} --worker-ip {{worker_ip}} --served-model-name {{model_name}}'
|
||||
}
|
||||
)}
|
||||
></SealTextArea>
|
||||
|
||||
@@ -454,7 +454,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
enabled: false,
|
||||
algorithm: '',
|
||||
draft_model: null,
|
||||
num_draft_tokens: 3,
|
||||
num_draft_tokens: 4,
|
||||
ngram_min_match_length: 1,
|
||||
ngram_max_match_length: 10
|
||||
},
|
||||
|
||||
@@ -2,6 +2,7 @@ import CheckboxField from '@/components/seal-form/checkbox-field';
|
||||
import SealInputNumber from '@/components/seal-form/input-number';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import { useMemo, useRef } from 'react';
|
||||
import { backendOptionsMap } from '../config/backend-parameters';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
@@ -50,6 +51,22 @@ const KVCacheForm = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleRamSizeInput = (value: number | null | string) => {
|
||||
if (!value) {
|
||||
form.setFieldValue(['extended_kv_cache', 'ram_size'], null);
|
||||
} else {
|
||||
form.setFieldValue(['extended_kv_cache', 'ram_size'], _.round(value));
|
||||
}
|
||||
onValuesChange?.(
|
||||
{
|
||||
extended_kv_cache: {
|
||||
ram_size: value
|
||||
}
|
||||
},
|
||||
form.getFieldsValue()
|
||||
);
|
||||
};
|
||||
|
||||
const builtInBackend = useMemo(() => {
|
||||
const currentBackend = backendOptions.find(
|
||||
(item) => item.value === backend
|
||||
@@ -96,7 +113,7 @@ const KVCacheForm = () => {
|
||||
</Form.Item>
|
||||
<Form.Item<FormData> name={['extended_kv_cache', 'ram_size']}>
|
||||
<SealInputNumber
|
||||
onChange={(value) => handleRamRatioChange(value, 'ram_size')}
|
||||
onInput={(value) => handleRamSizeInput(value)}
|
||||
label={intl.formatMessage({ id: 'models.form.ramSize' })}
|
||||
description={intl.formatMessage(
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ const SpeculativeDecode = () => {
|
||||
algorithm:
|
||||
speculativeConfigRef.current.algorithm || AlgorithmMap.Eagle3,
|
||||
draft_model: speculativeConfigRef.current.draft_model || '',
|
||||
num_draft_tokens: speculativeConfigRef.current.num_draft_tokens || 3,
|
||||
num_draft_tokens: speculativeConfigRef.current.num_draft_tokens || 4,
|
||||
ngram_min_match_length:
|
||||
speculativeConfigRef.current.ngram_min_match_length || 1,
|
||||
ngram_max_match_length:
|
||||
|
||||
Reference in New Issue
Block a user