mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-18 23:55:55 +08:00
format backend
This commit is contained in:
parent
29f904db45
commit
a518d50477
@ -15,7 +15,7 @@ from fastapi.responses import StreamingResponse, JSONResponse, FileResponse
|
|||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
from typing import List
|
|
||||||
import uuid
|
import uuid
|
||||||
import requests
|
import requests
|
||||||
import hashlib
|
import hashlib
|
||||||
|
@ -17,7 +17,7 @@ from utils.misc import calculate_sha256, get_gravatar_url
|
|||||||
|
|
||||||
from config import OLLAMA_BASE_URLS, DATA_DIR, UPLOAD_DIR, ENABLE_ADMIN_EXPORT
|
from config import OLLAMA_BASE_URLS, DATA_DIR, UPLOAD_DIR, ENABLE_ADMIN_EXPORT
|
||||||
from constants import ERROR_MESSAGES
|
from constants import ERROR_MESSAGES
|
||||||
from typing import List
|
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
@ -93,11 +93,12 @@ def load_function_module_by_id(function_id):
|
|||||||
os.rename(function_path, f"{function_path}.error")
|
os.rename(function_path, f"{function_path}.error")
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
||||||
def install_frontmatter_requirements(requirements):
|
def install_frontmatter_requirements(requirements):
|
||||||
if requirements:
|
if requirements:
|
||||||
req_list = [req.strip() for req in requirements.split(',')]
|
req_list = [req.strip() for req in requirements.split(",")]
|
||||||
for req in req_list:
|
for req in req_list:
|
||||||
print(f"Installing requirement: {req}")
|
print(f"Installing requirement: {req}")
|
||||||
subprocess.check_call([sys.executable, "-m", "pip", "install", req])
|
subprocess.check_call([sys.executable, "-m", "pip", "install", req])
|
||||||
else:
|
else:
|
||||||
print("No requirements found in frontmatter.")
|
print("No requirements found in frontmatter.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user