Yelp/yelp_review_full
Viewer • Updated • 700k • 23k • 144
How to use gabrielloiseau/TAROT-DPO with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="gabrielloiseau/TAROT-DPO") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("gabrielloiseau/TAROT-DPO")
model = AutoModelForCausalLM.from_pretrained("gabrielloiseau/TAROT-DPO")How to use gabrielloiseau/TAROT-DPO with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "gabrielloiseau/TAROT-DPO"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "gabrielloiseau/TAROT-DPO",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/gabrielloiseau/TAROT-DPO
How to use gabrielloiseau/TAROT-DPO with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "gabrielloiseau/TAROT-DPO" \
--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": "gabrielloiseau/TAROT-DPO",
"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 "gabrielloiseau/TAROT-DPO" \
--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": "gabrielloiseau/TAROT-DPO",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use gabrielloiseau/TAROT-DPO with Docker Model Runner:
docker model run hf.co/gabrielloiseau/TAROT-DPO
Task-Oriented Authorship Obfuscation Using Policy Optimization Methods
Fine-tuned text rewriting model with direct preference optimization for authorship obfuscation.
ArXiv paper: https://arxiv.org/abs/2407.21630v1
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("gabrielloiseau/TAROT-DPO")
model = AutoModelForCausalLM.from_pretrained("gabrielloiseau/TAROT-DPO")
paragraph = """I had dinner at Bella's Bistro last night, and it was a delightful experience.
As soon as I walked in, I was greeted warmly by the hostess, and the cozy, rustic decor made me feel right at home.
I started with the bruschetta, which was so fresh and flavorful—I could have eaten a whole meal of just that!"""
inputs = tokenizer([paragraph + "<|endoftext|>"], return_tensors="pt", padding=True)
outputs = model.generate(**inputs, do_sample=True, max_new_tokens=128)
outputs = outputs[:, inputs["input_ids"].shape[1]:]
tokenizer.batch_decode(outputs,skip_special_tokens=True)
Base model
philippelaban/keep_it_simple