Text Generation
Transformers
PyTorch
Safetensors
English
gpt_neox
causal-lm
pythia
text-generation-inference
Run this model with HF Jobs
Run EleutherAI/pythia-31m on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/EleutherAI/pythia-31m. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/EleutherAI/pythia-31m on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/EleutherAI/pythia-31m. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/EleutherAI/pythia-31m. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use EleutherAI/pythia-31m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EleutherAI/pythia-31m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EleutherAI/pythia-31m")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("EleutherAI/pythia-31m") model = AutoModelForCausalLM.from_pretrained("EleutherAI/pythia-31m", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EleutherAI/pythia-31m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EleutherAI/pythia-31m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EleutherAI/pythia-31m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/EleutherAI/pythia-31m
- SGLang
How to use EleutherAI/pythia-31m 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 "EleutherAI/pythia-31m" \ --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": "EleutherAI/pythia-31m", "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 "EleutherAI/pythia-31m" \ --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": "EleutherAI/pythia-31m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use EleutherAI/pythia-31m with Docker Model Runner:
docker model run hf.co/EleutherAI/pythia-31m
Upload final model (step 143000)
Browse filesFiles changed (8)
- config.jsonAdded+29
- generation_config.jsonAdded+6
- model.safetensorsAdded+3
- mp_rank_00_model_states.ptAdded+3
- pytorch_model.binAdded+3
- special_tokens_map.jsonAdded+23
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+214
1234567891011121314151617181920212223242526272829{ "architectures": [ "GPTNeoXForCausalLM" ], "attention_bias": true, "attention_dropout": 0.0, "bos_token_id": 0, "classifier_dropout": 0.1, "eos_token_id": 0, "hidden_act": "gelu", "hidden_dropout": 0.0, "hidden_size": 256, "initializer_range": 0.02, "intermediate_size": 1024, "layer_norm_eps": 1e-05, "max_position_embeddings": 2048, "model_type": "gpt_neox", "num_attention_heads": 8, "num_hidden_layers": 6, "rope_scaling": null, "rotary_emb_base": 10000, "rotary_pct": 0.25, "tie_word_embeddings": false, "torch_dtype": "float16", "transformers_version": "4.40.0", "use_cache": true, "use_parallel_residual": true, "vocab_size": 50304}123456{ "_from_model_config": true, "bos_token_id": 0, "eos_token_id": 0, "transformers_version": "4.40.0"}123version https://git-lfs.github.com/spec/v1oid sha256:02ddadd516061264cd44b47c84ae49c6641f869e6d3f06c7d0e4855f31e34059size 60997960123version https://git-lfs.github.com/spec/v1oid sha256:0253583400ef9a7be890e68aa3d3b2e8596b55f26daccbbe04362b0a1f133d19size 426960306123version https://git-lfs.github.com/spec/v1oid sha256:c9aa3fe610e2089311df2e6dcaa33b8d2edc9166df5911838e2997510d60b40asize 610141621234567891011121314151617181920212223{ "bos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "eos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "unk_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214{ "add_bos_token": false, "add_eos_token": false, "add_prefix_space": false, "added_tokens_decoder": { "0": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "1": { "content": "<|padding|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "50254": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50255": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50256": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50257": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50258": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50259": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50260": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50261": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50262": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50263": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50264": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50265": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50266": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50267": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50268": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50269": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50270": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50271": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50272": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50273": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50274": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50275": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false }, "50276": { "content": " ", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": false } }, "bos_token": "<|endoftext|>", "clean_up_tokenization_spaces": true, "eos_token": "<|endoftext|>", "model_max_length": 1000000000000000019884624838656, "pad_token": null, "tokenizer_class": "GPTNeoXTokenizer", "unk_token": "<|endoftext|>"}config.jsonAdded+29
generation_config.jsonAdded+6
model.safetensorsAdded+3
mp_rank_00_model_states.ptAdded+3
pytorch_model.binAdded+3
special_tokens_map.jsonAdded+23
tokenizer.jsonAdded
tokenizer_config.jsonAdded+214