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
c89b34fd
Commit
c89b34fd
authored
Jul 31, 2024
by
Michael Poluektov
Browse files
flatten job()
parent
b9b1fdd1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
57 deletions
+52
-57
backend/apps/webui/main.py
backend/apps/webui/main.py
+52
-57
No files found.
backend/apps/webui/main.py
View file @
c89b34fd
...
...
@@ -147,7 +147,7 @@ async def get_pipe_models():
function_module
=
get_function_module
(
pipe
.
id
)
# Check if function is a manifold
if
hasattr
(
function_module
,
"
type"
)
and
function_module
.
type
==
"manifold"
:
if
hasattr
(
function_module
,
"
pipes"
)
:
manifold_pipes
=
[]
# Check if pipes is a function or a list
...
...
@@ -343,7 +343,6 @@ async def generate_function_chat_completion(form_data, user):
form_data
=
add_model_params
(
params
,
form_data
)
form_data
=
populate_system_message
(
params
,
form_data
,
user
)
async
def
job
():
pipe_id
=
get_pipe_id
(
form_data
)
function_module
=
get_function_module
(
pipe_id
)
...
...
@@ -371,9 +370,7 @@ async def generate_function_chat_completion(form_data, user):
return
if
isinstance
(
res
,
str
):
message
=
openai_chat_chunk_message_template
(
form_data
[
"model"
],
res
)
message
=
openai_chat_chunk_message_template
(
form_data
[
"model"
],
res
)
yield
f
"data:
{
json
.
dumps
(
message
)
}
\n\n
"
if
isinstance
(
res
,
Iterator
):
...
...
@@ -408,5 +405,3 @@ async def generate_function_chat_completion(form_data, user):
message
=
await
get_message_content
(
res
)
return
openai_chat_completion_message_template
(
form_data
[
"model"
],
message
)
return
await
job
()
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