ColiFormer-ui / app.py
Genooo12's picture
Harden Space entrypoint import
1770473 verified
raw
history blame contribute delete
600 Bytes
"""Hugging Face Spaces Streamlit entrypoint for ENCOT."""
from pathlib import Path
import importlib
import sys
import streamlit as st
ROOT = Path(__file__).resolve().parent
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
try:
gui_app = importlib.import_module("streamlit_gui.app")
entrypoint = getattr(gui_app, "main", None)
if callable(entrypoint):
entrypoint()
else:
st.error("App entrypoint missing: streamlit_gui.app.main")
except Exception as exc:
st.error(f"Failed to start ENCOT UI: {exc}")
st.exception(exc)