fix(causal): stabilize Colab causal intervention reproduction#2
Conversation
Keep the trimmed clamp tensor in a distinct local variable so the closure can read the captured min_dt value before slicing it. This removes the UnboundLocalError that stopped the Colab reproduction on the first all_layer sample.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModified Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can approve the review once all CodeRabbit's comments are resolved.Enable the |
Adds a Colab-friendly reproduction notebook that clones the repository automatically and runs the causal intervention sweep from the published branch.
Also fixes the hook shadowing bug in
scripts/run_causal_intervention.pythat caused the firstall_layersample to abort withUnboundLocalErrorinside the clamp path.This keeps the reproduction runnable from a fresh Colab runtime without manual repository upload.
Summary by CodeRabbit