Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
475e09be
Commit
475e09be
authored
Jun 01, 2024
by
Timothy J. Baek
Browse files
fix: model params
parent
b124cd4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
src/routes/(app)/workspace/models/create/+page.svelte
src/routes/(app)/workspace/models/create/+page.svelte
+6
-0
src/routes/(app)/workspace/models/edit/+page.svelte
src/routes/(app)/workspace/models/edit/+page.svelte
+6
-0
No files found.
src/routes/(app)/workspace/models/create/+page.svelte
View file @
475e09be
...
...
@@ -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.`
...
...
src/routes/(app)/workspace/models/edit/+page.svelte
View file @
475e09be
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment