mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-09-15 15:48:08 +08:00
fixing reference model loading and freezing
This commit is contained in:
@@ -148,7 +148,7 @@ def dpo_loss(
|
||||
|
||||
logits = model(inputs)
|
||||
logits = logits.astype(mx.float32)
|
||||
|
||||
|
||||
return -nn.losses.cross_entropy(logits, targets) * mask[:, :-1]
|
||||
|
||||
num_chosen_tokens = chosen_masks.sum(-1)
|
||||
|
Reference in New Issue
Block a user