fix: draft model local path do not search
This commit is contained in:
@@ -350,6 +350,7 @@ export const DO_NOT_TRIGGER_CHECK_COMPATIBILITY = [
|
||||
'run_command',
|
||||
'image_name',
|
||||
'extended_kv_cache.enabled',
|
||||
'speculative_config.enabled',
|
||||
'speculative_config.draft_model'
|
||||
];
|
||||
|
||||
|
||||
@@ -222,7 +222,6 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
..._.omit(data, ['scheduleType']),
|
||||
...gpuSelector
|
||||
};
|
||||
|
||||
onOk(allValues);
|
||||
};
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ const KVCacheForm = () => {
|
||||
(item) => item.value === backend
|
||||
);
|
||||
|
||||
// FIXME:remove formKey check after all built-in backends support KV cache
|
||||
return (
|
||||
(currentBackend?.isBuiltIn || formKey === DeployFormKeyMap.CATALOG) &&
|
||||
[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 { useIntl } from '@umijs/max';
|
||||
import { Form } from 'antd';
|
||||
import _ from 'lodash';
|
||||
import { useRef } from 'react';
|
||||
import { useFormContext } from '../config/form-context';
|
||||
import { FormData } from '../config/types';
|
||||
@@ -19,7 +20,7 @@ const AlgorithmMap = {
|
||||
|
||||
const SpeculativeDecode = () => {
|
||||
const intl = useIntl();
|
||||
const { source } = useFormContext();
|
||||
const { source, onValuesChange } = useFormContext();
|
||||
const { getRuleMessage } = useAppUtils();
|
||||
const form = Form.useFormInstance();
|
||||
const speculativeEnabled = Form.useWatch(
|
||||
@@ -34,6 +35,11 @@ const SpeculativeDecode = () => {
|
||||
source
|
||||
});
|
||||
|
||||
const onValuesChangeDebounced = _.debounce(() => {
|
||||
const allValues = form.getFieldsValue();
|
||||
onValuesChange?.({}, allValues);
|
||||
}, 200);
|
||||
|
||||
const handleSpeculativeEnabledChange = (e: any) => {
|
||||
if (e.target.checked) {
|
||||
form.setFieldValue('speculative_config', {
|
||||
@@ -49,6 +55,7 @@ const SpeculativeDecode = () => {
|
||||
});
|
||||
} else {
|
||||
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) => {
|
||||
if (!value) {
|
||||
if (!value || value?.trim?.().startsWith('/')) {
|
||||
setDraftModelList(presetDraftModelListRef.current);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user