Spaces:
Running on Zero
Running on Zero
Satisfy ZeroGPU startup check for HF Space
Browse filesThe Space is on ZeroGPU, whose runtime requires at least one
@spaces.GPU-decorated function at import time. Add the decorator
to the compute path and the spaces package to requirements.
Co-Authored-By: Claude <noreply@anthropic.com>
- app.py +2 -0
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -11,6 +11,7 @@ from __future__ import annotations
|
|
| 11 |
|
| 12 |
import gradio as gr
|
| 13 |
from huggingface_hub import HfApi
|
|
|
|
| 14 |
|
| 15 |
from vramcalc import (
|
| 16 |
QUANT_BPW,
|
|
@@ -128,6 +129,7 @@ def _parse_gpu_list(text: str) -> list[float]:
|
|
| 128 |
return out or [24.0]
|
| 129 |
|
| 130 |
|
|
|
|
| 131 |
def compute(
|
| 132 |
arch_fields,
|
| 133 |
quant, n_ctx, cache_dtype, flash_attn, compute_dtype,
|
|
|
|
| 11 |
|
| 12 |
import gradio as gr
|
| 13 |
from huggingface_hub import HfApi
|
| 14 |
+
import spaces # noqa: F401 — present so ZeroGPU detects a GPU-aware Space
|
| 15 |
|
| 16 |
from vramcalc import (
|
| 17 |
QUANT_BPW,
|
|
|
|
| 129 |
return out or [24.0]
|
| 130 |
|
| 131 |
|
| 132 |
+
@spaces.GPU
|
| 133 |
def compute(
|
| 134 |
arch_fields,
|
| 135 |
quant, n_ctx, cache_dtype, flash_attn, compute_dtype,
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
gradio==6.20.0
|
| 2 |
huggingface_hub>=0.20.0
|
| 3 |
-
requests>=2.28.0
|
|
|
|
|
|
| 1 |
gradio==6.20.0
|
| 2 |
huggingface_hub>=0.20.0
|
| 3 |
+
requests>=2.28.0
|
| 4 |
+
spaces>=0.26.0
|