HumanLLMs/Human-Like-DPO-Dataset
Viewer • Updated • 10.9k • 899 • 255
How to use entfane/BERT_human_like_RM with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="entfane/BERT_human_like_RM") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("entfane/BERT_human_like_RM")
model = AutoModelForSequenceClassification.from_pretrained("entfane/BERT_human_like_RM")# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("entfane/BERT_human_like_RM")
model = AutoModelForSequenceClassification.from_pretrained("entfane/BERT_human_like_RM")This is a reward model based on Bert Uncased.
!pip install transformers accelerate
model_name = "entfane/BERT_human_like_RM"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
messages = ["How are you doing? Great",
"How are you doing? Greetings! I am doing just fine, may I ask you, how are you doing?"
]
input = tokenizer(messages, return_tensors="pt", padding="max_length").to(model.device)
output = model(**input)
print(output)
Base model
google-bert/bert-base-uncased
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="entfane/BERT_human_like_RM")