Fix internal service API base routing for Hugging Face network interface
Browse files- frontend/services/api.py +4 -1
frontend/services/api.py
CHANGED
|
@@ -1,7 +1,10 @@
|
|
| 1 |
import requests
|
| 2 |
import os
|
| 3 |
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
class PvRecNetAPI:
|
| 7 |
@staticmethod
|
|
|
|
| 1 |
import requests
|
| 2 |
import os
|
| 3 |
|
| 4 |
+
# Dynamically pull the port from the environment (will be 7860 on Hugging Face)
|
| 5 |
+
# or fall back to 8000 if you run it locally.
|
| 6 |
+
PORT = os.environ.get("PORT", "8000")
|
| 7 |
+
BASE_URL = f"http://127.0.0.1:{PORT}"
|
| 8 |
|
| 9 |
class PvRecNetAPI:
|
| 10 |
@staticmethod
|