Small Llama-style causal language model trained from scratch on a cleaned New York historical English corpus.
This is an evaluation model intended for corpus-quality testing. It is not instruction tuned and should be treated as a base text-generation model.
LlamaForCausalLMThis model is useful for:
The model is small and trained for one epoch. It often produces plausible period style but may drift semantically, repeat phrases, or invent incoherent details. Best generations are usually short atmospheric fragments with strong prompts.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "YOUR_USERNAME/timecapsulellm-nyc-100m"
tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=True)
model = AutoModelForCausalLM.from_pretrained(model_id)
prompt = "THE NIGHT FERRY.\nIt was past eleven o'clock when I came down to the East River."
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
inputs.pop("token_type_ids", None)
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=80,
do_sample=True,
temperature=0.82,
top_p=0.92,
top_k=80,
repetition_penalty=1.28,
no_repeat_ngram_size=5,
pad_token_id=tokenizer.pad_token_id,
eos_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(output[0], skip_special_tokens=True))