Merge pull request #111 from YuzaChongyi/main

fix finetune
This commit is contained in:
YuzaChongyi
2024-05-21 17:34:25 +08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -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 \

View File

@@ -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]