Skip to content

Commit d8fbfc8

Browse files
committed
Add DPO correctness integration test and respect dpo.max_prompt_length in train_dpo.py
1 parent da7e9f9 commit d8fbfc8

3 files changed

Lines changed: 498 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,4 @@ gha-creds-*.json
155155

156156
# vscode workspace
157157
maxtext.code-workspace
158+
maxtext_output/

src/maxtext/trainers/post_train/dpo/train_dpo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def get_tunix_config(mt_config: MaxTextConfig) -> DPOTrainingConfig:
9090
set_profile_options=set_profile_options,
9191
)
9292

93-
max_prompt_length = mt_config.max_target_length // 2
93+
max_prompt_length = mt_config.dpo.max_prompt_length or (mt_config.max_target_length // 2)
9494
return DPOTrainingConfig(
9595
eval_every_n_steps=mt_config.eval_interval,
9696
max_steps=mt_config.steps,

0 commit comments

Comments
 (0)