Views
No views yet
1conda update conda -n base -c defaults
2conda create -n rlhf python=3.8
3conda activate rlhfconda install pytorch==1.13.1 pytorch-cuda=11.7 tensorboard -c pytorch -c nvidia1conda install datasets accelerate safetensors chardet cchardet -c huggingface -c conda-forge
2pip3 install transformers sentencepiece einops triton==1.0.0 rouge jionlp==1.4.14 nltk sacrebleu cpm_kernels
3
4apt install libaio-dev
5DS_BUILD_OPS=1 pip install deepspeed11) Download the weight diff into your local machine. The weight diff is located at:
2# For English:
3TODO
4# For Chinese:
5https://huggingface.co/Ablustrund/moss-rlhf-reward-model-7B-zh/tree/main
6
72) Merge the weight diff with the original Llama-7B:
8# For English:
9# Reward model
10python merge_weight_en.py recover --path_raw decapoda-research/llama-7b-hf --path_diff ./models/moss-rlhf-reward-model-7B-en/diff --path_tuned ./models/moss-rlhf-reward-model-7B-en/recover --model_type reward
11# SFT model
12python merge_weight_en.py recover --path_raw decapoda-research/llama-7b-hf --path_diff ./models/moss-rlhf-sft-model-7B-en/diff --path_tuned ./models/moss-rlhf-sft-model-7B-en/recover --model_type sft
13# Policy model
14TODO
15# For Chinese:
16python merge_weight_zh.py recover --path_raw decapoda-research/llama-7b-hf --path_diff ./models/moss-rlhf-reward-model-7B-zh/diff --path_tuned ./models/moss-rlhf-reward-model-7B-zh/recover# For Chinese:
# You need to use your own sft model currently.
bash run_zh.sh
# For English:
# We have loaded the sft model and reward model to huggingface.
bash run_en.sh1@article{zheng2023secrets,
2 title={Secrets of RLHF in Large Language Models Part I: PPO},
3 author={Rui Zheng and Shihan Dou and Songyang Gao and Wei Shen and Binghai Wang and Yan Liu and Senjie Jin and Qin Liu and Limao Xiong and Lu Chen and Zhiheng Xi and Yuhao Zhou and Nuo Xu and Wenbin Lai and Minghao Zhu and Rongxiang Weng and Wensen Cheng and Cheng Chang and Zhangyue Yin and Yuan Hua and Haoran Huang and Tianxiang Sun and Hang Yan and Tao Gui and Qi Zhang and Xipeng Qiu and Xuanjing Huang},
4 year={2023},
5 eprint={2307.04964},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}