karpathy/fineweb-edu-100b-shuffle
Viewer β’ Updated β’ 97.2M β’ 15.5k β’ 176
This is the RL trained checkpoint from Andrej Karpathy's fullstack llm project to build an LLM, nanochat.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "nanochat-students/rl-d20"
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True).to(device)
model.eval()
conversation = [
{"role": "user", "content": "Hello, who are you?"},
]
rendered = tokenizer.apply_chat_template(
conversation,
tokenize=False,
add_generation_prompt=True,
)
model_inputs = tokenizer([rendered], return_tensors="pt").to(model.device)
generated = model.generate(**model_inputs, max_new_tokens=256)
output_ids = generated[0, model_inputs.input_ids.shape[1]:]
print(tokenizer.decode(output_ids, skip_special_tokens=True))
timestamp: 2025-10-15 12:59:52
timestamp: 2025-10-15 13:04:39
Logs from training can be found here: https://huggingface.co/spaces/nanochat-students/trackio