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
7563619e
Unverified
Commit
7563619e
authored
Mar 31, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Mar 31, 2024
Browse files
Merge pull request #1368 from Patrice-Gaudicheau/fix/data-dir-handling
Update of main.py
parents
587a8c59
1b5c92d6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
Makefile
Makefile
+2
-0
backend/main.py
backend/main.py
+8
-5
No files found.
Makefile
View file @
7563619e
...
...
@@ -8,6 +8,8 @@ remove:
start
:
@
docker-compose start
startAndBuild
:
docker-compose up
-d
--build
stop
:
@
docker-compose stop
...
...
backend/main.py
View file @
7563619e
...
...
@@ -164,15 +164,18 @@ 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
default_locale
=
"en-US"
if
"ui"
in
CONFIG_DATA
:
default_locale
=
CONFIG_DATA
[
"ui"
].
get
(
"default_locale"
,
"en-US"
)
# 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
"ui"
in
CONFIG_DATA
and
"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
,
...
...
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