Downloads · 30 days
215
54% of all-time downloads
Raising-an-llm/tinystories-30m-instruct
tinystories-30m-instruct is a text generation model from Raising-an-llm. Use it when you need the model to write or continue text. The card lists the license as mit.
A 30M parameter causal language model fine-tuned for instruction-following on the TinyStoriesInstruct dataset.
Downloads · 30 days
215
54% of all-time downloads
All-time downloads
398
Public
Parameters
26.2M
105 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors105 MB · 99%
From the Hugging Face model README
A 30M parameter causal language model fine-tuned for instruction-following on the TinyStoriesInstruct dataset.
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Raising-an-llm/tinystories-30m-instruct")
tokenizer = AutoTokenizer.from_pretrained("Raising-an-llm/tinystories-30m-instruct")
# Format: prompt + "\n\nStory:\n"
prompt = "Write a short story using these words: brave, forest, magical."
formatted = prompt + "\n\nStory:\n"
inputs = tokenizer(formatted, return_tensors="pt")
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.8,
top_p=0.9,
do_sample=True
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
The model was trained on three types of prompts:
Write a short story using these words: [word1], [word2], [word3].Write a story based on this summary: [summary]Write a short story with these features: [feature1], [feature2].Always append \n\nStory:\n after your prompt.