Fix S3 tab flashing on reload (#7106)
* persist vision/audio model flags to fix S3 tab flash on reload * persist modelType and reset capability flags on model switch
This commit is contained in:
parent
eb31d1e5ca
commit
bb80602174
1 changed files with 10 additions and 3 deletions
|
|
@ -115,11 +115,11 @@ let _yamlLearningRate: number | undefined = undefined;
|
|||
let _datasetFormatBeforeCpt: DatasetFormat | null = null;
|
||||
let _datasetFormatAutoForcedByCpt = false;
|
||||
|
||||
// modelType / isVisionModel / isAudioModel persist so multimodal-only UI
|
||||
// paints right on reload; the model-config fetch still re-derives them.
|
||||
const NON_PERSISTED_STATE_KEYS: ReadonlySet<keyof TrainingConfigState> = new Set([
|
||||
"modelType",
|
||||
"isCheckingVision",
|
||||
"isEmbeddingModel",
|
||||
"isAudioModel",
|
||||
"isLoadingModelDefaults",
|
||||
"modelDefaultsError",
|
||||
"modelDefaultsAppliedFor",
|
||||
|
|
@ -128,7 +128,6 @@ const NON_PERSISTED_STATE_KEYS: ReadonlySet<keyof TrainingConfigState> = new Set
|
|||
"isDatasetAudio",
|
||||
"trainOnCompletions",
|
||||
"maxPositionEmbeddings",
|
||||
"isVisionModel",
|
||||
"s3Config",
|
||||
]);
|
||||
|
||||
|
|
@ -570,6 +569,9 @@ export const useTrainingConfigStore = create<TrainingConfigStore>()(
|
|||
visionImageSize?: number | null;
|
||||
trustRemoteCode?: boolean;
|
||||
approvedRemoteCodeFingerprint?: string | null;
|
||||
isVisionModel?: boolean;
|
||||
isAudioModel?: boolean;
|
||||
isEmbeddingModel?: boolean;
|
||||
} = {
|
||||
selectedModel,
|
||||
modelDefaultsError: null,
|
||||
|
|
@ -581,6 +583,11 @@ export const useTrainingConfigStore = create<TrainingConfigStore>()(
|
|||
// re-applied below, and a custom-code model re-opens the dialog before start.
|
||||
patch.trustRemoteCode = false;
|
||||
patch.approvedRemoteCodeFingerprint = null;
|
||||
// Reset capability flags so a mid-fetch reload can't persist the
|
||||
// previous model's vision/audio flags against the new model.
|
||||
patch.isVisionModel = false;
|
||||
patch.isAudioModel = false;
|
||||
patch.isEmbeddingModel = false;
|
||||
}
|
||||
set(patch);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue