Text Generation
Transformers
PyTorch
Safetensors
gpt2
Generated from Trainer
distilgpt2
email generation
email
text-generation-inference
Instructions to use postbot/distilgpt2-emailgen with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use postbot/distilgpt2-emailgen with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="postbot/distilgpt2-emailgen")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("postbot/distilgpt2-emailgen") model = AutoModelForCausalLM.from_pretrained("postbot/distilgpt2-emailgen", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use postbot/distilgpt2-emailgen with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "postbot/distilgpt2-emailgen" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "postbot/distilgpt2-emailgen", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/postbot/distilgpt2-emailgen
- SGLang
How to use postbot/distilgpt2-emailgen 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 "postbot/distilgpt2-emailgen" \ --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": "postbot/distilgpt2-emailgen", "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 "postbot/distilgpt2-emailgen" \ --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": "postbot/distilgpt2-emailgen", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use postbot/distilgpt2-emailgen with Docker Model Runner:
docker model run hf.co/postbot/distilgpt2-emailgen
Commit History
-
Adding Evaluation Results (#3)
- Adding Evaluation Results (655f4fb9e103f8b5170817cc7c0eb64419d9490e) Co-authored-by: Open LLM Leaderboard PR Bot <leaderboard-pr-bot@users.noreply.huggingface.co>15da1bb
-
Librarian Bot: Add base_model information to model (#2)
- Librarian Bot: Add base_model information to model (ff889735561488aa9e24f6931c83cb8f11b64ae1) Co-authored-by: Librarian Bot (Bot) <librarian-bot@users.noreply.huggingface.co>fe96d63
-
Adding `safetensors` variant of this model (#1)
- Adding `safetensors` variant of this model (02ae38c899e63b0e56d77b95351429d0382c5f96) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>866b33d
-
param update
d8e8e53 -
add many more examples
37b5b7d
-
add example
bbbdf0d -
Update README.md
6c7d736 -
Update README.md
7db33b4 -
update example code
1d62389 -
Update README.md
8b86372 -
Update README.md
23e2847 -
Update README.md
12e61e0 -
Upload distilgpt2-emailgen_DS-multi_Ep-5_Bs-8_training_metadata.json
b9bf68c
-
Update README.md
3c6049e -
Update README.md
3bf1e72 -
Update README.md
4b65d21 -
Update README.md
0932d5b -
Update README.md
e7c399e -
Update README.md
8ff0b1c -
Update README.md
f7449c7 -
add fp32 model
7e3d761 -
add base model
57c84de -
adding model files
7a56f4d -
add tokenizer
e247069 -
initial commit
78181bd