mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 10:45:42 +01:00
Refactor UI state management (#1191)
* Added logs at generation of the UI, and generate the UI in an object * Make ingest script more verbose in case of an error at ingestion time * Removed the explicit state in the UI containing ingested files * Make script of ingestion a bit more verbose by displaying stack traces * Change the browser tab title of privateGPT ui to `My Private GPT`
This commit is contained in:
parent
55e626eac7
commit
a666fd5b73
3 changed files with 170 additions and 137 deletions
|
|
@ -1,4 +1,5 @@
|
|||
"""FastAPI app creation, logger configuration and main API routes."""
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
import llama_index
|
||||
|
|
@ -14,6 +15,8 @@ from private_gpt.server.health.health_router import health_router
|
|||
from private_gpt.server.ingest.ingest_router import ingest_router
|
||||
from private_gpt.settings.settings import settings
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Add LlamaIndex simple observability
|
||||
llama_index.set_global_handler("simple")
|
||||
|
||||
|
|
@ -103,6 +106,7 @@ app.include_router(health_router)
|
|||
|
||||
|
||||
if settings.ui.enabled:
|
||||
from private_gpt.ui.ui import mount_in_app
|
||||
logger.debug("Importing the UI module")
|
||||
from private_gpt.ui.ui import PrivateGptUi
|
||||
|
||||
mount_in_app(app)
|
||||
PrivateGptUi().mount_in_app(app)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue