diff --git a/src/lib/components/workspace/Models/FiltersSelector.svelte b/src/lib/components/workspace/Models/FiltersSelector.svelte
index a1b6e54db..6fe49b0d7 100644
--- a/src/lib/components/workspace/Models/FiltersSelector.svelte
+++ b/src/lib/components/workspace/Models/FiltersSelector.svelte
@@ -9,7 +9,7 @@
export let filters = [];
export let selectedFilterIds = [];
-
+
export let valvesSpecs = {};
export let valves = {};
@@ -69,7 +69,6 @@
>
-
{/if}
diff --git a/src/lib/components/workspace/Models/ModelEditor.svelte b/src/lib/components/workspace/Models/ModelEditor.svelte
index c8b1942f0..54283bcbb 100644
--- a/src/lib/components/workspace/Models/ModelEditor.svelte
+++ b/src/lib/components/workspace/Models/ModelEditor.svelte
@@ -67,7 +67,11 @@
profile_image_url: '/static/favicon.png',
description: '',
suggestion_prompts: null,
- tags: []
+ tags: [],
+ valves: {
+ functions: {},
+ tools: {}
+ }
},
params: {
system: ''
@@ -174,6 +178,16 @@
delete info.params[key];
}
});
+ // iterate through all valve settings for both functions and tools, and remove empty settings (aka things that got set back to default)
+ Object.keys(info.meta.valves).forEach((valveType) => {
+ Object.keys(info.meta.valves[valveType]).forEach((functionId) => {
+ Object.keys(info.meta.valves[valveType][functionId]).forEach((key) => {
+ if (info.meta.valves[valveType][functionId][key] === null) {
+ delete info.meta.valves.functions[functionId][key];
+ }
+ });
+ });
+ });
await onSubmit(info);