fix: adjust gpus_per_replicas ux
This commit is contained in:
@@ -22,6 +22,7 @@ interface FormContextProps {
|
||||
workerLabelOptions: CascaderOption[];
|
||||
backendOptions: BackendOption[];
|
||||
initialValues?: FormData; // for editing model
|
||||
clearCacheFormValues?: () => void;
|
||||
onValuesChange?: (changedValues: any, allValues: any) => void;
|
||||
onBackendChange: (backend: string, option: any) => void;
|
||||
}
|
||||
|
||||
@@ -212,11 +212,6 @@ export const ScheduleValueMap = {
|
||||
SpecificGPUType: 'specific_gpu_type'
|
||||
};
|
||||
|
||||
export const gpusCountTypeMap = {
|
||||
Auto: 'auto',
|
||||
Custom: 'custom'
|
||||
};
|
||||
|
||||
export const scheduleList = [
|
||||
{
|
||||
label: 'models.form.scheduletype.auto',
|
||||
@@ -347,10 +342,9 @@ export const excludeFields = [
|
||||
'backend_version',
|
||||
'ollama_library_model_name',
|
||||
'scheduleType',
|
||||
'gpusCountType',
|
||||
'placement_strategy',
|
||||
'backend',
|
||||
'gpu_selector',
|
||||
'gpu_selector.gpu_ids',
|
||||
'run_command',
|
||||
'image_name',
|
||||
'extended_kv_cache.enabled'
|
||||
|
||||
@@ -70,7 +70,6 @@ export interface FormData {
|
||||
cpu_offloading?: boolean;
|
||||
worker_selector?: object;
|
||||
scheduleType?: string;
|
||||
gpusCountType?: string;
|
||||
name: string;
|
||||
replicas: number;
|
||||
description: string;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import _ from 'lodash';
|
||||
import { gpusCountTypeMap } from '.';
|
||||
import { backendOptionsMap } from '../config/backend-parameters';
|
||||
import { FormData } from './types';
|
||||
|
||||
@@ -60,17 +59,14 @@ export const generateGPUIds = (data: FormData) => {
|
||||
},
|
||||
[]
|
||||
);
|
||||
if (gpusCountTypeMap.Auto === data.gpusCountType) {
|
||||
return {
|
||||
gpu_selector: {
|
||||
gpu_ids: result || []
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
gpu_selector: {
|
||||
gpu_ids: result || [],
|
||||
gpus_per_replica: data.gpu_selector?.gpus_per_replica || null
|
||||
gpus_per_replica:
|
||||
data.gpu_selector?.gpus_per_replica === -1
|
||||
? null
|
||||
: data.gpu_selector?.gpus_per_replica
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user