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
c689356b
Commit
c689356b
authored
Jun 20, 2024
by
Timothy J. Baek
Browse files
refac
parent
015772ef
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
14 deletions
+5
-14
backend/apps/ollama/main.py
backend/apps/ollama/main.py
+4
-13
src/lib/components/chat/Chat.svelte
src/lib/components/chat/Chat.svelte
+1
-1
No files found.
backend/apps/ollama/main.py
View file @
c689356b
...
...
@@ -53,7 +53,7 @@ from config import (
UPLOAD_DIR
,
AppConfig
,
)
from
utils.misc
import
calculate_sha256
from
utils.misc
import
calculate_sha256
,
add_or_update_system_message
log
=
logging
.
getLogger
(
__name__
)
log
.
setLevel
(
SRC_LOG_LEVELS
[
"OLLAMA"
])
...
...
@@ -834,17 +834,8 @@ async def generate_chat_completion(
)
if
payload
.
get
(
"messages"
):
for
message
in
payload
[
"messages"
]:
if
message
.
get
(
"role"
)
==
"system"
:
message
[
"content"
]
=
system
+
message
[
"content"
]
break
else
:
payload
[
"messages"
].
insert
(
0
,
{
"role"
:
"system"
,
"content"
:
system
,
},
payload
[
"messages"
]
=
add_or_update_system_message
(
system
,
payload
[
"messages"
]
)
if
url_idx
==
None
:
...
...
src/lib/components/chat/Chat.svelte
View file @
c689356b
...
...
@@ -941,7 +941,7 @@
chat_id: $chatId
},
`${
OPENAI_AP
I_BASE_URL}`
`${
WEBU
I_BASE_URL}
/api
`
);
// Wait until history/message have been updated
...
...
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