postbot/aeslc_kw
Viewer • Updated • 18.3k • 77 • 2
How to use deva-penumaka/flan-t5-email-subject-generator with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="deva-penumaka/flan-t5-email-subject-generator") # Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("deva-penumaka/flan-t5-email-subject-generator")
model = AutoModelForSeq2SeqLM.from_pretrained("deva-penumaka/flan-t5-email-subject-generator", device_map="auto")How to use deva-penumaka/flan-t5-email-subject-generator with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "deva-penumaka/flan-t5-email-subject-generator"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "deva-penumaka/flan-t5-email-subject-generator",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/deva-penumaka/flan-t5-email-subject-generator
How to use deva-penumaka/flan-t5-email-subject-generator with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "deva-penumaka/flan-t5-email-subject-generator" \
--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": "deva-penumaka/flan-t5-email-subject-generator",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "deva-penumaka/flan-t5-email-subject-generator" \
--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": "deva-penumaka/flan-t5-email-subject-generator",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use deva-penumaka/flan-t5-email-subject-generator with Docker Model Runner:
docker model run hf.co/deva-penumaka/flan-t5-email-subject-generator
This model is a fine-tuned version of google/flan-t5-small.
The model generates a concise email subject line from an email body.
The model was fine-tuned using:
postbot/aeslc_kwclean_emailsubject_lineThe source dataset repository describes itself as a cleaned version of AESLC with extracted keywords.
Inputs should use this prefix:
summarize this email as a subject line:
## Intended use
This model was created for an academic email subject-line generation project.
## Bias, Risks, and Limitations
The model may generate incomplete, inaccurate, or overly general subject lines.
It should not be used as the sole basis for handling sensitive email.
### Recommendations
Users (both direct and downstream) should be aware of the risks, biases and limitations of the model.
Base model
google/flan-t5-small