Add Colab quickstart notebook#12
Open
CodeSarthak wants to merge 1 commit into
Open
Conversation
Adds a self-contained notebook that runs a pretrained NanoWM checkpoint on Google Colab's free T4 GPU, end-to-end: - Pins a known-good huggingface_hub / transformers / diffusers / accelerate set compatible with the existing diffusers==0.24.0 target - Handles the released .safetensors -> .pt conversion needed by find_model - Includes a one-liner idempotent patch for the PyTorch >= 2.6 weights_only default change (see simchowitzlabpublic#10 / PR for an upstream fix) - Uses known-good rollout flags for DINO-WM Point Maze (history_length=3, rollout_length=20, frame_interval=5) - Idempotent cells: safe to re-run individual steps after a kernel restart or transient failure - Inline troubleshooting table mapping each common error to which step to re-run Linked from the README's Quick Start section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a self-contained
colab_quickstart.ipynbat the repo root that runs a pretrained NanoWM checkpoint on free-tier Google Colab end-to-end. Linked from the README's Quick Start section.Motivation
Getting from
git cloneto a working rollout on a fresh machine currently hits several rough edges that aren't covered byenvironment.ymlalone — modernhuggingface_hub/transformersversions break the pinneddiffusers==0.24.0imports, the releasedmodel.safetensorsdoesn't load via the pickle-basedfind_model, PyTorch >= 2.6 changed thetorch.load(weights_only=...)default, etc. The notebook bakes all of these into a single top-to-bottom flow targeted at free-tier Colab (T4 GPU, 15 minutes total).What it does
git clonethe repopip installa pinned dep set (huggingface_hub==0.20.3,transformers==4.36.0,diffusers==0.24.0,accelerate==0.25.0, plus the rest fromenvironment.yml)huggingface_hubat session start)find_modelto passweights_only=False(see find_model fails on PyTorch >= 2.6 (weights_only default change) #10 / linked PR for the upstream fix; the cell becomes a no-op once that lands)snapshot_downloadthe Point Maze B/2 checkpointmodel.safetensors→model.ptsofind_modelcan load itsrc/sample/rollout.pywith known-good DINO-WM Point Maze flags (--history_length 3,--rollout_length 20,--num_sampling_steps 15)compare.mp4inlineEach cell is idempotent so a user can re-run individual steps after a transient failure without resetting the session. A troubleshooting table at the bottom maps each common error to which step to re-run.
Tested
Ran the notebook top to bottom on free-tier Colab T4 — produces the expected
gen/gt/comparemp4s in ~15 minutes total wall-clock.Notes
find_modelweights-only patch issue (find_model fails on PyTorch >= 2.6 (weights_only default change) #10). Once that PR lands, the patch cell will no-op cleanly — no churn needed.