Instructions to use spachava/custom-gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use spachava/custom-gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="spachava/custom-gpt2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("spachava/custom-gpt2") model = AutoModelForCausalLM.from_pretrained("spachava/custom-gpt2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use spachava/custom-gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "spachava/custom-gpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "spachava/custom-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/spachava/custom-gpt2
- SGLang
How to use spachava/custom-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 "spachava/custom-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": "spachava/custom-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 "spachava/custom-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": "spachava/custom-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use spachava/custom-gpt2 with Docker Model Runner:
docker model run hf.co/spachava/custom-gpt2
Commit History
-
Training in progress, step 30500
9dac261 -
Training in progress, step 30000
47cabdb -
Training in progress, step 29500
e8e43ed -
Training in progress, step 29000
f3b1da2 -
Training in progress, step 28500
caf4596 -
Training in progress, step 28000
a7e8606 -
Training in progress, step 27500
532706a -
Training in progress, step 27000
bc43e85 -
Training in progress, step 26500
36aab79 -
Training in progress, step 26000
b78f535 -
Training in progress, step 25500
d91799a -
Training in progress, step 25000
b6453e2 -
Training in progress, step 24500
9e2b19b -
Training in progress, step 24000
d467b5c -
Training in progress, step 23500
1a17ddf -
Training in progress, step 23000
b409fc0 -
Training in progress, step 22500
fa69d15 -
Training in progress, step 22000
d8e95e8 -
Training in progress, step 21500
c39223c -
Training in progress, step 21000
8153a29 -
Training in progress, step 20500
c0cd631 -
Training in progress, step 20000
55c2832 -
Training in progress, step 19500
34c99ca -
Training in progress, step 19000
a3db0c8 -
Training in progress, step 18500
e9efa1b -
Training in progress, step 18000
bf9cae7 -
Training in progress, step 17500
467f16f -
Training in progress, step 17000
2878b05 -
Training in progress, step 16500
946b0b3 -
Training in progress, step 16000
c8bc369 -
Training in progress, step 15500
851f8e5 -
Training in progress, step 15000
c4bd4a6 -
Training in progress, step 14500
b8a40b3 -
Training in progress, step 14000
b9a10f0 -
Training in progress, step 13500
9a297d8 -
Training in progress, step 13000
0a4eed4 -
Training in progress, step 12500
343d3cf -
Training in progress, step 12000
9a2b865 -
Training in progress, step 11500
df3489b -
Training in progress, step 11000
8cf5fcb -
Training in progress, step 10500
d8b0007 -
Training in progress, step 10000
c159a39 -
Training in progress, step 9500
3ea26a2 -
Training in progress, step 9000
224f7e6 -
Training in progress, step 8500
755fa56 -
Training in progress, step 8000
df275d8 -
Training in progress, step 7500
20151a0 -
Training in progress, step 7000
d0773f3 -
Training in progress, step 6500
c3f2108 -
Training in progress, step 6000
3dcca5c