qqyule commited on
Commit
cb80875
·
verified ·
1 Parent(s): 535bb9d

Add hidden ZeroGPU probe endpoint

Browse files
Files changed (2) hide show
  1. docs/SPACE_VLM_REPORT.md +10 -34
  2. src/ui/layout.py +24 -0
docs/SPACE_VLM_REPORT.md CHANGED
@@ -1,50 +1,26 @@
1
  # Space VLM Validation Report
2
 
3
- - Generated at: 2026-06-06 04:55 UTC
4
  - Space URL: https://huggingface.co/spaces/build-small-hackathon/ObjectverseDiary
5
  - Space repo: `build-small-hackathon/ObjectverseDiary`
6
- - Overall status: FAIL
7
  - Vision backend expected: `minicpm-v`
8
  - Text backend expected: `mock`
9
 
10
- ## Attempt 1: Paid L4
11
 
12
- - Requested configuration:
13
- - `hardware`: `l4x1`
14
- - `OBJECTVERSE_VISION_BACKEND`: `minicpm-v`
15
- - `VISION_MODEL_ID`: `openbmb/MiniCPM-V-2_6`
16
- - `OBJECTVERSE_TEXT_BACKEND`: `mock`
17
- - Result: failed before validation.
18
- - Error: `HfHubHTTPError: 402 Payment Required`
19
- - Meaning: Hugging Face requires billing or pre-paid credits for the `build-small-hackathon` organization before it can use paid `l4x1` hardware.
20
- - Safety outcome: mock-safe rollback was run after the failed hardware request.
21
-
22
- ## Attempt 2: ZeroGPU
23
 
24
- - Local compatibility update:
25
- - Added optional `@spaces.GPU` support through `src/utils/zero_gpu.py`.
26
- - Wrapped the Gradio generation callback with `@zero_gpu(duration=180)`.
27
- - Uploaded the ZeroGPU-compatible app code to the Space.
28
- - Requested configuration:
29
- - `hardware`: `zero-a10g`
30
- - `OBJECTVERSE_VISION_BACKEND`: `minicpm-v`
31
- - `VISION_MODEL_ID`: `openbmb/MiniCPM-V-2_6`
32
  - `OBJECTVERSE_TEXT_BACKEND`: `mock`
33
- - Result: Space reached `RUNNING` on `zero-a10g`, and `/config` was reachable, but the validation request did not return within the practical waiting window.
34
- - Observed logs: app startup only; no model load or inference error was shown in the fetched Space logs.
35
- - Safety outcome: the stuck local validation process was terminated, then mock-safe rollback was run.
36
- - Post-rollback runtime check: Space is `RUNNING` with `hardware=cpu-basic` and `requested_hardware=cpu-basic`.
37
 
38
  ## Results
39
 
40
- - Coffee mug: NOT RUN to completion
41
- - Computer keyboard: NOT RUN to completion
42
- - Running shoe: NOT RUN to completion
43
-
44
  ## Notes
45
 
46
  - Test images are temporary public Wikimedia Commons assets and are not committed.
47
- - Text generation remains mock during this validation plan.
48
- - No tokens, secrets, or private file paths are recorded in this report.
49
- - The validation script now has configuration-failure reporting, Gradio config retry, rollback-on-validation-failure, and per-prediction timeout protection.
50
- - Next unblock step: enable billing/pre-paid credits for the Hugging Face organization, or debug the ZeroGPU queue/request path with a smaller VLM or a minimal ZeroGPU probe before retrying full MiniCPM-V validation.
 
1
  # Space VLM Validation Report
2
 
3
+ - Generated at: 2026-06-06 05:19:42 UTC
4
  - Space URL: https://huggingface.co/spaces/build-small-hackathon/ObjectverseDiary
5
  - Space repo: `build-small-hackathon/ObjectverseDiary`
6
+ - Overall status: NOT RUN
7
  - Vision backend expected: `minicpm-v`
8
  - Text backend expected: `mock`
9
 
10
+ ## Space Configuration
11
 
12
+ - Applied configuration: not changed by this run.
 
 
 
 
 
 
 
 
 
 
13
 
14
+ - Rollback configuration:
15
+ - `repo_id`: `build-small-hackathon/ObjectverseDiary`
16
+ - `hardware`: `cpu-basic`
17
+ - `OBJECTVERSE_VISION_BACKEND`: `mock`
 
 
 
 
18
  - `OBJECTVERSE_TEXT_BACKEND`: `mock`
 
 
 
 
19
 
20
  ## Results
21
 
 
 
 
 
22
  ## Notes
23
 
24
  - Test images are temporary public Wikimedia Commons assets and are not committed.
25
+ - No tokens, secrets, or private file paths should be recorded in this report.
26
+ - If validation fails, switch `OBJECTVERSE_VISION_BACKEND` back to `mock` to keep the demo usable.
 
 
src/ui/layout.py CHANGED
@@ -89,6 +89,8 @@ def build_app() -> gr.Blocks:
89
  )
90
 
91
  result_state = gr.State()
 
 
92
 
93
  with gr.Row(elem_id="archive-main-grid", elem_classes=["archive-grid"]):
94
  with gr.Column(scale=4, elem_classes=["archive-panel", "intake-panel"]):
@@ -210,6 +212,12 @@ def build_app() -> gr.Blocks:
210
  inputs=[chat_input, chatbot, result_state],
211
  outputs=[chatbot, chat_input],
212
  )
 
 
 
 
 
 
213
 
214
  return demo
215
 
@@ -376,3 +384,19 @@ def chat_with_object(
376
  history.append({"role": "user", "content": clean_message})
377
  history.append({"role": "assistant", "content": reply})
378
  return history, ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  )
90
 
91
  result_state = gr.State()
92
+ zero_gpu_probe_button = gr.Button(visible=False)
93
+ zero_gpu_probe_output = gr.JSON(visible=False)
94
 
95
  with gr.Row(elem_id="archive-main-grid", elem_classes=["archive-grid"]):
96
  with gr.Column(scale=4, elem_classes=["archive-panel", "intake-panel"]):
 
212
  inputs=[chat_input, chatbot, result_state],
213
  outputs=[chatbot, chat_input],
214
  )
215
+ zero_gpu_probe_button.click(
216
+ fn=zero_gpu_probe,
217
+ inputs=[],
218
+ outputs=[zero_gpu_probe_output],
219
+ api_name="zero_gpu_probe",
220
+ )
221
 
222
  return demo
223
 
 
384
  history.append({"role": "user", "content": clean_message})
385
  history.append({"role": "assistant", "content": reply})
386
  return history, ""
387
+
388
+
389
+ @zero_gpu(duration=30)
390
+ def zero_gpu_probe() -> dict[str, Any]:
391
+ try:
392
+ import torch
393
+ except Exception as exc:
394
+ return {"torch_import": False, "error": f"{type(exc).__name__}: {exc}"}
395
+
396
+ cuda_available = torch.cuda.is_available()
397
+ return {
398
+ "torch_import": True,
399
+ "cuda_available": cuda_available,
400
+ "device_count": torch.cuda.device_count(),
401
+ "device_name": torch.cuda.get_device_name(0) if cuda_available else "",
402
+ }