Views
No views yet
[64, 16, 8, 4] tokens.dim to hidden_dim.dim.dim * 4 sequential FFNs, the hidden dimension is scaled to:
$$\text{hidden_dim} = \text{round_to_multiple_of_8}\left(\frac{8}{3} \times \text{dim}\right)$$64 tokens16 tokens8 tokens4 tokensres3):
ln3):
ln3 is added after the SwiGLU addition inside every MSITBranchBlock.ln_post_moe):
ln_post_moe is added after the Residual 4 MoE aggregation.main branch)1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model = AutoModelForCausalLM.from_pretrained(
5 "SRJ5035/sw_glu_sw_64_16_8_4_xpert_gpt",
6 revision="main",
7 trust_remote_code=True
8).eval()
9
10tokenizer = AutoTokenizer.from_pretrained(
11 "SRJ5035/sw_glu_sw_64_16_8_4_xpert_gpt",
12 revision="main"
13)chck_5M)1model_5m = AutoModelForCausalLM.from_pretrained(
2 "SRJ5035/sw_glu_sw_64_16_8_4_xpert_gpt",
3 revision="chck_5M",
4 trust_remote_code=True
5).eval()