diff --git a/src/routes/(app)/workspace/models/create/+page.svelte b/src/routes/(app)/workspace/models/create/+page.svelte index fb3823796..99344b0e6 100644 --- a/src/routes/(app)/workspace/models/create/+page.svelte +++ b/src/routes/(app)/workspace/models/create/+page.svelte @@ -79,6 +79,12 @@ info.meta.capabilities = capabilities; info.params.stop = params.stop ? params.stop.split(',').filter((s) => s.trim()) : null; + Object.keys(info.params).forEach((key) => { + if (info.params[key] === '' || info.params[key] === null) { + delete info.params[key]; + } + }); + if ($models.find((m) => m.id === info.id)) { toast.error( `Error: A model with the ID '${info.id}' already exists. Please select a different ID to proceed.` diff --git a/src/routes/(app)/workspace/models/edit/+page.svelte b/src/routes/(app)/workspace/models/edit/+page.svelte index 526271d46..56a0ad387 100644 --- a/src/routes/(app)/workspace/models/edit/+page.svelte +++ b/src/routes/(app)/workspace/models/edit/+page.svelte @@ -67,6 +67,12 @@ info.meta.capabilities = capabilities; info.params.stop = params.stop ? params.stop.split(',').filter((s) => s.trim()) : null; + Object.keys(info.params).forEach((key) => { + if (info.params[key] === '' || info.params[key] === null) { + delete info.params[key]; + } + }); + const res = await updateModelById(localStorage.token, info.id, info); if (res) {