Text Generation
Transformers
TensorBoard
Safetensors
gpt2
Generated from Trainer
text-generation-inference
Instructions to use armaanp/gpt2-wikitext2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use armaanp/gpt2-wikitext2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="armaanp/gpt2-wikitext2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("armaanp/gpt2-wikitext2") model = AutoModelForCausalLM.from_pretrained("armaanp/gpt2-wikitext2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use armaanp/gpt2-wikitext2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "armaanp/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": "armaanp/gpt2-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/armaanp/gpt2-wikitext2
- SGLang
How to use armaanp/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 "armaanp/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": "armaanp/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 "armaanp/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": "armaanp/gpt2-wikitext2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use armaanp/gpt2-wikitext2 with Docker Model Runner:
docker model run hf.co/armaanp/gpt2-wikitext2
Commit History
-
Training in progress, step 500
Verified signature87295eb -
Training in progress, step 500
Verified signaturef7bef60 -
Training in progress, step 500
Verified signaturebe7115f -
Training in progress, step 500
Verified signature07b6e24 -
Training in progress, step 500
Verified signature459356a -
Training in progress, step 500
Verified signature0a7a119 -
Training in progress, step 500
Verified signatureac51d4c -
Training in progress, step 500
Verified signature888ab7e -
Training in progress, step 500
Verified signature38869ab -
Training in progress, step 500
Verified signaturee1eaf5a
-
Training in progress, step 500
Verified signature8296ff9 -
Training in progress, step 500
Verified signatured614e6b -
Training in progress, step 500
Verified signature591a6fa -
Training in progress, step 500
Verified signature4a158b3 -
Training in progress, step 500
Verified signature5b950bf -
Training in progress, step 500
Verified signature0159caa -
Training in progress, step 500
Verified signaturef59304e -
Training in progress, step 500
Verified signature87da7aa -
Training in progress, step 500
Verified signaturec4f7af7 -
Training in progress, step 500
Verified signature9851a89 -
Training in progress, step 500
Verified signaturea0993df -
Training in progress, step 500
Verified signature3286e22 -
Training in progress, step 500
Verified signaturee4a8efb -
Training in progress, step 500
Verified signature53d55a5 -
Training in progress, step 500
Verified signatureafcea31 -
Training in progress, step 500
Verified signature3f45fc4 -
Training in progress, step 500
Verified signatured8751dc
-
Training in progress, step 500
Verified signature0d023ad -
Training in progress, step 500
Verified signature0d6ee58