Instructions to use LyaaaaaGames/gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LyaaaaaGames/gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LyaaaaaGames/gpt2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LyaaaaaGames/gpt2") model = AutoModelForCausalLM.from_pretrained("LyaaaaaGames/gpt2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LyaaaaaGames/gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LyaaaaaGames/gpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LyaaaaaGames/gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LyaaaaaGames/gpt2
- SGLang
How to use LyaaaaaGames/gpt2 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 "LyaaaaaGames/gpt2" \ --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": "LyaaaaaGames/gpt2", "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 "LyaaaaaGames/gpt2" \ --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": "LyaaaaaGames/gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LyaaaaaGames/gpt2 with Docker Model Runner:
docker model run hf.co/LyaaaaaGames/gpt2
Download pytorch_model.bin.index.json from LyaaaaaGames/gpt2: direct link, hf CLI and curl.
- Browser
- Download file 12.8 kB
-
https://huggingface.co/LyaaaaaGames/gpt2/resolve/main/pytorch_model.bin.index.json
- Command line
-
hf download hf://LyaaaaaGames/gpt2/pytorch_model.bin.index.json
-
curl -L -o pytorch_model.bin.index.json https://huggingface.co/LyaaaaaGames/gpt2/resolve/main/pytorch_model.bin.index.json
12.8 kB
| { | |
| "metadata": { | |
| "total_size": 653721648.0 | |
| }, | |
| "weight_map": { | |
| "lm_head.weight": "pytorch_model-00004-of-00004.bin", | |
| "transformer.h.0.attn.bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.attn.c_attn.bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.attn.c_attn.weight": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.attn.c_proj.bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.attn.c_proj.weight": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.attn.masked_bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.ln_1.bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.ln_1.weight": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.ln_2.bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.ln_2.weight": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.mlp.c_fc.bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.mlp.c_fc.weight": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.mlp.c_proj.bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.0.mlp.c_proj.weight": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.1.attn.bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.1.attn.c_attn.bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.1.attn.c_attn.weight": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.1.attn.c_proj.bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.1.attn.c_proj.weight": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.1.attn.masked_bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.1.ln_1.bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.1.ln_1.weight": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.1.ln_2.bias": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.1.ln_2.weight": "pytorch_model-00001-of-00004.bin", | |
| "transformer.h.1.mlp.c_fc.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.1.mlp.c_fc.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.1.mlp.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.1.mlp.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.10.attn.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.attn.c_attn.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.attn.c_attn.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.attn.c_proj.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.attn.c_proj.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.attn.masked_bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.ln_1.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.ln_1.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.ln_2.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.ln_2.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.mlp.c_fc.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.mlp.c_fc.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.mlp.c_proj.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.10.mlp.c_proj.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.attn.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.attn.c_attn.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.attn.c_attn.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.attn.c_proj.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.attn.c_proj.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.attn.masked_bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.ln_1.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.ln_1.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.ln_2.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.ln_2.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.mlp.c_fc.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.mlp.c_fc.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.mlp.c_proj.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.11.mlp.c_proj.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.2.attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.attn.c_attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.attn.c_attn.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.attn.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.attn.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.attn.masked_bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.ln_1.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.ln_1.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.ln_2.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.ln_2.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.mlp.c_fc.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.mlp.c_fc.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.mlp.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.2.mlp.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.attn.c_attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.attn.c_attn.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.attn.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.attn.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.attn.masked_bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.ln_1.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.ln_1.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.ln_2.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.ln_2.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.mlp.c_fc.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.mlp.c_fc.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.mlp.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.3.mlp.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.attn.c_attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.attn.c_attn.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.attn.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.attn.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.attn.masked_bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.ln_1.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.ln_1.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.ln_2.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.ln_2.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.mlp.c_fc.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.mlp.c_fc.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.mlp.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.4.mlp.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.attn.c_attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.attn.c_attn.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.attn.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.attn.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.attn.masked_bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.ln_1.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.ln_1.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.ln_2.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.ln_2.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.mlp.c_fc.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.mlp.c_fc.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.mlp.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.5.mlp.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.attn.c_attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.attn.c_attn.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.attn.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.attn.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.attn.masked_bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.ln_1.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.ln_1.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.ln_2.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.ln_2.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.mlp.c_fc.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.mlp.c_fc.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.mlp.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.6.mlp.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.attn.c_attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.attn.c_attn.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.attn.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.attn.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.attn.masked_bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.ln_1.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.ln_1.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.ln_2.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.ln_2.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.mlp.c_fc.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.mlp.c_fc.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.mlp.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.7.mlp.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.8.attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.8.attn.c_attn.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.8.attn.c_attn.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.8.attn.c_proj.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.8.attn.c_proj.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.8.attn.masked_bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.8.ln_1.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.8.ln_1.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.8.ln_2.bias": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.8.ln_2.weight": "pytorch_model-00002-of-00004.bin", | |
| "transformer.h.8.mlp.c_fc.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.8.mlp.c_fc.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.8.mlp.c_proj.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.8.mlp.c_proj.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.attn.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.attn.c_attn.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.attn.c_attn.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.attn.c_proj.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.attn.c_proj.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.attn.masked_bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.ln_1.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.ln_1.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.ln_2.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.ln_2.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.mlp.c_fc.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.mlp.c_fc.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.mlp.c_proj.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.h.9.mlp.c_proj.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.ln_f.bias": "pytorch_model-00003-of-00004.bin", | |
| "transformer.ln_f.weight": "pytorch_model-00003-of-00004.bin", | |
| "transformer.wpe.weight": "pytorch_model-00001-of-00004.bin", | |
| "transformer.wte.weight": "pytorch_model-00001-of-00004.bin" | |
| } | |
| } | |