Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix src/llamafactory/train/callbacks.py #4746

Merged
merged 2 commits into from
Jul 10, 2024
Merged

fix src/llamafactory/train/callbacks.py #4746

merged 2 commits into from
Jul 10, 2024

Conversation

yzoaim
Copy link
Contributor

@yzoaim yzoaim commented Jul 10, 2024

What does this PR do?

Fixes # (issue)

Before submitting

在 examples/train_lora/llama3_lora_reward.yaml 中添加了一行配置使用deepspeed, 训练完成后保存模型不成功,报错TypeError:str.replace()takes no keyword arguments。配置如下

### model
model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct

### method
stage: rm
do_train: true
finetuning_type: lora
lora_target: all
deepspeed: examples/deepspeed/ds_z3_config.json

### dataset
dataset: dpo_en_demo
template: llama3
cutoff_len: 1024
max_samples: 50
overwrite_cache: true

### output
output_dir: saves/llama3-8b/lora/rewardfix
logging_steps: 10
save_steps: 500
plot_loss: true
overwrite_output_dir: true

### train
per_device_train_batch_size: 1
gradient_accumulation_steps: 8
learning_rate: 1.0e-4
num_train_epochs: 1.0
lr_scheduler_type: cosine
warmup_ratio: 0.1
bf16: true
ddp_timeout: 180000000

### eval
val_size: 0.1
per_device_eval_batch_size: 1
eval_strategy: steps
eval_steps: 500

定位到src/llamafactory/train/callbacks.py的方法fix_valuehead_checkpoint中,修改后可以正确保存模型
image

@hiyouga hiyouga self-requested a review July 10, 2024 05:31
@hiyouga hiyouga added the solved This problem has been already solved label Jul 10, 2024
@hiyouga hiyouga merged commit 40c3b88 into hiyouga:main Jul 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants