Upload streamlit_app.py with huggingface_hub
Browse files- streamlit_app.py +34 -0
streamlit_app.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
GelPredict - Main Entry Point for HuggingFace Spaces
|
| 3 |
+
This file is the entry point that HuggingFace expects.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
import sys
|
| 7 |
+
import os
|
| 8 |
+
|
| 9 |
+
# Add paths
|
| 10 |
+
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 11 |
+
app_dir = os.path.join(current_dir, 'app')
|
| 12 |
+
sys.path.insert(0, current_dir)
|
| 13 |
+
sys.path.insert(0, app_dir)
|
| 14 |
+
|
| 15 |
+
# Initialize HuggingFace persistent storage
|
| 16 |
+
print("=" * 60)
|
| 17 |
+
print("🔧 INITIALIZING HUGGINGFACE STORAGE...")
|
| 18 |
+
print("=" * 60)
|
| 19 |
+
try:
|
| 20 |
+
from app.hf_storage import storage
|
| 21 |
+
print("=" * 60)
|
| 22 |
+
print("✅ PERSISTENT STORAGE INITIALIZED - DATABASES LOADED!")
|
| 23 |
+
print("=" * 60)
|
| 24 |
+
except Exception as e:
|
| 25 |
+
print("=" * 60)
|
| 26 |
+
print(f"❌ STORAGE INITIALIZATION FAILED: {e}")
|
| 27 |
+
print(" Data will not persist across restarts!")
|
| 28 |
+
print("=" * 60)
|
| 29 |
+
import traceback
|
| 30 |
+
traceback.print_exc()
|
| 31 |
+
|
| 32 |
+
# Execute the main GUI module
|
| 33 |
+
exec(open(os.path.join(app_dir, 'data_entry_gui.py')).read())
|
| 34 |
+
|