Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
|
|
|
|
|
| 1 |
import sys
|
| 2 |
-
import
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
sys.path.append(SRC_PATH)
|
| 8 |
|
| 9 |
-
#
|
| 10 |
from src.app.main_app import main
|
| 11 |
|
|
|
|
| 12 |
if __name__ == "__main__":
|
| 13 |
main()
|
|
|
|
| 1 |
+
# app.py at repo root (Hugging Face entrypoint)
|
| 2 |
+
|
| 3 |
import sys
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
|
| 6 |
+
ROOT = Path(__file__).resolve().parent
|
| 7 |
+
SRC_DIR = ROOT / "src"
|
| 8 |
|
| 9 |
+
# Make sure /app/src is on the path so we can import src.app.*
|
| 10 |
+
if SRC_DIR.exists() and str(SRC_DIR) not in sys.path:
|
| 11 |
+
sys.path.insert(0, str(SRC_DIR))
|
|
|
|
| 12 |
|
| 13 |
+
# IMPORTANT: use src.app.main_app, NOT app.main_app
|
| 14 |
from src.app.main_app import main
|
| 15 |
|
| 16 |
+
|
| 17 |
if __name__ == "__main__":
|
| 18 |
main()
|