mirror of
https://github.com/open-webui/open-webui
synced 2025-05-17 12:03:41 +00:00
refac: migration
This commit is contained in:
parent
3499ec3f79
commit
d1da3dde65
@ -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 = []
|
||||||
|
Loading…
Reference in New Issue
Block a user