"git@developer.sourcefind.cn:wangsen/mineru.git" did not exist on "9d522ab3c419457238586b8a687b67550b2b02e6"
Unverified Commit 7563619e authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #1368 from Patrice-Gaudicheau/fix/data-dir-handling

Update of main.py
parents 587a8c59 1b5c92d6
...@@ -8,6 +8,8 @@ remove: ...@@ -8,6 +8,8 @@ remove:
start: start:
@docker-compose start @docker-compose start
startAndBuild:
docker-compose up -d --build
stop: stop:
@docker-compose stop @docker-compose stop
......
...@@ -164,15 +164,18 @@ app.mount("/rag/api/v1", rag_app) ...@@ -164,15 +164,18 @@ app.mount("/rag/api/v1", rag_app)
@app.get("/api/config") @app.get("/api/config")
async def get_app_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 { return {
"status": True, "status": True,
"name": WEBUI_NAME, "name": WEBUI_NAME,
"version": VERSION, "version": VERSION,
"default_locale": ( "default_locale": default_locale,
CONFIG_DATA["ui"]["default_locale"]
if "ui" in CONFIG_DATA and "default_locale" in CONFIG_DATA["ui"]
else "en-US"
),
"images": images_app.state.ENABLED, "images": images_app.state.ENABLED,
"default_models": webui_app.state.DEFAULT_MODELS, "default_models": webui_app.state.DEFAULT_MODELS,
"default_prompt_suggestions": webui_app.state.DEFAULT_PROMPT_SUGGESTIONS, "default_prompt_suggestions": webui_app.state.DEFAULT_PROMPT_SUGGESTIONS,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment