Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,8 @@ import datetime
|
|
| 5 |
import time
|
| 6 |
import requests
|
| 7 |
|
|
|
|
|
|
|
| 8 |
from checks.failed_check import create_failed_gradio_ui
|
| 9 |
from checks.endpoint_check import check_public_endpoint
|
| 10 |
from checks.health_check import check_model_endpoint, should_launch_ui
|
|
@@ -44,6 +46,7 @@ def initialize_agent(endpoint_uri: str):
|
|
| 44 |
prompt_templates=combined_prompts(),
|
| 45 |
additional_authorized_imports=["pytz"]
|
| 46 |
)
|
|
|
|
| 47 |
|
| 48 |
def wake_up_endpoint(endpoint_uri, max_wait=30):
|
| 49 |
"""Poll the endpoint until it responds OK or timeout."""
|
|
@@ -76,8 +79,19 @@ def wake_up_endpoint(endpoint_uri, max_wait=30):
|
|
| 76 |
return False
|
| 77 |
|
| 78 |
def main():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
# Load endpoint and check health
|
| 80 |
|
|
|
|
| 81 |
# Prechecks
|
| 82 |
endpoint_uri = load_huggingface_model() # Get the URI for the endpoint
|
| 83 |
|
|
|
|
| 5 |
import time
|
| 6 |
import requests
|
| 7 |
|
| 8 |
+
from checks.check_gui import StatusUI
|
| 9 |
+
|
| 10 |
from checks.failed_check import create_failed_gradio_ui
|
| 11 |
from checks.endpoint_check import check_public_endpoint
|
| 12 |
from checks.health_check import check_model_endpoint, should_launch_ui
|
|
|
|
| 46 |
prompt_templates=combined_prompts(),
|
| 47 |
additional_authorized_imports=["pytz"]
|
| 48 |
)
|
| 49 |
+
|
| 50 |
|
| 51 |
def wake_up_endpoint(endpoint_uri, max_wait=30):
|
| 52 |
"""Poll the endpoint until it responds OK or timeout."""
|
|
|
|
| 79 |
return False
|
| 80 |
|
| 81 |
def main():
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
ui = StatusUI("🚦 Endpoint Logger")
|
| 85 |
+
ui.launch()
|
| 86 |
+
|
| 87 |
+
# Elsewhere in your code:
|
| 88 |
+
#ui.append("Checking endpoint…")
|
| 89 |
+
#ui.append("✅ Model responded OK.")
|
| 90 |
+
#ui.shutdown()
|
| 91 |
+
|
| 92 |
# Load endpoint and check health
|
| 93 |
|
| 94 |
+
|
| 95 |
# Prechecks
|
| 96 |
endpoint_uri = load_huggingface_model() # Get the URI for the endpoint
|
| 97 |
|