Text Generation
Transformers
PyTorch
ONNX
Safetensors
gpt2
Generated from Trainer
distilgpt2
email generation
email
text-generation-inference
Instructions to use postbot/distilgpt2-emailgen-V2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use postbot/distilgpt2-emailgen-V2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="postbot/distilgpt2-emailgen-V2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("postbot/distilgpt2-emailgen-V2") model = AutoModelForCausalLM.from_pretrained("postbot/distilgpt2-emailgen-V2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use postbot/distilgpt2-emailgen-V2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "postbot/distilgpt2-emailgen-V2" # 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-V2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/postbot/distilgpt2-emailgen-V2
- SGLang
How to use postbot/distilgpt2-emailgen-V2 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-V2" \ --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-V2", "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-V2" \ --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-V2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use postbot/distilgpt2-emailgen-V2 with Docker Model Runner:
docker model run hf.co/postbot/distilgpt2-emailgen-V2
Update README.md
Browse files
README.md
CHANGED
|
@@ -50,6 +50,8 @@ parameters:
|
|
| 50 |
|
| 51 |
> This is a V2, which should perform better than V1. This is in the process of being evaluated.
|
| 52 |
|
|
|
|
|
|
|
| 53 |
Why write the rest of your email when you can generate it?
|
| 54 |
|
| 55 |
```python
|
|
@@ -75,8 +77,6 @@ result = generator(
|
|
| 75 |
print(result[0]['generated_text'])
|
| 76 |
```
|
| 77 |
|
| 78 |
-
**[colab notebook](https://colab.research.google.com/gist/pszemraj/d1c2d88b6120cca4ca7df078ea1d1e50/scratchpad.ipynb)**
|
| 79 |
-
|
| 80 |
## Model description
|
| 81 |
|
| 82 |
This model is a fine-tuned version of `distilgpt2` on the postbot/multi-emails-100k dataset.
|
|
|
|
| 50 |
|
| 51 |
> This is a V2, which should perform better than V1. This is in the process of being evaluated.
|
| 52 |
|
| 53 |
+
[](https://colab.research.google.com/gist/pszemraj/d1c2d88b6120cca4ca7df078ea1d1e50/scratchpad.ipynb)
|
| 54 |
+
|
| 55 |
Why write the rest of your email when you can generate it?
|
| 56 |
|
| 57 |
```python
|
|
|
|
| 77 |
print(result[0]['generated_text'])
|
| 78 |
```
|
| 79 |
|
|
|
|
|
|
|
| 80 |
## Model description
|
| 81 |
|
| 82 |
This model is a fine-tuned version of `distilgpt2` on the postbot/multi-emails-100k dataset.
|