Downloads · 30 days
10
19% of all-time downloads
reciprocate/rm_beluga-7b_hh-full
rm_beluga-7b_hh-full is a text classification model from reciprocate. Use it when you need a label for a piece of text. It is set up for transformers.
Downloads · 30 days
10
19% of all-time downloads
All-time downloads
52
Public
Repo size
26.4 GB
Likes
0
Public
Click a slice to open those files.
.bin13.2 GB · 100%
From the Hugging Face model README
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
model_path = "reciprocate/rm-beluga-7b-hh-full"
model = AutoModelForSequenceClassification.from_pretrained(model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path)
# for SequenceClassification models padding side should be "right"
tokenizer.padding_side = "right"
tokenizer.truncation_side = "left"
reward_fn = pipeline("text-classification", model=model, tokenizer=tokenizer, truncation=True, batch_size=32, max_length=2048, device=0)
output = reward_fn(["### User: Complete this sentence: I'm 99 percent sure it was someone being an...\n\n### Assistant:\n I'm 99 percent sure it was someone being an idiot.</s>"])
scores = [x["score"] for x in output]
scores
>>> [0.02713249810039997]
# optionally normalize with mean, std computed on training data
scores = (np.array(scores) - 0.6816716283619826) / 0.3198637874065531