Spaces:
Running on Zero
Running on Zero
zerogpu warm move at boot; cpu-note ordering fix
Browse files
app.py
CHANGED
|
@@ -75,8 +75,12 @@ def gpu_call(fn, *args):
|
|
| 75 |
return out
|
| 76 |
|
| 77 |
|
| 78 |
-
D.warmup() # CPU
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
MODEL_KEYS = list(D.MODEL_REPOS)
|
| 81 |
ANSWER_COLS = ["question", "answer", "confidence"]
|
| 82 |
|
|
@@ -104,6 +108,11 @@ NOTE = """> **Preview checkpoints: 17M and 32M parameters**, trained with RLCD o
|
|
| 104 |
> multilingual input (0.23–0.28) — the tabs still run so you can *watch the calibration behave*,
|
| 105 |
> but route real traffic to stronger checkpoints."""
|
| 106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
def run_triage(model_key, message, tier, threshold):
|
| 109 |
rows, action, r = gpu_call(D.triage, model_key, message, tier, threshold)
|
|
|
|
| 75 |
return out
|
| 76 |
|
| 77 |
|
| 78 |
+
D.warmup() # CPU: weights built + kernels hot at boot
|
| 79 |
+
if ZERO:
|
| 80 |
+
try:
|
| 81 |
+
gpu_call(D.warmup) # first ZeroGPU attach: real-GPU warm move while the UI is still closed
|
| 82 |
+
except Exception as e:
|
| 83 |
+
print("ZeroGPU warm-up skipped:", type(e).__name__, e, flush=True)
|
| 84 |
MODEL_KEYS = list(D.MODEL_REPOS)
|
| 85 |
ANSWER_COLS = ["question", "answer", "confidence"]
|
| 86 |
|
|
|
|
| 108 |
> multilingual input (0.23–0.28) — the tabs still run so you can *watch the calibration behave*,
|
| 109 |
> but route real traffic to stronger checkpoints."""
|
| 110 |
|
| 111 |
+
_NOTE_TAIL = ("\n>\n> **Running on CPU.** ZeroGPU could not attach a GPU for this"
|
| 112 |
+
" Space (`%s`), so answers take a few hundred milliseconds instead of"
|
| 113 |
+
" ~35 ms. Everything still works.") % _GPU_BROKEN["why"].split(":")[0]
|
| 114 |
+
NOTE += _NOTE_TAIL
|
| 115 |
+
|
| 116 |
|
| 117 |
def run_triage(model_key, message, tier, threshold):
|
| 118 |
rows, action, r = gpu_call(D.triage, model_key, message, tier, threshold)
|