fix: set default vllm backend for gguf
This commit is contained in:
@@ -257,7 +257,6 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
if (requestModelId !== getRequestId()) {
|
||||
return;
|
||||
}
|
||||
console.log('handleSelectModelFile:', item, selectedModel);
|
||||
|
||||
const modelInfo = onSelectModel(selectedModel, props.source);
|
||||
|
||||
@@ -267,7 +266,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
model_scope_file_path: item.fakeName,
|
||||
backend_parameters: [],
|
||||
backend_version: '',
|
||||
backend: '',
|
||||
backend: modelInfo.backend,
|
||||
env: {},
|
||||
categories: getCategory(item)
|
||||
});
|
||||
@@ -403,6 +402,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
};
|
||||
|
||||
const handleBackendChange = async (backend: string) => {
|
||||
console.log('handleBackendChange:', backend);
|
||||
const data = form.current.form.getFieldsValue?.();
|
||||
const res = handleBackendChangeBefore(data);
|
||||
if (res.show) {
|
||||
|
||||
@@ -47,7 +47,6 @@ const CustomBackend: React.FC = () => {
|
||||
<SealInput.Input
|
||||
required
|
||||
allowClear
|
||||
onBlur={handleImageNameOnBlur}
|
||||
label={intl.formatMessage({ id: 'backend.imageName' })}
|
||||
></SealInput.Input>
|
||||
</Form.Item>
|
||||
@@ -65,7 +64,6 @@ const CustomBackend: React.FC = () => {
|
||||
required
|
||||
scaleSize={false}
|
||||
alwaysFocus={true}
|
||||
onBlur={handleRunCommandOnBlur}
|
||||
autoSize={{ minRows: 2, maxRows: 4 }}
|
||||
label={intl.formatMessage({ id: 'backend.runCommand' })}
|
||||
description={intl.formatMessage({
|
||||
|
||||
@@ -241,14 +241,6 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
...updateGPUSelector(val)
|
||||
});
|
||||
|
||||
const imageName = form.getFieldValue('image_name');
|
||||
const runCommand = form.getFieldValue('run_command');
|
||||
|
||||
// if the image_name or run_command is empty, set them to default value of the backend
|
||||
|
||||
if (val === backendOptionsMap.custom && !imageName && !runCommand) {
|
||||
return;
|
||||
}
|
||||
onBackendChange?.(val);
|
||||
};
|
||||
|
||||
|
||||
@@ -407,6 +407,19 @@ export const useCheckCompatibility = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
backendOptionsMap.custom === allValues.backend &&
|
||||
(!allValues.run_command || !allValues.image_name)
|
||||
) {
|
||||
setWarningStatus({
|
||||
show: false,
|
||||
type: 'warning',
|
||||
isHtml: true,
|
||||
message: ''
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// check gguf: for online and local path
|
||||
if (
|
||||
checkIsGGUFFileOrNotSupport(allValues.local_path, allValues) &&
|
||||
|
||||
Reference in New Issue
Block a user