forked from open-webui/open-webui
refac
This commit is contained in:
parent
8da06f5e74
commit
326af5a648
1 changed files with 15 additions and 19 deletions
|
@ -1,16 +1,9 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
import chromadb
|
import chromadb
|
||||||
from chromadb import Settings
|
from chromadb import Settings
|
||||||
|
|
||||||
|
|
||||||
from secrets import token_bytes
|
from secrets import token_bytes
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
|
|
||||||
from constants import ERROR_MESSAGES
|
from constants import ERROR_MESSAGES
|
||||||
|
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -21,24 +14,27 @@ except ImportError:
|
||||||
print("dotenv not installed, skipping...")
|
print("dotenv not installed, skipping...")
|
||||||
|
|
||||||
|
|
||||||
####################################
|
|
||||||
# File Upload
|
|
||||||
####################################
|
|
||||||
|
|
||||||
DATA_DIR = str(Path(os.getenv("DATA_DIR", "./data")).resolve())
|
|
||||||
|
|
||||||
UPLOAD_DIR = f"{DATA_DIR}/uploads"
|
|
||||||
|
|
||||||
Path(UPLOAD_DIR).mkdir(parents=True, exist_ok=True)
|
|
||||||
|
|
||||||
FRONTEND_BUILD_DIR = str(Path(os.getenv("FRONTEND_BUILD_DIR", "../build")))
|
|
||||||
|
|
||||||
####################################
|
####################################
|
||||||
# ENV (dev,test,prod)
|
# ENV (dev,test,prod)
|
||||||
####################################
|
####################################
|
||||||
|
|
||||||
ENV = os.environ.get("ENV", "dev")
|
ENV = os.environ.get("ENV", "dev")
|
||||||
|
|
||||||
|
|
||||||
|
####################################
|
||||||
|
# DATA/FRONTEND BUILD DIR
|
||||||
|
####################################
|
||||||
|
|
||||||
|
DATA_DIR = str(Path(os.getenv("DATA_DIR", "./data")).resolve())
|
||||||
|
FRONTEND_BUILD_DIR = str(Path(os.getenv("FRONTEND_BUILD_DIR", "../build")))
|
||||||
|
|
||||||
|
####################################
|
||||||
|
# File Upload DIR
|
||||||
|
####################################
|
||||||
|
|
||||||
|
UPLOAD_DIR = f"{DATA_DIR}/uploads"
|
||||||
|
Path(UPLOAD_DIR).mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
####################################
|
####################################
|
||||||
# OLLAMA_API_BASE_URL
|
# OLLAMA_API_BASE_URL
|
||||||
####################################
|
####################################
|
||||||
|
|
Loading…
Reference in a new issue