Clarify generic ZeroGPU runtime failures
Browse files
app.py
CHANGED
|
@@ -559,8 +559,8 @@ def ui_inverse_design(n_generate: float, mode: str, load_idx: float, *values: fl
|
|
| 559 |
generated = _run_generation_model(cond_coeffs, n_generate_int)
|
| 560 |
except Exception as exc:
|
| 561 |
exc_text = str(exc)
|
| 562 |
-
if "No CUDA GPUs are available" in exc_text:
|
| 563 |
-
title = "ZeroGPU allocation failed
|
| 564 |
elif "ZeroGPU quota" in exc_text or "quota" in exc_text.lower():
|
| 565 |
title = "ZeroGPU quota is exhausted or unavailable."
|
| 566 |
else:
|
|
@@ -568,9 +568,10 @@ def ui_inverse_design(n_generate: float, mode: str, load_idx: float, *values: fl
|
|
| 568 |
message = (
|
| 569 |
f"{title}\n\n"
|
| 570 |
f"Error: {type(exc).__name__}: {exc_text}\n\n"
|
| 571 |
-
"
|
| 572 |
-
"If the
|
| 573 |
-
"
|
|
|
|
| 574 |
)
|
| 575 |
return (
|
| 576 |
req_plot,
|
|
|
|
| 559 |
generated = _run_generation_model(cond_coeffs, n_generate_int)
|
| 560 |
except Exception as exc:
|
| 561 |
exc_text = str(exc)
|
| 562 |
+
if "No CUDA GPUs are available" in exc_text or exc_text.strip("'\"") == "RuntimeError":
|
| 563 |
+
title = "ZeroGPU allocation failed or returned a generic backend error."
|
| 564 |
elif "ZeroGPU quota" in exc_text or "quota" in exc_text.lower():
|
| 565 |
title = "ZeroGPU quota is exhausted or unavailable."
|
| 566 |
else:
|
|
|
|
| 568 |
message = (
|
| 569 |
f"{title}\n\n"
|
| 570 |
f"Error: {type(exc).__name__}: {exc_text}\n\n"
|
| 571 |
+
"Hugging Face's native ZeroGPU waiting popup only appears while a GPU allocation is actively queued. "
|
| 572 |
+
"If the ZeroGPU backend immediately fails, times out, or returns a generic `RuntimeError`, the app may "
|
| 573 |
+
"only receive this exception after waiting. Retry after quota is restored, authenticate for more quota, "
|
| 574 |
+
"or switch the Space hardware to `Nvidia T4 small`."
|
| 575 |
)
|
| 576 |
return (
|
| 577 |
req_plot,
|