Skip to content

Commit

Permalink
[data] Fix minicpmv/o dpo training (#6657)
Browse files Browse the repository at this point in the history
* fix template name

* tiny fix

* support minicpm-o-2.6

* support inference of minicpmv

* update readme

* support dpo of minicpmv
  • Loading branch information
BUAADreamer authored Jan 15, 2025
1 parent 76675b6 commit 0279427
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/llamafactory/data/collator.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def __call__(self, features: Sequence[Dict[str, Any]]) -> Dict[str, "torch.Tenso
if "image_bound" in features: # for minicpmv inputs
bsz, seq_length = features["input_ids"].shape
features["position_ids"] = torch.arange(seq_length).long().repeat(bsz, 1)
return {"data": features, "labels": features["labels"]}
return {"data": features, "input_ids": features["input_ids"], "labels": features["labels"]}

return features

Expand Down

0 comments on commit 0279427

Please sign in to comment.