Instructions to use ableian/TeenyTinyStories-1M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ableian/TeenyTinyStories-1M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ableian/TeenyTinyStories-1M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ableian/TeenyTinyStories-1M") model = AutoModelForCausalLM.from_pretrained("ableian/TeenyTinyStories-1M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ableian/TeenyTinyStories-1M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ableian/TeenyTinyStories-1M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ableian/TeenyTinyStories-1M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ableian/TeenyTinyStories-1M
- SGLang
How to use ableian/TeenyTinyStories-1M with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ableian/TeenyTinyStories-1M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ableian/TeenyTinyStories-1M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ableian/TeenyTinyStories-1M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ableian/TeenyTinyStories-1M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ableian/TeenyTinyStories-1M with Docker Model Runner:
docker model run hf.co/ableian/TeenyTinyStories-1M
TeenyTinyStories-1M
GPT-Neo storyteller (nominal 1M; actual 3,745,984 parameters including the
50,257-token embedding) trained on TeenyTinyStories (TTS): 2,491,490 stories
(498.5M tokens with EOS) generated by roneneldan/TinyStories-Instruct-33M.
Training
- Architecture: GPT-Neo, 8 layers, hidden 64, 16 heads, window 256, context 512, fp32.
- Budget: 20 epochs over written train tokens (15,212 steps x 655,360 tokens = 9.97B tokens), batch 1280 x 512, constant LR 5e-4, weight decay 0.1, betas (0.9, 0.95), clip 1.0.
- Tokenizer:
EleutherAI/gpt-neo-125M(EOS 50256; one EOS per story).
Held-out loss (nats, full files)
- TTS-val (20,000 stories): 1.987 / ppl 7.29
- TS-valid capped to stories of at most 400 tokens (20,711 stories): 2.369 / ppl 10.69
- TS-valid full (21,990 stories): 2.385 / ppl 10.86
Intended use
Research on small-scale synthetic pretraining data. Generates simple children's stories; sample at temperature 0.8-1.0. See the TeenyTinyStories paper for the corpus recipe and judge evaluations.
License
Apache-2.0.
- Downloads last month
- 48