Instructions to use khleeloo/gpt2-wikitext2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khleeloo/gpt2-wikitext2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="khleeloo/gpt2-wikitext2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("khleeloo/gpt2-wikitext2") model = AutoModelForCausalLM.from_pretrained("khleeloo/gpt2-wikitext2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use khleeloo/gpt2-wikitext2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "khleeloo/gpt2-wikitext2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "khleeloo/gpt2-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/khleeloo/gpt2-wikitext2
- SGLang
How to use khleeloo/gpt2-wikitext2 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 "khleeloo/gpt2-wikitext2" \ --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": "khleeloo/gpt2-wikitext2", "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 "khleeloo/gpt2-wikitext2" \ --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": "khleeloo/gpt2-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use khleeloo/gpt2-wikitext2 with Docker Model Runner:
docker model run hf.co/khleeloo/gpt2-wikitext2
Commit History
-
End of training
3447cad -
Training in progress, step 6500
46cb0a4 -
Training in progress, step 6000
dc12828 -
Training in progress, step 5500
588d581 -
Training in progress, step 5000
2a8e304 -
Training in progress, step 4500
00fc36b -
Training in progress, step 4000
0c4b8d4 -
Training in progress, step 3500
d130708 -
Training in progress, step 3000
aebc922 -
Training in progress, step 2500
a346372 -
Training in progress, step 2000
296b95f -
Training in progress, step 1500
81ea39e -
Training in progress, step 1000
764ba6c -
Training in progress, step 500
89694fc -
Training in progress, step 1500
3c60993 -
Training in progress, step 1000
02521e9 -
Training in progress, step 500
c18f4c7 -
Training in progress, step 6500
8f45c3e -
Training in progress, step 6000
d0959ba -
Training in progress, step 5500
b10cbed -
Training in progress, step 5000
3534d89 -
Training in progress, step 4500
c187dd1 -
Training in progress, step 4000
e819348 -
Training in progress, step 3500
d17636a -
Training in progress, step 3000
e27e643 -
Training in progress, step 2500
8703c54 -
Training in progress, step 2000
1e1494b -
Training in progress, step 1500
8f77873 -
Training in progress, step 1000
ebeae20 -
Training in progress, step 500
3c78a6a -
End of training
34bb3b6 -
Training in progress, step 6500
1da1830 -
Training in progress, step 6000
1d5d552 -
Training in progress, step 5500
295a602 -
Training in progress, step 5000
b55e9a0 -
Training in progress, step 4500
1795931 -
Training in progress, step 4000
108d1b6 -
Training in progress, step 3500
04408d7 -
Training in progress, step 3000
d85ba38 -
Training in progress, step 2500
62fdebb -
Training in progress, step 2000
60d87d6 -
Training in progress, step 1500
3f31515 -
Training in progress, step 1000
6891419 -
Training in progress, step 500
d98f8ed -
End of training
e810dcd -
Training in progress, step 6500
085bee6 -
Training in progress, step 6000
7683c26 -
Training in progress, step 5500
2f5daec -
Training in progress, step 5000
23456c4 -
Training in progress, step 4500
1a5291d