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
0383efa2
Commit
0383efa2
authored
May 28, 2024
by
Timothy J. Baek
Browse files
refac: pipelines
parent
e231333b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
backend/main.py
backend/main.py
+3
-3
No files found.
backend/main.py
View file @
0383efa2
...
@@ -245,6 +245,7 @@ class PipelineMiddleware(BaseHTTPMiddleware):
...
@@ -245,6 +245,7 @@ class PipelineMiddleware(BaseHTTPMiddleware):
model
model
for
model
in
app
.
state
.
MODELS
.
values
()
for
model
in
app
.
state
.
MODELS
.
values
()
if
"pipeline"
in
model
if
"pipeline"
in
model
and
"type"
in
model
[
"pipeline"
]
and
model
[
"pipeline"
][
"type"
]
==
"filter"
and
model
[
"pipeline"
][
"type"
]
==
"filter"
and
(
and
(
model
[
"pipeline"
][
"pipelines"
]
==
[
"*"
]
model
[
"pipeline"
][
"pipelines"
]
==
[
"*"
]
...
@@ -279,11 +280,10 @@ class PipelineMiddleware(BaseHTTPMiddleware):
...
@@ -279,11 +280,10 @@ class PipelineMiddleware(BaseHTTPMiddleware):
if
key
!=
""
:
if
key
!=
""
:
headers
=
{
"Authorization"
:
f
"Bearer
{
key
}
"
}
headers
=
{
"Authorization"
:
f
"Bearer
{
key
}
"
}
r
=
requests
.
post
(
r
=
requests
.
post
(
f
"
{
url
}
/filter"
,
f
"
{
url
}
/
{
filter
[
'id'
]
}
/
filter"
,
headers
=
headers
,
headers
=
headers
,
json
=
{
json
=
{
"user"
:
user
,
"user"
:
user
,
"model"
:
filter
[
"id"
],
"body"
:
data
,
"body"
:
data
,
},
},
)
)
...
@@ -448,7 +448,7 @@ async def get_models(user=Depends(get_verified_user)):
...
@@ -448,7 +448,7 @@ async def get_models(user=Depends(get_verified_user)):
models
=
[
models
=
[
model
model
for
model
in
models
for
model
in
models
if
"pipeline"
not
in
model
or
model
[
"pipeline"
]
[
"type"
]
!=
"filter"
if
"pipeline"
not
in
model
or
model
[
"pipeline"
]
.
get
(
"type"
,
None
)
!=
"filter"
]
]
if
app
.
state
.
config
.
ENABLE_MODEL_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