Update _utils.py
This commit is contained in:
parent
0d84dcab22
commit
98e89b7a3d
1 changed files with 1 additions and 2 deletions
|
|
@ -1023,8 +1023,7 @@ def _unsloth_get_batch_samples(self, epoch_iterator, num_batches):
|
|||
num_items_in_batch = sum(
|
||||
[(x["labels"][..., 1:] != -100).sum() for x in batch_samples]
|
||||
)
|
||||
# num_items_in_batch = sum([(batch["labels"].ne(-100)).sum() for batch in batch_samples])
|
||||
|
||||
|
||||
if self.args.average_tokens_across_devices:
|
||||
num_items_in_batch = self.accelerator.gather(num_items_in_batch).sum().item()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue