fix: draft model local path do not search

This commit is contained in:
jialin
2025-11-03 14:22:52 +08:00
parent e66ee5d3f1
commit 4bbae673dc
5 changed files with 12 additions and 3 deletions
+1
View File
@@ -350,6 +350,7 @@ export const DO_NOT_TRIGGER_CHECK_COMPATIBILITY = [
'run_command', 'run_command',
'image_name', 'image_name',
'extended_kv_cache.enabled', 'extended_kv_cache.enabled',
'speculative_config.enabled',
'speculative_config.draft_model' 'speculative_config.draft_model'
]; ];
-1
View File
@@ -222,7 +222,6 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
..._.omit(data, ['scheduleType']), ..._.omit(data, ['scheduleType']),
...gpuSelector ...gpuSelector
}; };
onOk(allValues); onOk(allValues);
}; };
+1
View File
@@ -36,6 +36,7 @@ const KVCacheForm = () => {
(item) => item.value === backend (item) => item.value === backend
); );
// FIXMEremove formKey check after all built-in backends support KV cache
return ( return (
(currentBackend?.isBuiltIn || formKey === DeployFormKeyMap.CATALOG) && (currentBackend?.isBuiltIn || formKey === DeployFormKeyMap.CATALOG) &&
[backendOptionsMap.SGLang, backendOptionsMap.vllm].includes( [backendOptionsMap.SGLang, backendOptionsMap.vllm].includes(
@@ -6,6 +6,7 @@ import SealSelect from '@/components/seal-form/seal-select';
import useAppUtils from '@/hooks/use-app-utils'; import useAppUtils from '@/hooks/use-app-utils';
import { useIntl } from '@umijs/max'; import { useIntl } from '@umijs/max';
import { Form } from 'antd'; import { Form } from 'antd';
import _ from 'lodash';
import { useRef } from 'react'; import { useRef } from 'react';
import { useFormContext } from '../config/form-context'; import { useFormContext } from '../config/form-context';
import { FormData } from '../config/types'; import { FormData } from '../config/types';
@@ -19,7 +20,7 @@ const AlgorithmMap = {
const SpeculativeDecode = () => { const SpeculativeDecode = () => {
const intl = useIntl(); const intl = useIntl();
const { source } = useFormContext(); const { source, onValuesChange } = useFormContext();
const { getRuleMessage } = useAppUtils(); const { getRuleMessage } = useAppUtils();
const form = Form.useFormInstance(); const form = Form.useFormInstance();
const speculativeEnabled = Form.useWatch( const speculativeEnabled = Form.useWatch(
@@ -34,6 +35,11 @@ const SpeculativeDecode = () => {
source source
}); });
const onValuesChangeDebounced = _.debounce(() => {
const allValues = form.getFieldsValue();
onValuesChange?.({}, allValues);
}, 200);
const handleSpeculativeEnabledChange = (e: any) => { const handleSpeculativeEnabledChange = (e: any) => {
if (e.target.checked) { if (e.target.checked) {
form.setFieldValue('speculative_config', { form.setFieldValue('speculative_config', {
@@ -49,6 +55,7 @@ const SpeculativeDecode = () => {
}); });
} else { } else {
speculativeConfigRef.current = form.getFieldValue('speculative_config'); speculativeConfigRef.current = form.getFieldValue('speculative_config');
onValuesChangeDebounced();
} }
}; };
@@ -149,8 +149,9 @@ export default function useQueryDraftModels({ source }: { source: string }) {
} }
}; };
// local path starts with /
const handleOnSearch = async (value: string) => { const handleOnSearch = async (value: string) => {
if (!value) { if (!value || value?.trim?.().startsWith('/')) {
setDraftModelList(presetDraftModelListRef.current); setDraftModelList(presetDraftModelListRef.current);
return; return;
} }