Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
326af5a6
Commit
326af5a6
authored
Jan 25, 2024
by
Timothy J. Baek
Browse files
refac
parent
8da06f5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
backend/config.py
backend/config.py
+9
-13
No files found.
backend/config.py
View file @
326af5a6
import
os
import
chromadb
from
chromadb
import
Settings
from
secrets
import
token_bytes
from
base64
import
b64encode
from
constants
import
ERROR_MESSAGES
from
pathlib
import
Path
try
:
...
...
@@ -22,22 +15,25 @@ except ImportError:
####################################
#
File Upload
#
ENV (dev,test,prod)
####################################
DATA_DIR
=
str
(
Path
(
os
.
getenv
(
"DATA_DIR"
,
"./data"
)).
resolve
()
)
ENV
=
os
.
environ
.
get
(
"ENV"
,
"dev"
)
UPLOAD_DIR
=
f
"
{
DATA_DIR
}
/uploads"
Path
(
UPLOAD_DIR
).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
####################################
# 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"
)))
####################################
#
ENV (dev,test,prod)
#
File Upload DIR
####################################
ENV
=
os
.
environ
.
get
(
"ENV"
,
"dev"
)
UPLOAD_DIR
=
f
"
{
DATA_DIR
}
/uploads"
Path
(
UPLOAD_DIR
).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
####################################
# OLLAMA_API_BASE_URL
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment