mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 13:55:41 +01:00
Extract optional dependencies
This commit is contained in:
parent
d0a7d991a2
commit
3373e80850
7 changed files with 255 additions and 416 deletions
|
|
@ -52,7 +52,12 @@ def create_app(root_injector: Injector) -> FastAPI:
|
|||
|
||||
if settings.ui.enabled:
|
||||
logger.debug("Importing the UI module")
|
||||
from private_gpt.ui.ui import PrivateGptUi
|
||||
try:
|
||||
from private_gpt.ui.ui import PrivateGptUi
|
||||
except ImportError as e:
|
||||
raise ImportError(
|
||||
"UI dependencies not found, install with `poetry install --extras ui`"
|
||||
) from e
|
||||
|
||||
ui = root_injector.get(PrivateGptUi)
|
||||
ui.mount_in_app(app, settings.ui.path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue