Adding adapter tests for Qwen2#1309
Conversation
* 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>
TransformerLens 3.1.0
jlarson4
left a comment
There was a problem hiding this comment.
Hi @Rishik00! This is an excellent test suite, I left one comment on the code and have one additional ask:
Can we get some testing for Qwen2's setup_component_testing override? That is the biggest feature that currently isn't getting tested. If you'd like a reference, another contributor has a great example of roughly what I'm looking for in #1311
| return Qwen2ArchitectureAdapter(cfg) | ||
|
|
||
|
|
||
| class FakeQwen2Attention(nn.Module): |
There was a problem hiding this comment.
This is excellent, and it would be great to write some tests that use it, but at present it does not appear wired into anything?
There was a problem hiding this comment.
My apologies. Will wire it up and update the PR!
|
Of course! I will get that added |
|
Apologies for the dummy files commit. I had those accidentally appear from elsewhere, will not let that happen again |
|
@Rishik00 no worries, as long as they're cleaned up they won't be in the final merge! I will review once CI completes |
|
Sure, thank you very much! |
|
Hi @Rishik00! This is great work, I am going to squash merge this now. This will prevent those furunpod files from being introduced to main in the future Make sure to invalidate any keys that may have been included in your initial commits, since they were committed to a public repository they are compromised. |
Description
Adds unit coverage for the Qwen2 architecture adapter.
Changes
To run the test: uv run pytest tests\unit\model_bridge\supported_architectures\test_qwen2_adapter.py
Relevant to Issue #1302 @jlarson4