Views
No views yet
1reward_model = AutoModelForSequenceClassification.from_pretrained(
2 reward_model_path,
3 num_labels=1,
4 torch_dtype=torch.bfloat16,
5 attn_implementation="flash_attention_2",
6 use_cache=False,
7 )
8inputs = xxxx (Left Padding Input Tokens)
9reward = reward_model.model(*inputs).last_hidden_state
10reward = reward_model.score(reward)[:, -1]1@article{hu2024openrlhf,
2 title={OpenRLHF: An Easy-to-use, Scalable and High-performance RLHF Framework},
3 author={Jian Hu and Xibin Wu and Zilin Zhu and Xianyu and Weixun Wang and Dehao Zhang and Yu Cao},
4 journal={arXiv preprint arXiv:2405.11143},
5 year={2024}
6}