fix: backend option format

This commit is contained in:
jialin
2025-11-04 18:07:14 +08:00
parent 4ca6a221e4
commit 7e5edd6387
5 changed files with 38 additions and 38 deletions
+4 -9
View File
@@ -16,7 +16,7 @@ import {
import { backendOptionsMap } from '../config/backend-parameters';
import { FormContext } from '../config/form-context';
import {
BackendGroupOption,
BackendOption,
DeployFormKey,
FormData,
SourceType
@@ -188,7 +188,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
};
};
const updateKVCacheConfig = (backend: string, option: BackendGroupOption) => {
const updateKVCacheConfig = (backend: string, option: BackendOption) => {
if (
!option.isBuiltIn &&
[backendOptionsMap.SGLang, backendOptionsMap.vllm].includes(backend)
@@ -202,15 +202,10 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
return {};
};
const handleBackendChange = async (
val: string,
option: BackendGroupOption
) => {
console.log('handleBackendChange option===>', val, option);
const isGGUF = checkIsGGUF();
const handleBackendChange = async (val: string, option: BackendOption) => {
form.setFieldsValue({
env: null,
backend_version: option.default_version || '',
backend_version: '', // don't set default version here, let the user select it
backend_parameters: option.default_backend_param || [],
...updateKVCacheConfig(val, option),
...updateGPUSelector(val)