shivik-m2.2 / load_and_test.py
ziadrone's picture
Upload Shivik-M2 with merges.txt (clean)
054c77e verified
raw
history blame contribute delete
613 Bytes
# load_and_test.py - quick load test
import sys, os
sys.path.insert(0, os.getcwd())
from tokenization_shivik_m1 import ShivikM1Tokenizer
from modeling_shivik_m2 import ShivikM2Config, ShivikM2ForCausalLM
repo = "/workspace/shivik-m2"
tok = ShivikM1Tokenizer.from_pretrained(repo, local_files_only=True)
print("Tokenizer loaded ✓ vocab_size =", tok.vocab_size)
cfg = ShivikM2Config()
model = ShivikM2ForCausalLM(cfg)
print("Model instance created ✓")
# test forward with random IDs
import torch
x = torch.randint(0, tok.vocab_size, (2, 8))
out = model(x)
print("Forward OK, logits shape:", out.logits.shape)