fix(ui): fix crash on LoRA remove / weight change

This commit is contained in:
psychedelicious 2023-07-15 11:07:13 +10:00
parent 54b813c981
commit 8cb19578c2
2 changed files with 3 additions and 2 deletions

View File

@ -3,6 +3,7 @@ import { LoRAModelParam } from 'features/parameters/types/parameterSchemas';
import { LoRAModelConfigEntity } from 'services/api/endpoints/models';
export type LoRA = LoRAModelParam & {
id: string;
weight: number;
};
@ -24,7 +25,7 @@ export const loraSlice = createSlice({
reducers: {
loraAdded: (state, action: PayloadAction<LoRAModelConfigEntity>) => {
const { model_name, id, base_model } = action.payload;
state.loras[id] = { model_name, base_model, ...defaultLoRAConfig };
state.loras[id] = { id, model_name, base_model, ...defaultLoRAConfig };
},
loraRemoved: (state, action: PayloadAction<string>) => {
const id = action.payload;

View File

@ -60,7 +60,7 @@ export const addLoRAsToGraph = (
const loraLoaderNode: LoraLoaderInvocation = {
type: 'lora_loader',
id: currentLoraNodeId,
lora,
lora: { model_name, base_model },
weight,
};