fix: model params

This commit is contained in:
Timothy J. Baek 2024-06-01 15:29:47 -07:00
parent b124cd4ac5
commit 475e09be45
2 changed files with 12 additions and 0 deletions

View File

@ -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.`

View File

@ -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) {