Text Generation
Transformers
PyTorch
TensorBoard
gpt2
Generated from Trainer
text-generation-inference
Instructions to use PDG/gpt2_ft_police_articles with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PDG/gpt2_ft_police_articles with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PDG/gpt2_ft_police_articles")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PDG/gpt2_ft_police_articles") model = AutoModelForCausalLM.from_pretrained("PDG/gpt2_ft_police_articles", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PDG/gpt2_ft_police_articles with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PDG/gpt2_ft_police_articles" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PDG/gpt2_ft_police_articles", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PDG/gpt2_ft_police_articles
- SGLang
How to use PDG/gpt2_ft_police_articles 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 "PDG/gpt2_ft_police_articles" \ --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": "PDG/gpt2_ft_police_articles", "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 "PDG/gpt2_ft_police_articles" \ --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": "PDG/gpt2_ft_police_articles", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PDG/gpt2_ft_police_articles with Docker Model Runner:
docker model run hf.co/PDG/gpt2_ft_police_articles
Commit History
-
Upload model
53b3a24 -
update model card README.md
9e2f8bf -
Model save
139fa2d -
Training in progress, epoch 1
fb3ded1 -
Training in progress, epoch 1
6c7fc34
-
Training in progress, epoch 1
aba2e73
-
Training in progress, epoch 3
3086bef -
Training in progress, epoch 2
d98d9eb -
Training in progress, epoch 1
5d8828e
-
Training in progress, epoch 5
f0ccd0f -
Training in progress, epoch 4
1bd1d36 -
Training in progress, epoch 3
2c6c4e0 -
Training in progress, epoch 2
8b09ec2 -
Training in progress, epoch 1
4fcfd2a -
Training in progress, epoch 4
a23f6ea -
Training in progress, epoch 3
24e3001 -
Training in progress, epoch 2
f7be6d7 -
Training in progress, epoch 1
0dd8cfc -
Upload tokenizer
2a2f1d5 -
Upload model
0aa5271 -
update model card README.md
3724a6d -
Model save
583818c -
Training in progress, epoch 10
b5cae72 -
Training in progress, epoch 9
9fa80b7 -
Training in progress, epoch 8
8e8f3d7 -
Training in progress, epoch 7
c7afc6e -
Training in progress, epoch 6
bec3c03 -
Training in progress, epoch 5
e727bf9 -
Training in progress, epoch 4
0b2e36d -
Training in progress, epoch 3
7cb9354 -
Training in progress, epoch 2
2f739ea -
Training in progress, epoch 1
6540c12 -
Upload tokenizer
e985e34 -
Upload model
c04e317 -
update model card README.md
0d4fde8 -
Model save
4828ece -
Training in progress, epoch 10
e91decd -
Training in progress, epoch 9
6d247e2 -
Training in progress, epoch 8
c9b1bf2 -
Training in progress, epoch 7
99e40b3 -
Training in progress, epoch 6
59b9a7b -
Training in progress, epoch 5
a3d8e04 -
Training in progress, epoch 4
7e9e77d -
Training in progress, epoch 3
e554619 -
Training in progress, epoch 2
ede6824 -
Training in progress, epoch 1
69a3999 -
initial commit
f57a685