Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,11 +22,11 @@ from Gradio_UI import GradioUI
|
|
| 22 |
endpoint_uri = load_huggingface_model()
|
| 23 |
|
| 24 |
# Test the endpoint
|
| 25 |
-
response = check_public_endpoint(endpoint_uri)
|
| 26 |
|
| 27 |
-
|
| 28 |
-
create_failed_gradio_ui()
|
| 29 |
|
|
|
|
|
|
|
| 30 |
else:
|
| 31 |
|
| 32 |
model = HfApiModel(
|
|
@@ -54,6 +54,6 @@ else:
|
|
| 54 |
|
| 55 |
)
|
| 56 |
|
| 57 |
-
|
| 58 |
GradioUI(agent).launch()
|
| 59 |
|
|
|
|
| 22 |
endpoint_uri = load_huggingface_model()
|
| 23 |
|
| 24 |
# Test the endpoint
|
|
|
|
| 25 |
|
| 26 |
+
status_info = check_public_endpoint(endpoint_uri)
|
|
|
|
| 27 |
|
| 28 |
+
if status_info["status"] is False:
|
| 29 |
+
create_failed_gradio_ui()
|
| 30 |
else:
|
| 31 |
|
| 32 |
model = HfApiModel(
|
|
|
|
| 54 |
|
| 55 |
)
|
| 56 |
|
| 57 |
+
# Launch the UI earlier or without passing through the Agent
|
| 58 |
GradioUI(agent).launch()
|
| 59 |
|