fix finetune

This commit is contained in:
cjm
2024-05-21 17:30:33 +08:00
parent be653f2ae4
commit 76f8f4c376
2 changed files with 2 additions and 2 deletions

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]