Redesign the sample picker as a tray and animate the collapse
Md. Arafat Islam
8b2d446
Replaces gr.Examples with a dropdown tray that fills all five boxes from
one pick, and stages the readout so the collapse reads as an event rather
than a page swap:
* pressing the button paints an in-flight frame first (BRANCH ->
ENERGIZE -> VALIDATE -> INTERFERE -> COLLAPSE, pulsing under a
scanning line), chained ahead of the model call rather than written
as a generator so it never has to interact with how @spaces.GPU
wraps the function;
* the result then rises in staggered -- banner, metrics, then each
world -- with probability bars wiping out from zero and the phasor
arms drawing before the gold resultant lands on top of them, so the
cancellation is something you watch happen.
Honors prefers-reduced-motion by disabling all of it.
Fix option-ranking bug and rebuild the UI around the hypothesis field
Md. Arafat Islam
6875ac0
Three things, the first of which is why the Space answered badly:
1. The prediction was read from outputs["collapse_probs"], a distribution
over HYPOTHESES (K = 2N), and zipped against the option list -- so
option n was silently paired with hypothesis n and the argmax was
taken over the wrong axis entirely. The answer now comes from
outputs["scores"], the log-probability vector over options, which is
what evaluation/sample_inference.py has always used (7/10 on the same
questions while this demo was near-random).
2. Gradio 6 moved theme/css off the Blocks constructor onto launch();
passing them to Blocks only warns, so the page would have shipped with
no styling at all.
3. Reframed the readout around what the architecture actually does:
each option branches into a supporting and an attacking world, drawn
as complex amplitudes on a per-option phasor diagram whose gold
resultant is visibly shorter than its arms when hypotheses cancel.
Adds the simula…
removed(optional)
Md. Arafat Islam
7eb88de
re organized answer
Md. Arafat Islam
57f73b8
Swap Gradio Examples to the 7 questions the checkpoint answered correctly
Md. Arafat Islam
4d7f53a
Picked from a 10-sample smoke evaluation (7/10 correct) run against this
checkpoint. Drops the two questions it got wrong (plants/CO2, railway
track gaps) so the example buttons showcase working cases.
Add accelerate for device_map="auto" on ZeroGPU
Md. Arafat Islam
757a7d2
HypothesisGenerator (models/generator.py) only takes the
device_map="auto" path when device == "cuda", so this was never needed
for the original CPU-basic deployment -- ZeroGPU's device_map="auto"
load hard-requires it.
Reconfigure for ZeroGPU hardware
Md. Arafat Islam
9c4cd40
Space hardware was switched from CPU basic (now subscription-gated) to
ZeroGPU. Per HF's ZeroGPU docs: import spaces before torch, add spaces
to requirements.txt, and wrap the GPU-touching entry point (reason) in
@spaces.GPU so a physical GPU is attached only for that call's duration.
Model construction/weight loading stays at module scope on the virtual
cuda device ZeroGPU exposes at import time -- config.resolve_device()
already picks cuda first, so no change needed there.
transformer changed to 4.55
Md. Arafat Islam
3a72e0c
Fix requirements.txt dependency conflict and MPS crash, stop tracking __pycache__
Md. Arafat Islam
6ad9378
gradio==6.22.0 (installed by the Space's base image) requires
huggingface-hub>=1.16, which transformers==4.52.4's huggingface-hub<1.0
pin cannot satisfy -- unpin transformers so pip can resolve cleanly.
Also work around a device-mismatch crash when running app.py locally on
Apple Silicon (MPS): models/quantum_layer.py's PennyLane circuit always
returns CPU tensors, which can't multiply against an MPS-resident
parameter. HF Spaces never run on MPS, so this only affects local dev.