No HuggingFace Transformers dependency. Pure PyTorch with SDPA, GQA, QK-Norm, Z-loss.
1import torch, sentencepiece as spm
2from huggingface_hub import hf_hub_download
3
4# Load BPE tokenizer
5sp = spm.SentencePieceProcessor()
6sp.load(hf_hub_download("eyanchao/echoic-lite", "bpe_tokenizer.model"))
7
8# Model: EchoicLM_1B (dim=1408, layers=32, heads=32, kv_heads=8, seq_len=512)
9# See echoic_v30_bpe.ipynb for full class definition
10
11def generate(prompt, model, max_tokens=200, temp=0.8, top_k=50):
12 x = torch.tensor([sp.encode(prompt)], dtype=torch.long)
13 out = model.generate(x, max_new_tokens=max_tokens, temperature=temp, top_k=top_k)
14 return sp.decode(out[0].tolist())
v26 60M → v27 200M → v28 480M → v29 1B → v30 BPE 1B → ...
↑ current
v26-v29 were character-level (98 vocab). v30 switches to BPE 32k vocab with seq_len 512 for serious reasoning capability.