chore: update vllm parameters, do not change backend when file type unknown

This commit is contained in:
jialin
2025-04-16 12:34:18 +08:00
parent ced45bec65
commit c831c19848
14 changed files with 298 additions and 211 deletions
+8 -3
View File
@@ -19,7 +19,7 @@ const LocalPathForm: React.FC = () => {
const formInnerCtx = useFormInnerContext();
const source = Form.useWatch('source', form);
const { onBackendChange } = formInnerCtx;
const { modelFileOptions, byBuiltIn } = formCtx;
const { byBuiltIn } = formCtx;
const { getRuleMessage } = useAppUtils();
const intl = useIntl();
const localPathCache = useRef<string>(form.getFieldValue('local_path') || '');
@@ -35,8 +35,13 @@ const LocalPathForm: React.FC = () => {
}
const isEndwithGGUF = _.endsWith(value, '.gguf');
const isBlobFile = value.split('/').pop().includes('sha256');
let backend = backendOptionsMap.llamaBox;
if (!isEndwithGGUF && !isBlobFile) {
let backend = form.getFieldValue('backend');
if (
!isEndwithGGUF &&
!isBlobFile &&
backend === backendOptionsMap.llamaBox
) {
backend = backendOptionsMap.vllm;
}
form.setFieldValue('backend', backend);