Views
No views yet
LLM_350M_DENSE is a foundational, autoregressive, dense transformer large language model containing approximately 350 million parameters. This model was built, initialized, and trained from scratch using the custom architecture templates provided in the companion firdavsus/LLM_350M_DENSE GitHub repository.uz) or specific code structures.1import torch
2from model import Transformer, ModelArgs # Imported from your firdavsus/LLM_350M_DENSE repository
3from tokenizer import Tokenizer
4
5# 1. Initialize architectural parameters
6args = ModelArgs(
7 dim=1024,
8 n_layers=24,
9 n_heads=16,
10 vocab_size=32000,
11 max_seq_len=2048
12)
13
14# 2. Build model and load checkpoint weights
15device = "cuda" if torch.cuda.is_available() else "cpu"
16model = Transformer(args).to(device)
17
18checkpoint = torch.load("path_to_model_checkpoint.pt", map_location=device)
19model.load_state_dict(checkpoint["model"])
20model.eval()
21
22print("Model architecture compiled and weights successfully loaded from disk.")