Update _utils.py
This commit is contained in:
parent
7b95a76f16
commit
cb5c182bda
1 changed files with 2 additions and 1 deletions
|
|
@ -1011,7 +1011,8 @@ def _unsloth_get_batch_samples(self, epoch_iterator, num_batches):
|
|||
if len(batch_samples) > 0 and "labels" in batch_samples[0]:
|
||||
try:
|
||||
num_items_in_batch = sum([(batch["labels"].ne(-100)).sum() for batch in batch_samples])
|
||||
except (TypeError, AttributeError):
|
||||
except Exception as exception:
|
||||
logger.warning_once(exception)
|
||||
pass
|
||||
|
||||
if self.args.average_tokens_across_devices:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue