mirror of
https://github.com/OpenBMB/MiniCPM-V.git
synced 2026-02-05 18:29:18 +08:00
@@ -30,6 +30,7 @@ torchrun $DISTRIBUTED_ARGS finetune.py \
|
|||||||
--bf16_full_eval true \
|
--bf16_full_eval true \
|
||||||
--do_train \
|
--do_train \
|
||||||
--do_eval \
|
--do_eval \
|
||||||
|
--model_max_length 2048 \
|
||||||
--max_steps 80000 \
|
--max_steps 80000 \
|
||||||
--eval_steps 200 \
|
--eval_steps 200 \
|
||||||
--output_dir output/output_minicpmv2 \
|
--output_dir output/output_minicpmv2 \
|
||||||
|
|||||||
@@ -35,8 +35,7 @@ class CPMTrainer(Trainer):
|
|||||||
if isinstance(outputs, dict) and "loss" not in outputs:
|
if isinstance(outputs, dict) and "loss" not in outputs:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"The model did not return a loss from the inputs, only the following keys: "
|
"The model did not return a loss from the inputs, only the following keys: "
|
||||||
f"{','.join(outputs.keys())}. For reference, the inputs it received are {
|
f"{','.join(outputs.keys())}. For reference, the inputs it received are {','.join(inputs.keys())}."
|
||||||
','.join(inputs.keys())}."
|
|
||||||
)
|
)
|
||||||
# We don't use .loss here since the model may return tuples instead of ModelOutput.
|
# We don't use .loss here since the model may return tuples instead of ModelOutput.
|
||||||
loss = outputs["loss"] if isinstance(outputs, dict) else outputs[0]
|
loss = outputs["loss"] if isinstance(outputs, dict) else outputs[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user