Skip to content

get_flashzoi_checkpoint: cache key includes revision; clearer error without torch - #14

Merged
lhqing merged 2 commits into
mainfrom
fix/12-flashzoi-cache-revision
Oct 28, 2026
Merged

lhqing merged 2 commits into
mainfrom
fix/12-flashzoi-cache-revision

Conversation

@lhqing

@lhqing lhqing commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Summary

 get_flashzoi_checkpoint(fold)
-  cache: flashzoi/fold_{fold}.renamed.pt
+  cache: flashzoi/fold_{fold}.{REVISIONS[fold][:12]}.renamed.pt
   _download_and_rename
-    import torch, huggingface_hub          # bare ModuleNotFoundError
+    missing -> FileNotAvailableError("... pip install <pkg>")

-metadata.get_chromvar_score_path(motif)
+metadata.get_chromvar_score_path(motif, *, allow_download=True)

Closes #12

Evidence

  • Before: the three new tests failed:
    • a re-pinned fold reused the warm cache (one download, not two)
    • missing torch / huggingface_hub raised ModuleNotFoundError
    • get_chromvar_score_path(allow_download=False) raised TypeError
  • After: pytest: 31 passed, 1 skipped (needs lab data); ruff check clean.

Merge Danger

Door: two-way

Blast Radius: cache

Existing users download each Flashzoi fold once more; the old fold_N.renamed.pt files stay in their cache unused. Lab-filesystem users are unaffected (the lab checkpoint path is unchanged).

🤖 Generated with Claude Code

lhqing and others added 2 commits October 28, 2026 15:11
…orch

- The renamed checkpoint is cached as fold_{fold}.{revision[:12]}.renamed.pt,
  so re-pinning a fold in REVISIONS no longer reuses the old weights.
- A missing torch or huggingface_hub raises FileNotAvailableError with an
  install hint instead of a bare ModuleNotFoundError.
- metadata.get_chromvar_score_path takes allow_download, like
  get_flashzoi_checkpoint and get_gtf_path.

Closes #12

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@lhqing
lhqing merged commit d5adf2a into main Oct 28, 2026
1 check passed
@lhqing
lhqing deleted the fix/12-flashzoi-cache-revision branch October 28, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_flashzoi_checkpoint: cache key ignores revision; clearer error without torch

2 participants