Downloads · 30 days
23
17% of all-time downloads
owenqwenllmwine/t-nano-16.6.26
t-nano-16.6.26 is a text generation model from owenqwenllmwine. Use it when you need the model to write or continue text.
This is a small PyTorch LM that was trained on 500M tokens from FineWeb EDU, and 500M tokens from Wikipedia Monthly. It was only trained on English text data.
Downloads · 30 days
23
17% of all-time downloads
All-time downloads
132
Public
Repo size
1.3 GB
Likes
1
Public
Click a slice to open those files.
.pt1.3 GB · 100%
From the Hugging Face model README
This is a small PyTorch LM that was trained on 500M tokens from FineWeb EDU, and 500M tokens from Wikipedia Monthly. It was only trained on English text data.
Run the model with this simple script:
import torch
from huggingface_hub import hf_hub_download
from model import MoELMConfig, MoELanguageModel
from tokenizer_utils import EOS_TOKEN, decode, encode, load_tokenizer, token_id
repo = "owenqwenllmwine/t-nano"
device = "cuda" if torch.cuda.is_available() else "cpu"
ckpt_path = hf_hub_download(repo, "final.pt")
tok_path = hf_hub_download(repo, "tokenizer.json")
tokenizer = load_tokenizer(tok_path)
ckpt = torch.load(ckpt_path, map_location=device)
model = MoELanguageModel(MoELMConfig.from_dict(ckpt["config"])).to(device)
model.load_state_dict(ckpt["model"])
model.eval()
prompt = "The history of artificial intelligence begins"
x = torch.tensor([encode(tokenizer, prompt, add_bos=True)], device=device)
with torch.no_grad():
y = model.generate(
x,
max_new_tokens=200,
eos_token_id=token_id(tokenizer, EOS_TOKEN),
temperature=0.8,
top_k=50,
top_p=0.95,
)
print(decode(tokenizer, y[0].tolist(), skip_special_tokens=True))