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 11000
Browse filesFiles changed (3)
1223version https://git-lfs.github.com/spec/v1oid sha256:bc33ae8b68e08ba1591145b95ef79b0f37ed9b24d76250d613e9398c0c2a31c3oid sha256:15ff84935a9b20e30dcd80d7c0199fa6cf117bd8410a7871cc3ccf4219a7bb0fsize 49777420812323version https://git-lfs.github.com/spec/v1oid sha256:f480a55bc5a319faf4a957360304467ecac736f2425c28f28a40812bbfd29711size 16520oid sha256:6aa0dfc28d9260db93451f55b708aa5e7ef5b60c9bd87754a309f66056c9ff65size 168431223version 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