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 2500
Browse filesFiles changed (2)
123version https://git-lfs.github.com/spec/v1oid sha256:bc33ae8b68e08ba1591145b95ef79b0f37ed9b24d76250d613e9398c0c2a31c3size 497774208123version https://git-lfs.github.com/spec/v1oid sha256:187341135e5a39efe3694d5989c63d3e7187f124b0e5a9f9007a7d3985194f88size 497774208
123version https://git-lfs.github.com/spec/v1oid sha256:f2082bf63b9beb65d7a0618a09091547d58be4dbf6ec84d309fe74cd2047eab1size 7231123version https://git-lfs.github.com/spec/v1oid sha256:e6ada9ad9624436c3d76791be937f5ef303df4cf910c11c1aee4b3a2ac7ada7asize 7765
model.safetensors+1-1
runs/Oct04_16-35-53_Turing/events.out.tfevents.1728059757.Turing.1254601.0+2-2