Michael Stattelman commited on
Commit
b5cfae6
·
1 Parent(s): 24c5d77

Add application file update

Browse files
Files changed (4) hide show
  1. README.md +4 -0
  2. app.py +17 -0
  3. engine_wrapper.py +1 -1
  4. requirements.txt +1 -0
README.md CHANGED
@@ -45,6 +45,10 @@ What changed for the reader: sample cards are tapped rather than dragged (Gradio
45
  - A missing capability is never reported as tampering.
46
  - Weights are never re-served — the page has no file output component.
47
 
 
 
 
 
48
  ## Configuration
49
 
50
  | env | default | meaning |
 
45
  - A missing capability is never reported as tampering.
46
  - Weights are never re-served — the page has no file output component.
47
 
48
+ ## Hardware
49
+
50
+ The Space runs on the free **ZeroGPU** tier (CPU basic is not selectable for it). ZeroGPU refuses any app without a `@spaces.GPU` function, so `app.py` declares a no-op one that nothing calls; all verification runs on CPU and uses no GPU quota. `requirements.txt` lists `spaces` so the import resolves; locally the import is guarded.
51
+
52
  ## Configuration
53
 
54
  | env | default | meaning |
app.py CHANGED
@@ -35,6 +35,23 @@ from pathlib import Path
35
 
36
  import gradio as gr
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  from engine_wrapper import (
39
  BUILD_STAMP, LOCAL_CMD, MANIFEST, MAX_UPLOAD_BYTES, MAX_UPLOAD_MB,
40
  MAX_REPO_MB, NORMALIZED_NOTE, NOT_A_PACKAGE_COPY, ROOT, SAMPLES_DIR,
 
35
 
36
  import gradio as gr
37
 
38
+ # ZeroGPU runtime (RealFalconsAI/verifier runs on the free ZeroGPU tier — the
39
+ # CPU tier is not selectable for this Space): the runtime kills any app that
40
+ # declares no @spaces.GPU function at startup ("No @spaces.GPU function
41
+ # detected"). The verifier needs no GPU, so the declared function is a no-op
42
+ # that no control ever calls — every verification runs on the CPU path below
43
+ # and consumes no GPU quota. Guarded so `python app.py` runs anywhere.
44
+ try:
45
+ import spaces as _spaces
46
+ except Exception: # not on Spaces, or the package is absent
47
+ _spaces = None
48
+
49
+ if _spaces is not None:
50
+ @_spaces.GPU(duration=1)
51
+ def _zerogpu_placeholder():
52
+ """Declared for the ZeroGPU runtime only. Never invoked."""
53
+ return None
54
+
55
  from engine_wrapper import (
56
  BUILD_STAMP, LOCAL_CMD, MANIFEST, MAX_UPLOAD_BYTES, MAX_UPLOAD_MB,
57
  MAX_REPO_MB, NORMALIZED_NOTE, NOT_A_PACKAGE_COPY, ROOT, SAMPLES_DIR,
engine_wrapper.py CHANGED
@@ -56,7 +56,7 @@ NOT_A_PACKAGE_COPY = (
56
  ATTESTATION_PATTERNS = ("lineage.intoto.jsonl",)
57
 
58
  # Bumped on every delivered build so a running instance is identifiable.
59
- BUILD_STAMP = "2026-09-03.4-gradio"
60
 
61
  # ---------------------------------------------------------------- helpers
62
 
 
56
  ATTESTATION_PATTERNS = ("lineage.intoto.jsonl",)
57
 
58
  # Bumped on every delivered build so a running instance is identifiable.
59
+ BUILD_STAMP = "2026-09-03.5-gradio"
60
 
61
  # ---------------------------------------------------------------- helpers
62
 
requirements.txt CHANGED
@@ -1,3 +1,4 @@
1
  gradio>=4.44,<6
 
2
  cryptography
3
  huggingface_hub
 
1
  gradio>=4.44,<6
2
+ spaces
3
  cryptography
4
  huggingface_hub