Feature: Get the value for rotary base from the hugging face config, only for Qwen for now. #887
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.
Description
Two line change so that the rope_base parameter in the configuration is taken from the hugging face config if available.
When loading a HookedTransformer from a huggin face model in one of the known architectures, it may be the case that the rope base (also named rope theta) has a different value for the hugging_face model that the default for that architecture.
This is the case for example when loading "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B" into the "Qwen 2.5" architecture.
The code already took the values for "d_vocab" and "load_in_4bit" from the hf config, I am extending it also to rope base.
I have limited it to Qwen models because otherwise many different test fail, but this is a change that will be usefull and accepted I can work on doing the general case, and adding the relevant tests, etc
Fixes # (issue)
Type of change
Please delete options that are not relevant.
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist: