Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1,25 +1,27 @@
|
|
| 1 |
-
#!/usr/bin/env python3
|
| 2 |
-
"""
|
| 3 |
-
Hugging Face Spaces entry point for Context Thread Agent
|
| 4 |
-
"""
|
| 5 |
-
|
| 6 |
-
import os
|
| 7 |
-
import sys
|
| 8 |
-
from pathlib import Path
|
| 9 |
-
|
| 10 |
-
# Add src to path for imports
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Hugging Face Spaces entry point for Context Thread Agent
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
import os
|
| 7 |
+
import sys
|
| 8 |
+
from pathlib import Path
|
| 9 |
+
|
| 10 |
+
# Add current directory and src to path for imports
|
| 11 |
+
current_dir = Path(__file__).parent
|
| 12 |
+
sys.path.insert(0, str(current_dir))
|
| 13 |
+
sys.path.insert(0, str(current_dir / "src"))
|
| 14 |
+
|
| 15 |
+
# Import and run the Gradio app
|
| 16 |
+
from ui.app import create_gradio_app
|
| 17 |
+
|
| 18 |
+
if __name__ == "__main__":
|
| 19 |
+
# Create and launch the app
|
| 20 |
+
demo = create_gradio_app()
|
| 21 |
+
|
| 22 |
+
# Launch for HF Spaces (they handle port and host)
|
| 23 |
+
demo.launch(
|
| 24 |
+
server_name="0.0.0.0",
|
| 25 |
+
server_port=int(os.environ.get("PORT", 7860)),
|
| 26 |
+
show_error=True
|
| 27 |
+
)
|