Skip to content

Commit

Permalink
added new block for recent diagram, and colab compatibility notebook (#…
Browse files Browse the repository at this point in the history
…758)

* added new block for recent diagram, and colab compatability notebook

* updated check

* ran format

* added better checking for prop

* fixed format
  • Loading branch information
bryce13950 authored Oct 16, 2024
1 parent 0dbc7a8 commit ab27ac5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
File renamed without changes
2 changes: 2 additions & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ I used to work for the [Anthropic interpretability team](https://transformer-cir

The core features were heavily inspired by the interface to [Anthropic's excellent Garcon tool](https://transformer-circuits.pub/2021/garcon/index.html). Credit to Nelson Elhage and Chris Olah for building Garcon and showing me the value of good infrastructure for enabling exploratory research!

A great place to start is to take a look at a helpful diagram of [all weight matrices and activation tensors with TransformerLens notation](_static/TransformerLens_Diagram.svg) courtesy of [Austin Kozlowski](https://github.com/akozlo). Another helpful tool to help you get going as quickly as possible is our [Colab Compatability Demo](https://github.com/TransformerLensOrg/TransformerLens/tree/main/demos/Colab_Compatibility.ipynb), which will give you a good idea of what you can do in various Colab environments.

```{toctree}
:hidden:
:caption: Introduction
Expand Down
4 changes: 3 additions & 1 deletion transformer_lens/loading_from_pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,9 @@ def convert_hf_model_config(model_name: str, **kwargs):
use_local_attn = True if hf_config.sliding_window else False
cfg_dict = {
"d_model": hf_config.hidden_size,
"d_head": hf_config.head_dim or hf_config.hidden_size // hf_config.num_attention_heads,
"d_head": hf_config.head_dim
if hasattr(hf_config, "head_dim") and hf_config.head_dim > 0
else hf_config.hidden_size // hf_config.num_attention_heads,
"n_heads": hf_config.num_attention_heads,
"d_mlp": hf_config.intermediate_size,
"n_layers": hf_config.num_hidden_layers,
Expand Down

0 comments on commit ab27ac5

Please sign in to comment.