mozzic commited on
Commit
05892df
·
verified ·
1 Parent(s): 8e3bb5d

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +27 -25
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
- sys.path.insert(0, str(Path(__file__).parent / "src"))
12
-
13
- # Import and run the Gradio app
14
- from ui.app import create_gradio_app
15
-
16
- if __name__ == "__main__":
17
- # Create and launch the app
18
- demo = create_gradio_app()
19
-
20
- # Launch for HF Spaces (they handle port and host)
21
- demo.launch(
22
- server_name="0.0.0.0",
23
- server_port=int(os.environ.get("PORT", 7860)),
24
- show_error=True
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
+ )