Text Generation
Transformers
TensorBoard
Safetensors
gpt2
Generated from Trainer
text-generation-inference
Instructions to use frett/clm-gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use frett/clm-gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="frett/clm-gpt2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("frett/clm-gpt2") model = AutoModelForCausalLM.from_pretrained("frett/clm-gpt2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use frett/clm-gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "frett/clm-gpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "frett/clm-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/frett/clm-gpt2
- SGLang
How to use frett/clm-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 "frett/clm-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": "frett/clm-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 "frett/clm-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": "frett/clm-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use frett/clm-gpt2 with Docker Model Runner:
docker model run hf.co/frett/clm-gpt2
Training in progress, step 4500
Browse filesFiles changed (3)
1223version https://git-lfs.github.com/spec/v1oid sha256:b3fe3ea0de2e43e467d300ed29989c1e1afcad189fb0dcbc4b8ff9899d0e741aoid sha256:0ff70d0b5a96c120e2d2d13293833b439b17c69c146e30688d4cad34ef5066c9size 49777420812323version https://git-lfs.github.com/spec/v1oid sha256:8d4cda06463123f59ad0ee1d701e64b829fda8918757594072f3840c053d5e7dsize 9367oid sha256:fafc5a44ddae798ed55b7f4fb1841479db59eb3578b13b6558ce2fe1a7f8204bsize 99011223version https://git-lfs.github.com/spec/v1oid sha256:7a407b531011b197d8dbeb2fe36f14fdaede0b04c4d543a495a96e95efb95309oid sha256:4977f9ca9119b75af6ecf994c7d378a57b51e2df2487f873b441f5891104f881size 5176model.safetensors+1-1
runs/Oct04_16-35-53_Turing/events.out.tfevents.1728059757.Turing.1254601.0+2-2
training_args.bin+1-1