Reformulating Unsupervised Style Transfer as Paraphrase Generation
Paper • 2010.05700 • Published
How to use filco306/gpt2-base-style-paraphraser with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="filco306/gpt2-base-style-paraphraser") # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("filco306/gpt2-base-style-paraphraser", dtype="auto")How to use filco306/gpt2-base-style-paraphraser with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "filco306/gpt2-base-style-paraphraser"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "filco306/gpt2-base-style-paraphraser",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/filco306/gpt2-base-style-paraphraser
How to use filco306/gpt2-base-style-paraphraser with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "filco306/gpt2-base-style-paraphraser" \
--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": "filco306/gpt2-base-style-paraphraser",
"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 "filco306/gpt2-base-style-paraphraser" \
--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": "filco306/gpt2-base-style-paraphraser",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use filco306/gpt2-base-style-paraphraser with Docker Model Runner:
docker model run hf.co/filco306/gpt2-base-style-paraphraser
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
This is the trained base-model from the paper Reformulating Unsupervised Style Transfer as Paraphrase Generation by Krishna K. et al. Note that I (the uploader) am not the author of the paper. Permission to upload to Huggingface was given by the main author.
If you found this model useful, please cite the original work:
@inproceedings{style20,
author={Kalpesh Krishna and John Wieting and Mohit Iyyer},
Booktitle = {Empirical Methods in Natural Language Processing},
Year = "2020",
Title={Reformulating Unsupervised Style Transfer as Paraphrase Generation},
}