Force unsupported models #877
Open
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.
Adding the "force_unsupported_models" feature
Description
I added the option "force_unsupported_model" in HookedTransformer.from_pretrained.
The new code simply skips the verification of the "official model names" by setting the parameter force_unsupported_model to True. Default parameter is False.
A warning message is printed on the screen when this option is set.
The reason for this addition is that researchers from non-English based countries may be find useful to adopt TransformerLens library to perform interpretability studies with different models in their languages and these models are usually not included in the list of supported models.
Because there are many languages in the world and many different monolingual models, I thought it would be hard to manually add all of these models into the list.
Instead, this option allows the user to force the loading of unsupported models, something that could work perfectly if the model is based on a common architecture.
For example, thanks to this fix I was able to load several Italian models with no issues:
LorenzoDeMattei/GePpeTto (GPT2)
sapienzanlp/Minerva-350M-base-v1.0 (Mistral)
sapienzanlp/Minerva-1B-base-v1.0 (Mistral)
sapienzanlp/Minerva-3B-base-v1.0 (Mistral)
Almawave/Velvet-2B (Mistral)
Sometimes it doesn't work out of the box, for example with sapienzanlp/Minerva-7B-instruct-v1.0 (Mistral), but I still think this option can be valuable to do testing without editing everytime by hand the list of supported models.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
Screenshots
Checklist: