roneneldan/TinyStories
Viewer • Updated • 2.14M • 103k • 1.18k
an 84-million-parameter language model trained from scratch on TinyStories for text completion.
import json, sys
from huggingface_hub import snapshot_download
from safetensors.torch import load_model
from tokenizers import Tokenizer
path = snapshot_download("zhexMa/mallm-base")
sys.path.insert(0, path)
from model import Mallm, MallmConfig
model = Mallm(MallmConfig(**json.load(open(f"{path}/config.json"))))
load_model(model, f"{path}/model.safetensors")
tok = Tokenizer.from_file(f"{path}/tokenizer.json")
for generation, see generate.py in the code repository.
best suited to english children's stories. not instruction-tuned.