Downloads · 30 days
11
13% of all-time downloads
JERRYPAN617/HH-BTRewardModel-roberta
HH-BTRewardModel-roberta is a reinforcement learning model from JERRYPAN617. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Bradley-Terry reward model trained on Anthropic/hh-rlhf dataset, using log-sigmoid loss:
Downloads · 30 days
11
13% of all-time downloads
All-time downloads
84
Public
Parameters
125M
499 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors499 MB · 99%
From the Hugging Face model README
Bradley-Terry reward model trained on Anthropic/hh-rlhf dataset, using log-sigmoid loss:
$$ \mathcal{L} = -\log \sigma(r_{\text{chosen}} - r_{\text{rejected}}) = \log(1 + \exp(-(r_{\text{chosen}} - r_{\text{rejected}}))) $$
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("JERRYPAN617/HH-BTRewardModel-roberta")
model = AutoModelForSequenceClassification.from_pretrained("JERRYPAN617/HH-BTRewardModel-roberta")
text = "Your text here"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
with torch.no_grad():
reward = model(**inputs).logits.item()