Downloads · 30 days
83
7% of all-time downloads
keyfan/bloomz-rlhf
bloomz-rlhf is a text generation model from keyfan. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as bigscience-bloom-rail-1.0.
This is an attempt to replicate the RLHF pipeline
Downloads · 30 days
83
7% of all-time downloads
All-time downloads
1.2K
Public
Repo size
96.9 GB
Likes
10
Public
Click a slice to open those files.
.bin16.3 GB · 100%
From the Hugging Face model README
This is an attempt to replicate the RLHF pipeline
We used bloomz-7b1-mt because of its less-restricted license and multilingual ability.
For SFT we used a combination of multiple datasets including:
For RM we used the code of reward-modeling repo and datasets from
For RL we used the code of trlx with slight modification.
Instead of building value network upon the policy network with a single linear layer, we add another hydra head upon the reference network's frozen bottom layers as value network.
We used Vicuna v1.1 template for model training
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "keyfan/bloomz-rlhf"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint).cuda()
template = ("A chat between a curious human and an artificial intelligence assistant. "
"The assistant gives helpful, detailed, and polite answers to the human's questions. "
"USER: {}\nASSISTANT:")
question = template.format("Who was the president of the United States in 1955?")
inputs = tokenizer.encode(question, return_tensors="pt").cuda()
outputs = model.generate(inputs, do_sample=True, top_p=0.8, max_new_tokens=512)
print(tokenizer.decode(outputs[0]))
Result on the Chinese BELLE eval set
| others | rewrite | classification | generation | summarization | extract | open qa | brainstorming | closed qa | macro ave | macro ave w/o others |
|---|---|---|---|---|---|---|---|---|---|---|
| 0.619 | 0.873 | 0.706 | 0.934 | 0.755 | 0.619 | 0.527 | 0.908 | 0.615 | 0.728 | 0.742 |