mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-04 12:42:51 +08:00
tiny fix
Former-commit-id: 05d9fc7eff8f4f056c48b66bf89f1834ade27968
This commit is contained in:
parent
574a7d175c
commit
983779c474
@ -33,7 +33,7 @@ class CustomSeq2SeqTrainer(Seq2SeqTrainer):
|
|||||||
|
|
||||||
Subclass and override to inject custom behavior.
|
Subclass and override to inject custom behavior.
|
||||||
"""
|
"""
|
||||||
labels = inputs["labels"].clone() if "labels" in inputs else None # backup labels
|
labels = inputs["labels"].detach().clone() if "labels" in inputs else None # backup labels
|
||||||
if self.args.predict_with_generate:
|
if self.args.predict_with_generate:
|
||||||
assert self.tokenizer.padding_side == "left", "This method only accepts left-padded tensor."
|
assert self.tokenizer.padding_side == "left", "This method only accepts left-padded tensor."
|
||||||
prompt_len, label_len = inputs["input_ids"].size(-1), inputs["labels"].size(-1)
|
prompt_len, label_len = inputs["input_ids"].size(-1), inputs["labels"].size(-1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user