Skip to content

Commit c59ea73

Browse files
committed
fix: restore shuffled Imagenette sampling for PyPI hyperview 0.2.0
1 parent a9de67d commit c59ea73

File tree

1 file changed

+3
-0
lines changed
  • spaces/imagenette-clip-hycoclip

1 file changed

+3
-0
lines changed

spaces/imagenette-clip-hycoclip/demo.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
HF_IMAGE_KEY = os.environ.get("DEMO_HF_IMAGE_KEY", "image")
2323
HF_LABEL_KEY = os.environ.get("DEMO_HF_LABEL_KEY", "label")
2424
NUM_SAMPLES = int(os.environ.get("DEMO_SAMPLES", "300"))
25+
SAMPLE_SEED = int(os.environ.get("DEMO_SEED", "42"))
2526

2627
CLIP_MODEL_ID = os.environ.get("DEMO_CLIP_MODEL", "openai/clip-vit-base-patch32")
2728
HYPER_MODEL_ID = os.environ.get("DEMO_HYPER_MODEL", "hycoclip-vit-s")
@@ -43,6 +44,8 @@ def _ensure_demo_ready(dataset: hv.Dataset) -> None:
4344
image_key=HF_IMAGE_KEY,
4445
label_key=HF_LABEL_KEY,
4546
max_samples=NUM_SAMPLES,
47+
shuffle=True,
48+
seed=SAMPLE_SEED,
4649
)
4750

4851
spaces = dataset.list_spaces()

0 commit comments

Comments
 (0)