fix: uncheck train_on_completions for audio models
Pure audio models (orpheus, sparktts, whisper, sesame-csm) now always have trainOnCompletions auto-unchecked when selected. Gemma3n (audio_vlm) only unchecks when the dataset is audio. - Add is_audio to frontend ModelConfigResponse (backend already returns it) - Add isAudioModel state to training config store - Auto-set trainOnCompletions=false for pure audio models on model load - Auto-set trainOnCompletions=false for audio VLMs when dataset is audio - Respect manual user override via existing _trainOnCompletionsManuallySet flag
This commit is contained in:
parent
cb389fb756
commit
1430bbc604
3 changed files with 21 additions and 2 deletions
|
|
@ -61,8 +61,8 @@ export interface ModelConfigResponse {
|
|||
model_name?: string | null;
|
||||
config?: BackendModelConfig | null;
|
||||
is_vision: boolean;
|
||||
is_audio: boolean;
|
||||
is_lora: boolean;
|
||||
is_audio?: boolean;
|
||||
base_model?: string | null;
|
||||
model_type?: "text" | "vision" | "audio" | "embeddings" | null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ const initialState: TrainingConfigState = {
|
|||
uploadedFile: null,
|
||||
isCheckingVision: false,
|
||||
isVisionModel: false,
|
||||
isAudioModel: false,
|
||||
isLoadingModelDefaults: false,
|
||||
modelDefaultsError: null,
|
||||
modelDefaultsAppliedFor: null,
|
||||
|
|
@ -58,6 +59,7 @@ let _trainOnCompletionsManuallySet = false;
|
|||
const NON_PERSISTED_STATE_KEYS: ReadonlySet<keyof TrainingConfigState> = new Set([
|
||||
"modelType",
|
||||
"isCheckingVision",
|
||||
"isAudioModel",
|
||||
"isLoadingModelDefaults",
|
||||
"modelDefaultsError",
|
||||
"modelDefaultsAppliedFor",
|
||||
|
|
@ -127,6 +129,16 @@ export const useTrainingConfigStore = create<TrainingConfigStore>()(
|
|||
patch.trainOnCompletions = false;
|
||||
}
|
||||
|
||||
const isAudio = !!modelDetails.is_audio;
|
||||
// Pure audio model → always uncheck trainOnCompletions.
|
||||
if (isAudio && !modelDetails.is_vision) {
|
||||
patch.trainOnCompletions = false;
|
||||
}
|
||||
// Audio-capable vision model (e.g. gemma3n) + audio dataset → uncheck.
|
||||
if (isAudio && modelDetails.is_vision && get().isDatasetAudio) {
|
||||
patch.trainOnCompletions = false;
|
||||
}
|
||||
|
||||
// Use backend-provided model_type when available, otherwise
|
||||
// infer from is_vision (temporary until backend ships model_type).
|
||||
const inferredModelType: ModelType = modelDetails.model_type
|
||||
|
|
@ -136,6 +148,7 @@ export const useTrainingConfigStore = create<TrainingConfigStore>()(
|
|||
...patch,
|
||||
modelType: inferredModelType,
|
||||
isVisionModel: modelDetails.is_vision,
|
||||
isAudioModel: isAudio,
|
||||
isLoadingModelDefaults: false,
|
||||
isCheckingVision: false,
|
||||
modelDefaultsError: null,
|
||||
|
|
@ -194,10 +207,13 @@ export const useTrainingConfigStore = create<TrainingConfigStore>()(
|
|||
isCheckingDataset: false,
|
||||
};
|
||||
if (!_trainOnCompletionsManuallySet) {
|
||||
const { isVisionModel } = get();
|
||||
const { isVisionModel, isAudioModel } = get();
|
||||
if (isVisionModel && isImage) {
|
||||
updates.trainOnCompletions = false;
|
||||
}
|
||||
if (isAudioModel && isAudio) {
|
||||
updates.trainOnCompletions = false;
|
||||
}
|
||||
}
|
||||
set(updates);
|
||||
})
|
||||
|
|
@ -233,6 +249,7 @@ export const useTrainingConfigStore = create<TrainingConfigStore>()(
|
|||
selectedModel: null,
|
||||
isCheckingVision: false,
|
||||
isVisionModel: false,
|
||||
isAudioModel: false,
|
||||
isDatasetAudio: false,
|
||||
isLoadingModelDefaults: false,
|
||||
modelDefaultsError: null,
|
||||
|
|
@ -249,6 +266,7 @@ export const useTrainingConfigStore = create<TrainingConfigStore>()(
|
|||
set({
|
||||
isCheckingVision: false,
|
||||
isVisionModel: false,
|
||||
isAudioModel: false,
|
||||
isDatasetAudio: false,
|
||||
isLoadingModelDefaults: false,
|
||||
modelDefaultsError: null,
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ export interface TrainingConfigState {
|
|||
logFrequency: number;
|
||||
isCheckingVision: boolean;
|
||||
isVisionModel: boolean;
|
||||
isAudioModel: boolean;
|
||||
isLoadingModelDefaults: boolean;
|
||||
modelDefaultsError: string | null;
|
||||
modelDefaultsAppliedFor: string | null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue