Upload an image, ask a question, and supply candidate answers. The app returns candidate probabilities, confidence, input token count, and warm model-forward time. A secondary Sokoban tab starts with a two-box route whose shortest solution is 10 moves, with a harder 13-move detour available (verified by exhaustive BFS, never supplied to the model).
This Space runs the actual Valen-Team/Valen-Preview-0923 checkpoint. It was trained on Sokoban after general VQA decision-head training; general VQA results from other checkpoints do not describe this preview. It scores candidates rather than generating free-form answers.
Probabilities are normalized only over the supplied candidates. Confidence is relative to the uniform distribution, not calibrated accuracy.
Model forward (warm) measures one complete backbone + decision-head forward using CUDA events, after one untimed warm-up forward on the same input. Inputs are preprocessed and moved onto the GPU before either pass. Image I/O, queueing, GPU allocation, model loading, preprocessing, input transfers, warm-up, probability normalization, CPU output copies and JSON serialization are excluded. This is warm inference time, not the total time a visitor waits. No layer output or prediction is reused by the measured pass.
The VQA JSON returns forward_seconds, a compatibility alias seconds, and a
timing object documenting the boundaries and pass counts. Sokoban traces use
the same measurement and report timing_scope: warm_model_forward.
Examples run live so their timing reflects a fresh call.
hf auth whoami
python spaces/valen-demo/deploy.py --repo-id YOUR_ACCOUNT/Valen-Preview-0923
The deployment script creates a public ZeroGPU Gradio Space and uploads only this app, its examples, the license, and the required Valen Python packages. It does not upload local credentials, training data, model weights, or run outputs. It does not select hourly billed GPU hardware.
# Produce a self-contained upload directory without changing anything on the Hub.
python spaces/valen-demo/deploy.py --stage-only /tmp/valen-space-release
hf upload YOUR_ACCOUNT/Valen-Preview-0923 /tmp/valen-space-release --repo-type space
runtime.py pins the Valen checkpoint revision and the required base revision, verifies their checksums, preserves stage=vision_top, and strictly validates all trained parameters before serving. PyTorch 2.8 / torchvision 0.23 are paired for ZeroGPU compatibility. Gradio, Spaces and huggingface_hub are managed by the Spaces runtime.
The /answer_vqa endpoint takes an image, a question, and 2–16 newline-separated candidate answers. It returns probabilities, a short metrics description, and structured JSON. The Gradio footer exposes API documentation; MCP is enabled.
from gradio_client import Client, handle_file
client = Client("yuhangzang/Valen-Preview-0923")
probabilities, metrics, details = client.predict(
handle_file("photo.png"), "How many objects are visible?", "2\n3\n4\n5",
api_name="/answer_vqa",
)
Code: Liuziyu77/Valen, Apache 2.0. Example images retain their source licenses; see examples/ATTRIBUTION.md.
5 commits
Upload an image, ask a question, and supply candidate answers. The app returns candidate probabilities, confidence, input token count, and warm model-forward time. A secondary Sokoban tab starts with a two-box route whose shortest solution is 10 moves, with a harder 13-move detour available (verified by exhaustive BFS, never supplied to the model).
This Space runs the actual Valen-Team/Valen-Preview-0923 checkpoint. It was trained on Sokoban after general VQA decision-head training; general VQA results from other checkpoints do not describe this preview. It scores candidates rather than generating free-form answers.
Probabilities are normalized only over the supplied candidates. Confidence is relative to the uniform distribution, not calibrated accuracy.
Model forward (warm) measures one complete backbone + decision-head forward using CUDA events, after one untimed warm-up forward on the same input. Inputs are preprocessed and moved onto the GPU before either pass. Image I/O, queueing, GPU allocation, model loading, preprocessing, input transfers, warm-up, probability normalization, CPU output copies and JSON serialization are excluded. This is warm inference time, not the total time a visitor waits. No layer output or prediction is reused by the measured pass.
The VQA JSON returns forward_seconds, a compatibility alias seconds, and a
timing object documenting the boundaries and pass counts. Sokoban traces use
the same measurement and report timing_scope: warm_model_forward.
Examples run live so their timing reflects a fresh call.
hf auth whoami
python spaces/valen-demo/deploy.py --repo-id YOUR_ACCOUNT/Valen-Preview-0923
The deployment script creates a public ZeroGPU Gradio Space and uploads only this app, its examples, the license, and the required Valen Python packages. It does not upload local credentials, training data, model weights, or run outputs. It does not select hourly billed GPU hardware.
# Produce a self-contained upload directory without changing anything on the Hub.
python spaces/valen-demo/deploy.py --stage-only /tmp/valen-space-release
hf upload YOUR_ACCOUNT/Valen-Preview-0923 /tmp/valen-space-release --repo-type space
runtime.py pins the Valen checkpoint revision and the required base revision, verifies their checksums, preserves stage=vision_top, and strictly validates all trained parameters before serving. PyTorch 2.8 / torchvision 0.23 are paired for ZeroGPU compatibility. Gradio, Spaces and huggingface_hub are managed by the Spaces runtime.
The /answer_vqa endpoint takes an image, a question, and 2–16 newline-separated candidate answers. It returns probabilities, a short metrics description, and structured JSON. The Gradio footer exposes API documentation; MCP is enabled.
from gradio_client import Client, handle_file
client = Client("yuhangzang/Valen-Preview-0923")
probabilities, metrics, details = client.predict(
handle_file("photo.png"), "How many objects are visible?", "2\n3\n4\n5",
api_name="/answer_vqa",
)
Code: Liuziyu77/Valen, Apache 2.0. Example images retain their source licenses; see examples/ATTRIBUTION.md.
5 commits