Instructions to use roneneldan/TinyStories-1M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use roneneldan/TinyStories-1M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="roneneldan/TinyStories-1M")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("roneneldan/TinyStories-1M") model = AutoModelForCausalLM.from_pretrained("roneneldan/TinyStories-1M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use roneneldan/TinyStories-1M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "roneneldan/TinyStories-1M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "roneneldan/TinyStories-1M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/roneneldan/TinyStories-1M
- SGLang
How to use roneneldan/TinyStories-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 "roneneldan/TinyStories-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": "roneneldan/TinyStories-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 "roneneldan/TinyStories-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": "roneneldan/TinyStories-1M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use roneneldan/TinyStories-1M with Docker Model Runner:
docker model run hf.co/roneneldan/TinyStories-1M
Which 10K tokens?
Hi! I'm trying to figure out which of the token embeddings have been trained and which are unused on the training data. It doesn't seem to be the first 10K by ID, and (if I understand correctly) the dataset itself will produce more than 10K distinct tokens if I run the standard GPT-Neo tokenizer on it.
Is the 10K most frequent GPT-Neo tokens in the training split (or the entire dataset)? Do you have a list of the IDs somewhere?
Looking at the embeddings (PCA components, etc), there don't seem to be 10K that are linearly separable, although it does look bimodal as expected.
Also, the tokenizer included in this repo (with 50k tokens) is just the GPT-Neo one, correct?
Thanks!
I am also wondering how this worked for them. Ideally, getting code for their implementation would solve our questions... I am new to tokenizing, but Grok tells me this when giving instructions how to get the 10k top used tokens (says to create a new tokenizer from the GPT-Neo tokens):
Doing this “by hand” can be tricky because GPT-2–style merges define how tokens get combined. If you strip out tokens but keep merges that produce them, you can end up in an inconsistent state