base_model: null
model_creator: Arko007
model_version: v1.0
model_date: 2025-10
model_card_authors:
1import torch
2from model import NanoGPT
3from config import NanoGPTConfig
4from tokenizers import Tokenizer
5
6# Load model
7checkpoint = torch.load('best_model.pt', map_location='cpu', weights_only=False)
8config = checkpoint['config']
9model = NanoGPT(config)
10model.load_state_dict(checkpoint['model'])
11model.eval()
12
13# Load tokenizer
14tokenizer = Tokenizer.from_file('tokenizer.json')
15
16def generate(prompt, max_tokens=100, temperature=0.6):
17 tokens = tokenizer.encode(prompt).ids
18 x = torch.tensor(tokens).unsqueeze(0)
19 with torch.no_grad():
20 output = model.generate(x, max_new_tokens=max_tokens, temperature=temperature, top_k=40)
21 return tokenizer.decode(output.tolist())
22
23prompt = "Artificial intelligence is"
24output = generate(prompt)
25print(output)
1@misc{zenyx_42m_2025,
2 author = {Arko007},
3 title = {Zenyx-42M: Efficient Language Model Trained From Scratch},
4 year = {2025},
5 month = {October},
6 publisher = {Hugging Face},
7 url = {https://huggingface.co/Arko007/Zenyx-42M}
8}