peppinob-ol
commited on
Commit
·
79e7093
1
Parent(s):
166316e
Fix multi-page structure for Streamlit
Browse files
app_hf.py
CHANGED
|
@@ -1,26 +1,23 @@
|
|
| 1 |
"""
|
| 2 |
Entry point for Hugging Face Spaces deployment
|
| 3 |
-
|
| 4 |
"""
|
| 5 |
|
| 6 |
import sys
|
|
|
|
| 7 |
from pathlib import Path
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
|
| 11 |
-
if str(project_root) not in sys.path:
|
| 12 |
-
sys.path.insert(0, str(project_root))
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
-
# without modifying the original eda/app.py structure
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
# Import the main app module
|
| 23 |
-
from eda import app
|
| 24 |
|
| 25 |
-
#
|
|
|
|
| 26 |
|
|
|
|
| 1 |
"""
|
| 2 |
Entry point for Hugging Face Spaces deployment
|
| 3 |
+
This is a simple wrapper that runs the Streamlit app from the eda directory
|
| 4 |
"""
|
| 5 |
|
| 6 |
import sys
|
| 7 |
+
import os
|
| 8 |
from pathlib import Path
|
| 9 |
|
| 10 |
+
# Get the eda directory path
|
| 11 |
+
eda_dir = Path(__file__).parent / "eda"
|
|
|
|
|
|
|
| 12 |
|
| 13 |
+
# Change to eda directory so Streamlit can find pages/ folder
|
| 14 |
+
os.chdir(eda_dir)
|
|
|
|
| 15 |
|
| 16 |
+
# Add both project root and eda to path
|
| 17 |
+
project_root = Path(__file__).parent
|
| 18 |
+
sys.path.insert(0, str(project_root))
|
| 19 |
+
sys.path.insert(0, str(eda_dir))
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
# Now import and run the app
|
| 22 |
+
import app
|
| 23 |
|