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
ee38b3c8
Commit
ee38b3c8
authored
Mar 31, 2024
by
Patrice-Gaudicheau
Browse files
Enhance DATA_DIR handling in main.py and docker-compose configuration
parent
3b0cb794
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
backend/main.py
backend/main.py
+12
-7
docker-compose.yaml
docker-compose.yaml
+1
-0
No files found.
backend/main.py
View file @
ee38b3c8
...
...
@@ -161,24 +161,29 @@ app.mount("/images/api/v1", images_app)
app
.
mount
(
"/audio/api/v1"
,
audio_app
)
app
.
mount
(
"/rag/api/v1"
,
rag_app
)
@
app
.
get
(
"/api/config"
)
async
def
get_app_config
():
# Checking and Handling the Absence of 'ui' in CONFIG_DATA
if
"ui"
in
CONFIG_DATA
:
default_locale
=
CONFIG_DATA
[
"ui"
].
get
(
"default_locale"
,
"en-US"
)
default_prompt_suggestions
=
CONFIG_DATA
[
"ui"
].
get
(
"prompt_suggestions"
,
[])
else
:
default_locale
=
"en-US"
default_prompt_suggestions
=
[]
# The Rest of the Function Now Uses the Variables Defined Above
return
{
"status"
:
True
,
"name"
:
WEBUI_NAME
,
"version"
:
VERSION
,
"default_locale"
:
(
CONFIG_DATA
[
"ui"
][
"default_locale"
]
if
"default_locale"
in
CONFIG_DATA
[
"ui"
]
else
"en-US"
),
"default_locale"
:
default_locale
,
"images"
:
images_app
.
state
.
ENABLED
,
"default_models"
:
webui_app
.
state
.
DEFAULT_MODELS
,
"default_prompt_suggestions"
:
webui_app
.
state
.
DEFAULT_PROMPT_SUGGESTIONS
,
"default_prompt_suggestions"
:
default_prompt_suggestions
,
}
@
app
.
get
(
"/api/config/model/filter"
)
async
def
get_model_filter_config
(
user
=
Depends
(
get_admin_user
)):
return
{
...
...
docker-compose.yaml
View file @
ee38b3c8
...
...
@@ -27,6 +27,7 @@ services:
environment
:
-
'
OLLAMA_BASE_URL=http://ollama:11434'
-
'
WEBUI_SECRET_KEY='
-
'
DATA_DIR=/app/backend/data'
extra_hosts
:
-
host.docker.internal:host-gateway
restart
:
unless-stopped
...
...
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