Views
No views yet
Important:trust_remote_code=Trueis required. It downloads the architecture source files from the Hub and imports them into your Python process. Review the source at smithblack-0/llama3_baseline before use.
1from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
2
3# Pull architecture config -- override any parameter at instantiation time
4config = AutoConfig.from_pretrained(
5 "smithblack-0/llama3_baseline",
6 trust_remote_code=True,
7 num_hidden_layers=16, # example override
8)
9
10# Instantiate with fresh random weights -- no checkpoint required
11model = AutoModelForCausalLM.from_config(config, trust_remote_code=True)
12
13# Load tokenizer
14tokenizer = AutoTokenizer.from_pretrained("smithblack-0/llama3_baseline")
15
16# Save and reload after training
17model.save_pretrained("./checkpoint")
18model = AutoModelForCausalLM.from_pretrained("./checkpoint", trust_remote_code=True)| Parameter | Default |
|---|---|
vocab_size | 50277 |
hidden_size | 768 |
intermediate_size | 1568 |
num_hidden_layers | 24 |
num_attention_heads | 16 |
num_key_value_heads | 4 |
head_dim | 48 |
max_position_embeddings | 8192 |
rope_theta | 500000.0 |
EleutherAI/gpt-neox-20b, Apache 2.0).