bfh-studadmin-assist / src /ui /__init__.py
awellis's picture
Fix HuggingFace Spaces import error with lazy loading
41b07fd
raw
history blame contribute delete
639 Bytes
"""Gradio UI components."""
# Import only the lightweight components by default to avoid heavy dependencies
# The full multi-agent UI (gradio_app_memory) is imported only when needed
__all__ = ["create_gradio_interface", "ChunkFormatter"]
# Lazy imports to avoid loading heavy dependencies
def __getattr__(name):
if name == "create_gradio_interface":
from .interface import create_gradio_interface
return create_gradio_interface
elif name == "ChunkFormatter":
from .formatters import ChunkFormatter
return ChunkFormatter
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")