fix: miss cluster id in evaluation
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
"version_configs": {
|
||||
"type": "object",
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z0-9._-]+$": {
|
||||
"^[a-zA-Z0-9._-]+-custom$": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"image_name": {
|
||||
@@ -44,7 +44,7 @@
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"description": "multiple backend versions"
|
||||
"description": "multiple backend versions ending with -custom"
|
||||
}
|
||||
},
|
||||
"required": ["version_configs"],
|
||||
|
||||
@@ -197,6 +197,16 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
return categories || null;
|
||||
};
|
||||
|
||||
const { run: onClickModel } = useDeferredRequest(async () => {
|
||||
const allValues = form.current?.form?.getFieldsValue?.();
|
||||
|
||||
handleOnValuesChangeBefore({
|
||||
changedValues: {},
|
||||
allValues: allValues,
|
||||
source: props.source
|
||||
});
|
||||
}, 100);
|
||||
|
||||
const { run: onSelectFile } = useDeferredRequest(
|
||||
async (item: any, modelInfo: any, manual?: boolean) => {
|
||||
unlockWarningStatus();
|
||||
@@ -342,7 +352,6 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
if (manual) {
|
||||
form.current?.resetFields(resetFields);
|
||||
}
|
||||
console.log('isgguf==================> select 2', item.isGGUF);
|
||||
// If the item is empty
|
||||
setIsGGUF(item.isGGUF);
|
||||
updateSelectedModel(item);
|
||||
@@ -371,20 +380,13 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
categories: getCategory(item)
|
||||
};
|
||||
|
||||
console.log('newFormValues:', newFormValues);
|
||||
|
||||
form.current?.form?.setFieldsValue?.(newFormValues);
|
||||
|
||||
handleOnValuesChangeBefore({
|
||||
changedValues: {},
|
||||
allValues: newFormValues,
|
||||
source: props.source
|
||||
});
|
||||
onClickModel();
|
||||
}
|
||||
};
|
||||
|
||||
const handleOnOk = async (allValues: FormData) => {
|
||||
console.log('handleOnOk:', allValues);
|
||||
onOk(allValues);
|
||||
};
|
||||
|
||||
@@ -408,19 +410,13 @@ const AddModal: FC<AddModalProps> = (props) => {
|
||||
if (res.show) {
|
||||
return;
|
||||
}
|
||||
if (data.local_path || props.source !== modelSourceMap.local_path_value) {
|
||||
// TODO confirm whether it is gguf by model file not by backend
|
||||
handleOnValuesChange?.({
|
||||
changedValues: {},
|
||||
allValues: isGGUF
|
||||
? data
|
||||
: _.omit(data, [
|
||||
'cpu_offloading',
|
||||
'distributed_inference_across_workers'
|
||||
]),
|
||||
source: props.source
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: confirm gguf change backend behavior
|
||||
handleOnValuesChange?.({
|
||||
changedValues: {},
|
||||
allValues: data,
|
||||
source: props.source
|
||||
});
|
||||
};
|
||||
|
||||
const onValuesChange = async (changedValues: any, allValues: any) => {
|
||||
|
||||
@@ -8,7 +8,6 @@ import React, { useEffect, useMemo, useRef } from 'react';
|
||||
import ColumnWrapper from '../../_components/column-wrapper';
|
||||
import {
|
||||
deployFormKeyMap,
|
||||
modelSourceMap,
|
||||
ScheduleValueMap,
|
||||
updateIgnoreFields
|
||||
} from '../config';
|
||||
@@ -133,19 +132,11 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
||||
if (res.show) {
|
||||
return;
|
||||
}
|
||||
if (data.local_path || data.source !== modelSourceMap.local_path_value) {
|
||||
handleOnValuesChange?.({
|
||||
changedValues: {},
|
||||
allValues:
|
||||
backend === backendOptionsMap.llamaBox
|
||||
? data
|
||||
: _.omit(data, [
|
||||
'cpu_offloading',
|
||||
'distributed_inference_across_workers'
|
||||
]),
|
||||
source: data.source
|
||||
});
|
||||
}
|
||||
handleOnValuesChange?.({
|
||||
changedValues: {},
|
||||
allValues: data,
|
||||
source: data.source
|
||||
});
|
||||
};
|
||||
|
||||
const handleAsyncBackendChange = (backend: string) => {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import IconFont from '@/components/icon-font';
|
||||
import AutoComplete from '@/components/seal-form/auto-complete';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import SealSelect from '@/components/seal-form/seal-select';
|
||||
import SealTextArea from '@/components/seal-form/seal-textarea';
|
||||
@@ -71,7 +70,7 @@ const BackendFields: React.FC = () => {
|
||||
</Form.Item>
|
||||
{backendOptionsMap.custom !== backend && (
|
||||
<Form.Item name="backend_version">
|
||||
<AutoComplete
|
||||
<SealSelect
|
||||
options={backendVersions}
|
||||
placeholder={intl.formatMessage({
|
||||
id: 'models.form.backendVersion.holder'
|
||||
@@ -111,7 +110,7 @@ const BackendFields: React.FC = () => {
|
||||
)
|
||||
}
|
||||
)}
|
||||
></AutoComplete>
|
||||
></SealSelect>
|
||||
</Form.Item>
|
||||
)}
|
||||
{backend === backendOptionsMap.custom && (
|
||||
|
||||
@@ -81,6 +81,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
sourceList,
|
||||
clusterList = [],
|
||||
fields = ['source'],
|
||||
onBackendChange,
|
||||
onSourceChange,
|
||||
onValuesChange,
|
||||
onOk
|
||||
@@ -190,7 +191,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
backend_parameters: option.default_backend_param || [],
|
||||
...updateGPUSelector(val)
|
||||
});
|
||||
props.onBackendChange?.(val);
|
||||
onBackendChange?.(val);
|
||||
};
|
||||
|
||||
// generate the data is available for the backend including the gpu_ids
|
||||
|
||||
@@ -34,12 +34,8 @@ const LocalPathForm: React.FC = () => {
|
||||
}
|
||||
|
||||
const handleOnBlur = (e: any) => {
|
||||
form.setFieldsValue({
|
||||
backend_parameters: [],
|
||||
backend_version: '',
|
||||
backend: '',
|
||||
env: {}
|
||||
});
|
||||
const value = e.target.value;
|
||||
onValuesChange?.({ local_path: value }, form.getFieldsValue());
|
||||
};
|
||||
|
||||
const handleLocalPathBlur = async (e: any) => {
|
||||
@@ -99,6 +95,7 @@ const LocalPathForm: React.FC = () => {
|
||||
allowClear
|
||||
required
|
||||
onFocus={handleOnFocus}
|
||||
onBlur={handleOnBlur}
|
||||
label={intl.formatMessage({ id: 'models.form.filePath' })}
|
||||
description={<TooltipList list={localPathTipsList}></TooltipList>}
|
||||
></SealInput.Input>
|
||||
|
||||
Reference in New Issue
Block a user