Downloads · 30 days
167
40% of all-time downloads
AnirudhRajagopalan1201/tinystories-custom-3M
tinystories-custom-3M is a machine learning model from AnirudhRajagopalan1201. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
--- Model trained on the TinyStories Dataset, replicating https://arxiv.org/abs/2305.07759, based on GPT-Neo architecture.
Downloads · 30 days
167
40% of all-time downloads
All-time downloads
413
Public
Parameters
3.4M
13.7 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors13.7 MB · 74%
From the Hugging Face model README
Model trained on the TinyStories Dataset, replicating https://arxiv.org/abs/2305.07759, based on GPT-Neo architecture.
Hyperparams used to train this model:
"batch_size": 64,
"block_size": 128,
"lr": 6e-4,
"n_layer": 4,
"n_head": 4,
"n_embd": 64,
"dropout": 0.1,
"weight_decay": 0.01,
"epochs": 1,
"eval_interval": 200,
"eval_steps": 50,
"vocab_size": 50257,
"warmup_tokens": 5000,
"gradient_accumulation_steps": 16,
EXAMPLE USAGE
!pip install --quiet transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('AnirudhRajagopalan1201/tinystories-custom-3M')
tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neo-125M")
prompt = "Lily likes cats and dogs. She asked her mom for a dog and her mom said no, so instead she asked"
input_ids = tokenizer.encode(prompt, return_tensors="pt")
output = model.generate(input_ids, temperature=0.2, max_length = 100, do_sample=True)
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
print(output_text)