mirror of
https://github.com/open-webui/open-webui
synced 2025-04-02 20:11:18 +00:00
fix
This commit is contained in:
parent
f54a66b86b
commit
6bad71adca
@ -116,6 +116,13 @@ async def get_pipe_models():
|
|||||||
else:
|
else:
|
||||||
function_module = app.state.FUNCTIONS[pipe.id]
|
function_module = app.state.FUNCTIONS[pipe.id]
|
||||||
|
|
||||||
|
if hasattr(function_module, "valves") and hasattr(function_module, "Valves"):
|
||||||
|
print(f"Getting valves for {pipe.id}")
|
||||||
|
valves = Functions.get_function_valves_by_id(pipe.id)
|
||||||
|
function_module.valves = function_module.Valves(
|
||||||
|
**(valves if valves else {})
|
||||||
|
)
|
||||||
|
|
||||||
# Check if function is a manifold
|
# Check if function is a manifold
|
||||||
if hasattr(function_module, "type"):
|
if hasattr(function_module, "type"):
|
||||||
if function_module.type == "manifold":
|
if function_module.type == "manifold":
|
||||||
|
@ -16,12 +16,16 @@ def extract_frontmatter(file_path):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
with open(file_path, "r", encoding="utf-8") as file:
|
with open(file_path, "r", encoding="utf-8") as file:
|
||||||
|
first_line = file.readline()
|
||||||
|
if first_line.strip() != '"""':
|
||||||
|
# The file doesn't start with triple quotes
|
||||||
|
return {}
|
||||||
|
|
||||||
|
frontmatter_started = True
|
||||||
|
|
||||||
for line in file:
|
for line in file:
|
||||||
if '"""' in line:
|
if '"""' in line:
|
||||||
if not frontmatter_started:
|
if frontmatter_started:
|
||||||
frontmatter_started = True
|
|
||||||
continue # skip the line with the opening triple quotes
|
|
||||||
else:
|
|
||||||
frontmatter_ended = True
|
frontmatter_ended = True
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -30,6 +34,7 @@ def extract_frontmatter(file_path):
|
|||||||
if match:
|
if match:
|
||||||
key, value = match.groups()
|
key, value = match.groups()
|
||||||
frontmatter[key.strip()] = value.strip()
|
frontmatter[key.strip()] = value.strip()
|
||||||
|
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
print(f"Error: The file {file_path} does not exist.")
|
print(f"Error: The file {file_path} does not exist.")
|
||||||
return {}
|
return {}
|
||||||
|
Loading…
Reference in New Issue
Block a user