diff --git a/backend/main.py b/backend/main.py index f3d8371b0..edf0f212e 100644 --- a/backend/main.py +++ b/backend/main.py @@ -250,8 +250,8 @@ class PipelineMiddleware(BaseHTTPMiddleware): and ( model["pipeline"]["pipelines"] == ["*"] or any( - model_id == target_model["id"] - for target_model in model["pipeline"]["pipelines"] + model_id == target_model_id + for target_model_id in model["pipeline"]["pipelines"] ) ) ] diff --git a/src/lib/components/admin/Settings/Pipelines.svelte b/src/lib/components/admin/Settings/Pipelines.svelte index 6a6d9a40e..60905e99c 100644 --- a/src/lib/components/admin/Settings/Pipelines.svelte +++ b/src/lib/components/admin/Settings/Pipelines.svelte @@ -32,6 +32,10 @@ const pipeline = pipelines[selectedPipelineIdx]; if (pipeline && (pipeline?.pipeline?.valves ?? false)) { + if (valves?.pipelines ?? false) { + valves.pipelines = valves.pipelines.split(',').map((v) => v.trim()); + } + const res = await updatePipelineValves(localStorage.token, pipeline.id, valves).catch( (error) => { toast.error(error); @@ -52,6 +56,10 @@ const getValves = async (idx) => { valves_spec = await getPipelineValvesSpec(localStorage.token, pipelines[idx].id); valves = await getPipelineValves(localStorage.token, pipelines[idx].id); + + if (valves?.pipelines ?? false) { + valves.pipelines = valves.pipelines.join(','); + } }; const setPipelines = async () => {