mirror of
https://github.com/open-webui/pipelines
synced 2025-05-10 23:50:45 +00:00
refac
This commit is contained in:
parent
8bab7a2eca
commit
a2e11db46f
@ -10,3 +10,6 @@ try:
|
|||||||
load_dotenv(find_dotenv("./.env"))
|
load_dotenv(find_dotenv("./.env"))
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print("dotenv not installed, skipping...")
|
print("dotenv not installed, skipping...")
|
||||||
|
|
||||||
|
API_KEY = os.getenv("PIPELINES_API_KEY", "0p3n-w3bu!")
|
||||||
|
PIPELINES_DIR = os.getenv("PIPELINES_DIR", "./pipelines")
|
||||||
|
15
main.py
15
main.py
@ -27,20 +27,7 @@ import uuid
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
####################################
|
from config import API_KEY, PIPELINES_DIR
|
||||||
# Load .env file
|
|
||||||
####################################
|
|
||||||
|
|
||||||
try:
|
|
||||||
from dotenv import load_dotenv, find_dotenv
|
|
||||||
|
|
||||||
load_dotenv(find_dotenv(".env"))
|
|
||||||
except ImportError:
|
|
||||||
print("dotenv not installed, skipping...")
|
|
||||||
|
|
||||||
API_KEY = os.getenv("PIPELINES_API_KEY", "0p3n-w3bu!")
|
|
||||||
|
|
||||||
PIPELINES_DIR = os.getenv("PIPELINES_DIR", "./pipelines")
|
|
||||||
|
|
||||||
if not os.path.exists(PIPELINES_DIR):
|
if not os.path.exists(PIPELINES_DIR):
|
||||||
os.makedirs(PIPELINES_DIR)
|
os.makedirs(PIPELINES_DIR)
|
||||||
|
Loading…
Reference in New Issue
Block a user