Text Generation
Transformers
PyTorch
ONNX
Safetensors
gpt2
text generation
emailgen
email generation
email
text-generation-inference
Instructions to use postbot/gpt2-medium-emailgen with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use postbot/gpt2-medium-emailgen with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="postbot/gpt2-medium-emailgen")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("postbot/gpt2-medium-emailgen") model = AutoModelForCausalLM.from_pretrained("postbot/gpt2-medium-emailgen", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use postbot/gpt2-medium-emailgen with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "postbot/gpt2-medium-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/gpt2-medium-emailgen", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/postbot/gpt2-medium-emailgen
- SGLang
How to use postbot/gpt2-medium-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/gpt2-medium-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/gpt2-medium-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/gpt2-medium-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/gpt2-medium-emailgen", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use postbot/gpt2-medium-emailgen with Docker Model Runner:
docker model run hf.co/postbot/gpt2-medium-emailgen
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,16 +1,50 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
tags:
|
|
|
|
| 4 |
- generated_from_trainer
|
| 5 |
-
|
| 6 |
-
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 11 |
-
should probably proofread and complete it, then remove this comment. -->
|
| 12 |
|
| 13 |
-
# gpt2-medium-
|
| 14 |
|
| 15 |
This model is a fine-tuned version of [gpt2-medium](https://huggingface.co/gpt2-medium) on the None dataset.
|
| 16 |
It achieves the following results on the evaluation set:
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
tags:
|
| 4 |
+
- text generation
|
| 5 |
- generated_from_trainer
|
| 6 |
+
- email generation
|
| 7 |
+
- email
|
| 8 |
+
datasets:
|
| 9 |
+
- aeslc
|
| 10 |
+
- postbot/multi-emails-100k
|
| 11 |
+
|
| 12 |
+
widget:
|
| 13 |
+
- text: "Good Morning Professor Beans,
|
| 14 |
+
|
| 15 |
+
Hope you are doing well. I just wanted to reach out and ask if differential calculus will be on the exam"
|
| 16 |
+
example_title: "email to prof"
|
| 17 |
+
- text: "Hey <NAME>,\n\nThank you for signing up for my weekly newsletter. Before we get started, you'll have to confirm your email address."
|
| 18 |
+
example_title: "newsletter"
|
| 19 |
+
- text: "Hi <NAME>,\n\nI hope this email finds you well. I wanted to reach out and ask about office hours"
|
| 20 |
+
example_title: "office hours"
|
| 21 |
+
- text: "Greetings <NAME>,\n\nI hope you had a splendid evening at the Company sausage eating festival. I am reaching out because"
|
| 22 |
+
example_title: "festival"
|
| 23 |
+
- text: "Good Morning Harold,\n\nI was wondering when the next"
|
| 24 |
+
example_title: "event"
|
| 25 |
+
- text: "URGENT - I need the TPS reports"
|
| 26 |
+
example_title: "URGENT"
|
| 27 |
+
- text: "Hi Archibald,\n\nI hope this email finds you extremely well."
|
| 28 |
+
example_title: "emails that find you"
|
| 29 |
+
- text: "Hello there.\n\nI just wanted to reach out and check in to"
|
| 30 |
+
example_title: "checking in"
|
| 31 |
+
- text: "Hello <NAME>,\n\nI hope this email finds you well. I wanted to reach out and see if you've enjoyed your time with us"
|
| 32 |
+
example_title: "work well"
|
| 33 |
+
- text: "Hi <NAME>,\n\nI hope this email finds you well. I wanted to reach out and see if we could catch up"
|
| 34 |
+
example_title: "catch up"
|
| 35 |
+
- text: "I'm <NAME> and I just moved into the area and wanted to reach out and get some details on where I could get groceries and"
|
| 36 |
+
example_title: "grocery"
|
| 37 |
+
parameters:
|
| 38 |
+
min_length: 4
|
| 39 |
+
max_length: 128
|
| 40 |
+
length_penalty: 0.8
|
| 41 |
+
no_repeat_ngram_size: 2
|
| 42 |
+
do_sample: True
|
| 43 |
+
repetition_penalty: 2.5
|
| 44 |
---
|
| 45 |
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
# gpt2-medium-emailgen
|
| 48 |
|
| 49 |
This model is a fine-tuned version of [gpt2-medium](https://huggingface.co/gpt2-medium) on the None dataset.
|
| 50 |
It achieves the following results on the evaluation set:
|