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
Update README.md
Browse files
README.md
CHANGED
|
@@ -16,11 +16,11 @@ widget:
|
|
| 16 |
example_title: "office hours"
|
| 17 |
- text: "Greetings <NAME>,\n\nI hope you had a splendid evening at the Company sausage eating festival. I am reaching out because"
|
| 18 |
example_title: "festival"
|
| 19 |
-
- text: "Good Morning
|
| 20 |
example_title: "event"
|
| 21 |
- text: "URGENT - I need the TPS reports"
|
| 22 |
example_title: "URGENT"
|
| 23 |
-
- text: "Hi
|
| 24 |
example_title: "emails that find you"
|
| 25 |
|
| 26 |
parameters:
|
|
|
|
| 16 |
example_title: "office hours"
|
| 17 |
- text: "Greetings <NAME>,\n\nI hope you had a splendid evening at the Company sausage eating festival. I am reaching out because"
|
| 18 |
example_title: "festival"
|
| 19 |
+
- text: "Good Morning Harold,\n\nI was wondering when the next"
|
| 20 |
example_title: "event"
|
| 21 |
- text: "URGENT - I need the TPS reports"
|
| 22 |
example_title: "URGENT"
|
| 23 |
+
- text: "Hi Archibald,\n\nI hope this email finds you extremely well."
|
| 24 |
example_title: "emails that find you"
|
| 25 |
|
| 26 |
parameters:
|