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

dpo metrics error #6050

Closed
1 task done
yhhit opened this issue Nov 16, 2024 · 1 comment · Fixed by #6052
Closed
1 task done

dpo metrics error #6050

yhhit opened this issue Nov 16, 2024 · 1 comment · Fixed by #6052
Labels
solved This problem has been already solved

Comments

@yhhit
Copy link

yhhit commented Nov 16, 2024

Reminder

  • I have read the README and searched the existing issues.

System Info

  • llamafactory version: 0.9.1.dev0
  • Platform: macOS-15.1-arm64-arm-64bit
  • Python version: 3.12.7
  • PyTorch version: 2.5.1
  • Transformers version: 4.46.1
  • Datasets version: 2.21.0
  • Accelerate version: 1.0.1
  • PEFT version: 0.12.0
  • TRL version: 0.9.6
  • Bitsandbytes version: 0.42.0

Reproduction

this problem in "LLaMA-Factory/src/llamafactory/train/dpo/trainer.py"
def get_batch_loss_metrics

# in def get_batch_loss_metrics
        metrics[f"{prefix}logps/rejected"] = policy_chosen_logps.mean().item()
        metrics[f"{prefix}logps/chosen"] = policy_rejected_logps.mean().item()
        metrics[f"{prefix}logits/rejected"] = policy_chosen_logits.mean().item()
        metrics[f"{prefix}logits/chosen"] = policy_rejected_logits.mean().item()

it should be

        metrics[f"{prefix}logps/rejected"] = policy_rejected_logps.mean().item()
        metrics[f"{prefix}logps/chosen"] = policy_chosen_logps.mean().item()
        metrics[f"{prefix}logits/rejected"] = policy_rejected_logits.mean().item()
        metrics[f"{prefix}logits/chosen"] = policy_chosen_logits.mean().item()

Expected behavior

No response

Others

No response

@github-actions github-actions bot added the pending This problem is yet to be addressed label Nov 16, 2024
hiyouga added a commit that referenced this issue Nov 16, 2024
@hiyouga hiyouga mentioned this issue Nov 16, 2024
2 tasks
@hiyouga
Copy link
Owner

hiyouga commented Nov 16, 2024

thanks for your reporting

@hiyouga hiyouga added solved This problem has been already solved and removed pending This problem is yet to be addressed labels Nov 16, 2024
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 a pull request may close this issue.

2 participants