SetFit/mrpc
Viewer • Updated • 5.8k • 535 • 15
How to use boopathiraj/Bar-paraphrase-model with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="boopathiraj/Bar-paraphrase-model") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("boopathiraj/Bar-paraphrase-model", dtype="auto")How to use boopathiraj/Bar-paraphrase-model with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "boopathiraj/Bar-paraphrase-model"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "boopathiraj/Bar-paraphrase-model",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/boopathiraj/Bar-paraphrase-model
How to use boopathiraj/Bar-paraphrase-model with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "boopathiraj/Bar-paraphrase-model" \
--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": "boopathiraj/Bar-paraphrase-model",
"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 "boopathiraj/Bar-paraphrase-model" \
--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": "boopathiraj/Bar-paraphrase-model",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use boopathiraj/Bar-paraphrase-model with Docker Model Runner:
docker model run hf.co/boopathiraj/Bar-paraphrase-model
This model was trained for paraphrasing tasks.
import torch
from transformers import AutoModelForSeq2SeqLM
base_model_name="eugenesiow/bart-paraphrase"
model = AutoModelForSeq2SeqLM.from_pretrained(base_model_name)
state_dict = torch.load('pytorch_model.bin', map_location='cpu')
model.load_state_dict(state_dict)
model.eval()
Base model
facebook/bart-large-cnn