feiyang-cai commited on
Commit
4b289bc
·
verified ·
1 Parent(s): 2e9a997

Clarify generic ZeroGPU runtime failures

Browse files
Files changed (1) hide show
  1. app.py +6 -5
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 before CUDA became available."
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
- "If this is running on ZeroGPU, wait and retry if the GPU queue is busy. "
572
- "If the account or organization has exhausted ZeroGPU quota/credits, switch the Space to "
573
- "`Nvidia T4 small` or restore quota before retrying."
 
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,