mirror of
https://github.com/OpenBMB/MiniCPM-V.git
synced 2026-02-04 17:59:18 +08:00
@@ -30,6 +30,7 @@ torchrun $DISTRIBUTED_ARGS finetune.py \
|
||||
--bf16_full_eval true \
|
||||
--do_train \
|
||||
--do_eval \
|
||||
--model_max_length 2048 \
|
||||
--max_steps 80000 \
|
||||
--eval_steps 200 \
|
||||
--output_dir output/output_minicpmv2 \
|
||||
|
||||
@@ -35,8 +35,7 @@ class CPMTrainer(Trainer):
|
||||
if isinstance(outputs, dict) and "loss" not in outputs:
|
||||
raise ValueError(
|
||||
"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 {
|
||||
','.join(inputs.keys())}."
|
||||
f"{','.join(outputs.keys())}. For reference, the inputs it received are {','.join(inputs.keys())}."
|
||||
)
|
||||
# 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]
|
||||
|
||||
Reference in New Issue
Block a user