Spaces:
Sleeping
Sleeping
| # app.py at repo root (Hugging Face entrypoint) | |
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parent | |
| SRC_DIR = ROOT / "src" | |
| # Make sure /app/src is on the path so we can import src.app.* | |
| if SRC_DIR.exists() and str(SRC_DIR) not in sys.path: | |
| sys.path.insert(0, str(SRC_DIR)) | |
| # IMPORTANT: use src.app.main_app, NOT app.main_app | |
| import traceback | |
| try: | |
| from src.app.main_app import main | |
| except Exception: | |
| print("\n======= IMPORT FAILURE DIAGNOSTICS =======") | |
| traceback.print_exc() | |
| raise | |
| if __name__ == "__main__": | |
| main() | |