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
966f10e7
Commit
966f10e7
authored
May 27, 2024
by
Timothy J. Baek
Browse files
refac: pipeline valves -> filters
parent
4fac99c5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
backend/main.py
backend/main.py
+4
-4
No files found.
backend/main.py
View file @
966f10e7
...
...
@@ -253,7 +253,7 @@ class PipelineMiddleware(BaseHTTPMiddleware):
model
for
model
in
app
.
state
.
MODELS
.
values
()
if
"pipeline"
in
model
and
model
[
"pipeline"
][
"type"
]
==
"
valve
"
and
model
[
"pipeline"
][
"type"
]
==
"
filter
"
and
model_id
in
[
target_model
[
"id"
]
...
...
@@ -285,7 +285,7 @@ class PipelineMiddleware(BaseHTTPMiddleware):
if
key
!=
""
:
headers
=
{
"Authorization"
:
f
"Bearer
{
key
}
"
}
r
=
requests
.
post
(
f
"
{
url
}
/
valve
"
,
f
"
{
url
}
/
filter
"
,
headers
=
headers
,
json
=
{
"user"
:
user
,
...
...
@@ -428,11 +428,11 @@ async def get_all_models():
async
def
get_models
(
user
=
Depends
(
get_verified_user
)):
models
=
await
get_all_models
()
# Filter out
valve model
s
# Filter out
filter pipeline
s
models
=
[
model
for
model
in
models
if
"pipeline"
not
in
model
or
model
[
"pipeline"
][
"type"
]
!=
"
valve
"
if
"pipeline"
not
in
model
or
model
[
"pipeline"
][
"type"
]
!=
"
filter
"
]
if
app
.
state
.
config
.
ENABLE_MODEL_FILTER
:
...
...
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