How to use

from transformers import AutoTokenizer
from trl import AutoModelForCausalLMWithValueHead
import torch

tokenizer = AutoTokenizer.from_pretrained("entfane/gpt2_constitutional_classifier_with_value_head")
model = AutoModelForCausalLMWithValueHead.from_pretrained("entfane/gpt2_constitutional_classifier_with_value_head", device_map = "cuda")

messages = [{"role":"system", "content": ""},
              {"role":"user", "content": "How are you doing?"},
              {"role":"assistant", "content": "I am good"}]

input = tokenizer.apply_chat_template(messages, tokenize = True, return_tensors = "pt").to('cuda')
_, _, values = model(**input)
print(torch.sigmoid(values))
Downloads last month
43
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for entfane/gpt2_constitutional_classifier_with_value_head

Finetuned
(2083)
this model

Dataset used to train entfane/gpt2_constitutional_classifier_with_value_head

Space using entfane/gpt2_constitutional_classifier_with_value_head 1

Collection including entfane/gpt2_constitutional_classifier_with_value_head