Downloads · 30 days
7
7% of all-time downloads
Realmbird/rlhf-helpful-only-qwen-0.6b
rlhf-helpful-only-qwen-0.6b is a text generation model from Realmbird. Use it when you need the model to write or continue text. It is set up for transformers.
modelpathorid = "Realmbird/rlhf-helpful-qwen-0.6b-PPO-tuned-generator" model = AutoModelForCausalLM.frompretrained( modelpathorid, devicemap="auto", torchdtype=torch.float16, Assuming you trained with float16 or bfloa…
Downloads · 30 days
7
7% of all-time downloads
All-time downloads
94
Public
Parameters
610M
550 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors539 MB · 97%
How the weights are stored.
U8454M · 74%
From the Hugging Face model README
model_path_or_id = "Realmbird/rlhf-helpful-qwen-0.6b-PPO-tuned-generator" model = AutoModelForCausalLM.from_pretrained( model_path_or_id, device_map="auto", torch_dtype=torch.float16, # Assuming you trained with float16 or bfloat16 trust_remote_code=True # Qwen models often require this ) generator = pipeline( "text-generation", model=model, tokenizer=tokenizer, # device=0 if torch.cuda.is_available() else -1, # 0 for GPU, -1 for CPU torch_dtype=torch.float16 # Match the model's dtype )
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
import torch
model_id = "Realmbird/rlhf-helpful-qwen-0.6b-PPO-tuned-generator"
tokenizer = AutoTokenizer.from_pretrained(model_id)
if tokenizer.pad_token is None:
tokenizer.add_special_tokens({'pad_token': tokenizer.eos_token})
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype=torch.float16, # or torch.bfloat16 if your GPU supports it and you trained with it
trust_remote_code=True
)
if model.config.pad_token_id is None:
model.config.pad_token_id = tokenizer.pad_token_id
generator = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.float16 # Match the model's dtype
)
prompt = "Human: Tell me about the benefits of a healthy diet.\n\nAssistant:"
generation_params = {
"max_new_tokens": 200,
"do_sample": True,
"temperature": 0.7,
"top_p": 0.9,
"top_k": 50,
"repetition_penalty": 1.1,
"num_return_sequences": 1,
"eos_token_id": tokenizer.eos_token_id,
"pad_token_id": tokenizer.pad_token_id
}
generated_output = generator(prompt, **generation_params)
full_text = generated_output[0]['generated_text']
# Extract only the assistant's response
response_start_index = full_text.find("Assistant:")
if response_start_index != -1:
assistant_response = full_text[response_start_index + len("Assistant:"):].strip()
else:
assistant_response = full_text # Fallback
print(assistant_response)
[More Information Needed]
The model was fine-tuned on the "helpful-base" subset of the Anthropic/hh-rlhf dataset. This dataset contains human preference data (chosen/rejected pairs) used to train a reward model, which then guided the PPO training of this generative model.
A custom reward model, Realmbird/helpfulness-preference-model-qwen-0.6B-v2, was used to provide the reward signal during PPO training. This reward model was itself trained on human preference data to predict helpfulness scores.
Used the reward model Realmbird/helpfulness-preference-model-qwen-0.6B-merged and with PPO with TRL
[More Information Needed]
learning_rate: 1.41e-5num_train_epochs: 1batch_size: 4mini_batch_size: 1gradient_accumulation_steps: 32report_to: "none"output_dir: ./rlhf_helpful_Qwen3_0.6Btask_type: CAUSAL_LMr: 8lora_alpha: 32lora_dropout: 0.1task_type: SEQ_CLSr: 8lora_alpha: 32lora_dropout: 0.1[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]