Skip to content

Add OPT architecture adapter tests#1305

Merged
jlarson4 merged 6 commits into
TransformerLensOrg:devfrom
willytop8:test-opt-architecture-adapter
May 15, 2026
Merged

Add OPT architecture adapter tests#1305
jlarson4 merged 6 commits into
TransformerLensOrg:devfrom
willytop8:test-opt-architecture-adapter

Conversation

@willytop8
Copy link
Copy Markdown

Adds tests for the OPT architecture adapter covering config defaults, post-norm behavior, weight conversions, component mappings, the OPT-350m projection path, and factory registration.

Tested with:

  • uv run pytest tests/unit/model_bridge/supported_architectures/test_opt_adapter.py

Contributes to #1302

brendanlong and others added 5 commits April 20, 2026 14:50
* Fix type of HookedTransformerConfig.device

This is typed as `Optional[str]` but sometimes returns `torch.device`.
Updated the code to just return the `str` instead of wrapping with a
device.

I'm not confident that every function which takes a device will
always be passed a string, so I didn't change functions like
warn_if_mps.

Found while working on TransformerLensOrg#1219

* more cleanup

* 3.0 CI Bugs (TransformerLensOrg#1261)

* Fixing `utils` imports

* skip gated notebooks on PR from forks

* Updating notebooks

* Ensure LLaMA only runs when HF_TOKEN is available

---------

Co-authored-by: jlarson4 <jonahalarson@comcast.net>
@willytop8 willytop8 force-pushed the test-opt-architecture-adapter branch from e67f76f to 6647d36 Compare May 15, 2026 04:01
@jlarson4 jlarson4 changed the base branch from main to dev May 15, 2026 15:04
@jlarson4
Copy link
Copy Markdown
Collaborator

Looks great, thanks @willytop8

@jlarson4 jlarson4 merged commit 9a7ebf7 into TransformerLensOrg:dev May 15, 2026
47 of 48 checks passed
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.

3 participants