Text Generation
Transformers
PyTorch
TensorBoard
gpt2
Generated from Trainer
text-generation-inference
Instructions to use Pranavagrl/gpt2-wikitext2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Pranavagrl/gpt2-wikitext2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Pranavagrl/gpt2-wikitext2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Pranavagrl/gpt2-wikitext2") model = AutoModelForCausalLM.from_pretrained("Pranavagrl/gpt2-wikitext2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Pranavagrl/gpt2-wikitext2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Pranavagrl/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": "Pranavagrl/gpt2-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Pranavagrl/gpt2-wikitext2
- SGLang
How to use Pranavagrl/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 "Pranavagrl/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": "Pranavagrl/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 "Pranavagrl/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": "Pranavagrl/gpt2-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Pranavagrl/gpt2-wikitext2 with Docker Model Runner:
docker model run hf.co/Pranavagrl/gpt2-wikitext2
Commit History
-
Upload 5 files
73b9d05
-
update model card README.md
4711c19 -
Model save
1155fa2 -
Training in progress, step 3000
dcb87a8 -
Training in progress, step 2500
8f14439 -
Training in progress, step 2000
63f4b6d -
Training in progress, step 1500
785cc86 -
Training in progress, step 1000
d669a0d -
Training in progress, step 500
8ef897f -
update model card README.md
0d35986 -
Model save
178869a -
Training in progress, step 3000
1fa13f7 -
Training in progress, step 2500
782ad21 -
Training in progress, step 2000
65712ab -
Training in progress, step 1500
9a3c381 -
Training in progress, step 1000
5760cff -
Training in progress, step 500
0c059d3 -
Training in progress, step 3000
dde3a65 -
Training in progress, step 2500
af3322b -
Training in progress, step 2000
f8d4f03 -
Training in progress, step 1500
f659f91 -
Training in progress, step 1000
34170c4 -
Training in progress, step 500
657aab2
-
Training in progress, step 2000
998ca6c -
Training in progress, step 1500
f6dc51c -
Training in progress, step 1000
3b7cd3c -
Training in progress, step 500
a2d14c2 -
initial commit
95ac950