Spaces:
Running on Zero
Running on Zero
Commit ·
c8021f8
1
Parent(s): 49c5602
Add ZeroGPU compatibility marker
Browse files- README.md +6 -0
- gmass_app.py +15 -0
- requirements.txt +1 -0
README.md
CHANGED
|
@@ -42,3 +42,9 @@ English, Ghanaian English, and Twi.
|
|
| 42 |
- `KHAYA_API_KEY` when using hosted Khaya translation.
|
| 43 |
|
| 44 |
Outputs are evaluation signals, not clinical deployment certification.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
- `KHAYA_API_KEY` when using hosted Khaya translation.
|
| 43 |
|
| 44 |
Outputs are evaluation signals, not clinical deployment certification.
|
| 45 |
+
|
| 46 |
+
## Runtime Note
|
| 47 |
+
|
| 48 |
+
This demo uses cloud/API calls and CPU-side orchestration by default. It includes
|
| 49 |
+
a small ZeroGPU compatibility marker for Spaces that are forced onto ZeroGPU,
|
| 50 |
+
but CPU hardware is the intended runtime when available.
|
gmass_app.py
CHANGED
|
@@ -21,6 +21,11 @@ import pandas as pd
|
|
| 21 |
import plotly.graph_objects as go
|
| 22 |
from dotenv import load_dotenv
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
APP_DIR = Path(__file__).resolve().parent
|
| 25 |
ROOT = APP_DIR if (APP_DIR / "configs").exists() else APP_DIR.parent
|
| 26 |
if str(ROOT) not in sys.path:
|
|
@@ -72,6 +77,16 @@ REQUIRED_ENV_BY_MODEL = {
|
|
| 72 |
DEFAULT_RESULTS_PATH = ROOT / "data" / "eval_outputs" / "combined" / "all_models_scored.jsonl"
|
| 73 |
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
def _error(message: str) -> str:
|
| 76 |
return (
|
| 77 |
"<div class='gmass-error'>"
|
|
|
|
| 21 |
import plotly.graph_objects as go
|
| 22 |
from dotenv import load_dotenv
|
| 23 |
|
| 24 |
+
try:
|
| 25 |
+
import spaces
|
| 26 |
+
except Exception: # pragma: no cover - spaces exists only on Hugging Face runtimes
|
| 27 |
+
spaces = None
|
| 28 |
+
|
| 29 |
APP_DIR = Path(__file__).resolve().parent
|
| 30 |
ROOT = APP_DIR if (APP_DIR / "configs").exists() else APP_DIR.parent
|
| 31 |
if str(ROOT) not in sys.path:
|
|
|
|
| 77 |
DEFAULT_RESULTS_PATH = ROOT / "data" / "eval_outputs" / "combined" / "all_models_scored.jsonl"
|
| 78 |
|
| 79 |
|
| 80 |
+
if spaces is not None:
|
| 81 |
+
@spaces.GPU
|
| 82 |
+
def zerogpu_compatibility_probe():
|
| 83 |
+
"""Satisfy ZeroGPU startup checks; G-MASS itself uses API/CPU calls."""
|
| 84 |
+
return "ready"
|
| 85 |
+
else:
|
| 86 |
+
def zerogpu_compatibility_probe():
|
| 87 |
+
return "ready"
|
| 88 |
+
|
| 89 |
+
|
| 90 |
def _error(message: str) -> str:
|
| 91 |
return (
|
| 92 |
"<div class='gmass-error'>"
|
requirements.txt
CHANGED
|
@@ -16,3 +16,4 @@ rich==13.7.1
|
|
| 16 |
jinja2==3.1.4
|
| 17 |
gradio==5.23.1
|
| 18 |
plotly==5.22.0
|
|
|
|
|
|
| 16 |
jinja2==3.1.4
|
| 17 |
gradio==5.23.1
|
| 18 |
plotly==5.22.0
|
| 19 |
+
spaces==0.51.1
|