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/SHRAM before use. Those interested can also clone the git repository at https://github.com/smithblack-0/advanced-transformers-lib
H(x) = h_l(x) + h_s(x):1from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
2
3# Step 1: pull the architecture config from the Hub.
4# AutoConfig.from_pretrained downloads config.json only — no weights are loaded.
5# Override any parameter via kwargs.
6config = AutoConfig.from_pretrained(
7 "smithblack-0/SHRAM",
8 trust_remote_code=True,
9 num_decoder_layers=16, # example override
10 num_mosrah_heads=32, # example override
11)
12
13# Step 2: instantiate with fresh random weights.
14# from_config never loads a checkpoint — it always produces a randomly initialised model.
15model = AutoModelForCausalLM.from_config(config, trust_remote_code=True)
16
17# Step 3: load the tokenizer.
18tokenizer = AutoTokenizer.from_pretrained("smithblack-0/SHRAM")1model.save_pretrained("./my-checkpoint")
2model = AutoModelForCausalLM.from_pretrained("./my-checkpoint", trust_remote_code=True)AutoConfig.from_pretrained with
no overrides. They are not the parameters of a pretrained model — this repository
contains no weights. All values are overridable via kwargs.| Parameter | Default |
|---|---|
alpha | 1.0 |
attention_dropout | 0.0 |
beta | 32.0 |
dtype | None |
embedding_width | 512 |
head_dim | 16 |
inference_sequence_length | 1024 |
local_rope_theta | 10000.0 |
mlp_width | 1366 |
mosrah_rope_theta | 10000.0 |
num_decoder_layers | 12 |
num_mosrah_heads | 16 |
num_selected_heads | 16 |
num_sliding_window_heads | 16 |
output_hidden_states | False |
rms_norm_eps | 1e-05 |
rope_mode | main_sequence |
tie_word_embeddings | False |
training_sequence_length | 1024 |
use_cache | True |
use_residual_gate | True |
vocab_size | 50277 |
window_size | 128 |
EleutherAI/gpt-neox-20b, Apache 2.0).