Skip to content

Commit

Permalink
added llama 3.2-1b
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce13950 committed Sep 26, 2024
1 parent 391fe55 commit c4ac5a9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions transformer_lens/loading_from_pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"meta-llama/Meta-Llama-3-8B-Instruct",
"meta-llama/Meta-Llama-3-70B",
"meta-llama/Meta-Llama-3-70B-Instruct",
"meta-llama/Llama-3.2-1B",
"Baidicoot/Othello-GPT-Transformer-Lens",
"bert-base-cased",
"roneneldan/TinyStories-1M",
Expand Down Expand Up @@ -885,6 +886,25 @@ def convert_hf_model_config(model_name: str, **kwargs):
"final_rms": True,
"gated_mlp": True,
}
elif "Llama-3.2-1B" in official_model_name:
cfg_dict = {
"d_model": 2048,
"d_head": 64,
"n_heads": 32,
"d_mlp": 8192,
"n_layers": 16,
"n_ctx": 2048, # capped due to memory issues
"eps": 1e-5,
"d_vocab": 128256,
"act_fn": "silu",
"n_key_value_heads": 8,
"normalization_type": "RMS",
"positional_embedding_type": "rotary",
"rotary_adjacent_pairs": False,
"rotary_dim": 64,
"final_rms": True,
"gated_mlp": True,
}
elif architecture == "GPTNeoForCausalLM":
cfg_dict = {
"d_model": hf_config.hidden_size,
Expand Down

0 comments on commit c4ac5a9

Please sign in to comment.