diff --git a/src/lib/components/workspace/Models.svelte b/src/lib/components/workspace/Models.svelte index f37dd5cc3..7c4829e3a 100644 --- a/src/lib/components/workspace/Models.svelte +++ b/src/lib/components/workspace/Models.svelte @@ -307,9 +307,15 @@ for (const model of savedModels) { if (model?.info ?? false) { - await updateModelById(localStorage.token, model.id, model.info).catch((error) => { - return null; - }); + if ($models.find((m) => m.id === model.id)) { + await updateModelById(localStorage.token, model.id, model.info).catch((error) => { + return null; + }); + } else { + await addNewModel(localStorage.token, model.info).catch((error) => { + return null; + }); + } } }