Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from_pretrained has correct return type (i.e. HookedSAETransformer.from_pretrained returns HookedSAETransformer) #743

Merged

Conversation

callummcdougall
Copy link
Contributor

Description

This changes the type signature of from_pretrained, so its return type is the generic type of the base class. For example, now when we use HookedSAETransformer.from_pretrained, the expected return type is HookedSAETransformer not HookedTransformer.

I changed this because in my SAE intro material I was having to explicitly type-annotate as sae: HookedSAETransformer = HookedSAETransformer.from_pretrained(...), and so just changing the type signature seemed like the best option.

@bryce13950 bryce13950 changed the base branch from main to dev October 4, 2024 22:37
@bryce13950
Copy link
Collaborator

Makes sense!

@bryce13950 bryce13950 merged commit ef1295a into TransformerLensOrg:dev Oct 4, 2024
12 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.

2 participants