Skip to content

Commit

Permalink
update requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
mst272 committed Aug 29, 2024
1 parent ac7fe10 commit 8fe1d3d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
32 changes: 15 additions & 17 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
accelerate==0.29.3
transformers==4.39.3
peft==0.10.0
bitsandbytes==0.43.1
loguru==0.7.2
numpy==1.26.4
pandas==2.2.1
tqdm==4.66.4
deepspeed==0.14.2
sentencepiece==0.2.0
transformers-stream-generator==0.0.5
tiktoken==0.6.0
einops==0.8.0
httpx
scipy
torch==2.2.2
datasets==2.16.1
accelerate
transformers==4.44.2
peft
bitsandbytes
loguru
numpy
pandas
tqdm
deepspeed==0.13.1
sentencepiece
transformers-stream-generator
tiktoken
einops
torch==2.3.0
datasets
trl
wandb
14 changes: 7 additions & 7 deletions rlhf/rlhf_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ def main():
llm_int8_has_fp16_weight=False,
)
model_kwargs.update(quantization_config=quantization_config)

# 如果模型不支持AutoModelForSequenceClassification需要在对应config文件中添加映射
try:
reward_model = AutoModelForSequenceClassification.from_pretrained(config.reward_model_path, num_labels=1,
**model_kwargs)
except Exception as e:
assert False, "模型不支持AutoModelForSequenceClassification需要在对应config文件中添加映射"
if args.rlhf_type in ['PPO', 'RLOO']:
# 如果模型不支持AutoModelForSequenceClassification需要在对应config文件中添加映射
try:
reward_model = AutoModelForSequenceClassification.from_pretrained(config.reward_model_path, num_labels=1,
**model_kwargs)
except Exception as e:
assert False, "模型不支持AutoModelForSequenceClassification需要在对应config文件中添加映射"

ref_policy = AutoModelForCausalLM.from_pretrained(config.sft_model_path, **model_kwargs)
policy = AutoModelForCausalLM.from_pretrained(config.sft_model_path, **model_kwargs)
Expand Down

0 comments on commit 8fe1d3d

Please sign in to comment.