callummcdougall / sae_vis

Create feature-centric and prompt-centric visualizations for sparse autoencoders (like those from Anthropic's published research).
MIT License
137 stars 27 forks source link

load a local model #56

Open ypw-lbj opened 2 months ago

ypw-lbj commented 2 months ago

How can I load a local model instead of downloading it through huggingface? Is there any sample code?

callummcdougall commented 2 months ago

The SaeVisData.create method can take a model stored locally, so hopefully this should work! It only supports TransformerLens models currently, but that's because they offer a lot of useful syntax that fits nicely into the SAE framework I use in this library.

Also want to flag that going forwards SAELens will probably have more development and iteration than this library (and it uses a fork of this vis repo), so depending on your use case I'd recommend checking that out!