Commit 475e09be authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix: model params

parent b124cd4a
......@@ -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.`
......
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment