Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- README.md +1 -1
- app.py +2 -1
- commercial_dashboard.py +2 -1
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
title: agent_system
|
| 3 |
-
app_file:
|
| 4 |
sdk: gradio
|
| 5 |
sdk_version: 6.3.0
|
| 6 |
---
|
|
|
|
| 1 |
---
|
| 2 |
title: agent_system
|
| 3 |
+
app_file: app.py
|
| 4 |
sdk: gradio
|
| 5 |
sdk_version: 6.3.0
|
| 6 |
---
|
app.py
CHANGED
|
@@ -7,6 +7,7 @@ from commercial_dashboard import demo as gradio_demo
|
|
| 7 |
|
| 8 |
# This is the secret sauce for Hugging Face:
|
| 9 |
# Mount the FastAPI (Brain) and Gradio (Dashboard) on the same server!
|
|
|
|
| 10 |
app = FastAPI()
|
| 11 |
|
| 12 |
# Mount existing Brain Service routes
|
|
@@ -18,7 +19,7 @@ def health():
|
|
| 18 |
|
| 19 |
# Wrap the Gradio App
|
| 20 |
app = gr.mount_gradio_app(app, gradio_demo, path="/",
|
| 21 |
-
allowed_paths=[
|
| 22 |
|
| 23 |
if __name__ == "__main__":
|
| 24 |
# HF looks for an app running on port 7860
|
|
|
|
| 7 |
|
| 8 |
# This is the secret sauce for Hugging Face:
|
| 9 |
# Mount the FastAPI (Brain) and Gradio (Dashboard) on the same server!
|
| 10 |
+
os.environ["UNIFIED_MODE"] = "1"
|
| 11 |
app = FastAPI()
|
| 12 |
|
| 13 |
# Mount existing Brain Service routes
|
|
|
|
| 19 |
|
| 20 |
# Wrap the Gradio App
|
| 21 |
app = gr.mount_gradio_app(app, gradio_demo, path="/",
|
| 22 |
+
allowed_paths=[os.getcwd()])
|
| 23 |
|
| 24 |
if __name__ == "__main__":
|
| 25 |
# HF looks for an app running on port 7860
|
commercial_dashboard.py
CHANGED
|
@@ -7,8 +7,9 @@ import time
|
|
| 7 |
import os
|
| 8 |
|
| 9 |
# Configuration: Points to our FastAPI Microservice
|
|
|
|
| 10 |
API_BASE = os.getenv("API_BASE", "http://localhost:8001")
|
| 11 |
-
if os.getenv("SPACE_ID") or os.
|
| 12 |
# If on HF OR running unified app.py locally
|
| 13 |
API_BASE = "http://localhost:7860/api"
|
| 14 |
|
|
|
|
| 7 |
import os
|
| 8 |
|
| 9 |
# Configuration: Points to our FastAPI Microservice
|
| 10 |
+
# On Hugging Face (Unified), this will be 'http://localhost:7860/api'
|
| 11 |
API_BASE = os.getenv("API_BASE", "http://localhost:8001")
|
| 12 |
+
if os.getenv("SPACE_ID") or os.getenv("UNIFIED_MODE") == "1":
|
| 13 |
# If on HF OR running unified app.py locally
|
| 14 |
API_BASE = "http://localhost:7860/api"
|
| 15 |
|