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
d1da3dde
Commit
d1da3dde
authored
Jun 08, 2024
by
Timothy J. Baek
Browse files
refac: migration
parent
3499ec3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
backend/utils/misc.py
backend/utils/misc.py
+6
-0
No files found.
backend/utils/misc.py
View file @
d1da3dde
...
@@ -193,8 +193,14 @@ def parse_ollama_modelfile(model_text):
...
@@ -193,8 +193,14 @@ def parse_ollama_modelfile(model_text):
system_desc_match
=
re
.
search
(
system_desc_match
=
re
.
search
(
r
'SYSTEM\s+"""(.+?)"""'
,
model_text
,
re
.
DOTALL
|
re
.
IGNORECASE
r
'SYSTEM\s+"""(.+?)"""'
,
model_text
,
re
.
DOTALL
|
re
.
IGNORECASE
)
)
system_desc_match_single
=
re
.
search
(
r
"SYSTEM\s+([^\n]+)"
,
model_text
,
re
.
IGNORECASE
)
if
system_desc_match
:
if
system_desc_match
:
data
[
"params"
][
"system"
]
=
system_desc_match
.
group
(
1
).
strip
()
data
[
"params"
][
"system"
]
=
system_desc_match
.
group
(
1
).
strip
()
elif
system_desc_match_single
:
data
[
"params"
][
"system"
]
=
system_desc_match_single
.
group
(
1
).
strip
()
# Parse messages
# Parse messages
messages
=
[]
messages
=
[]
...
...
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