Skip to content

Commit c6ae19e

Browse files
SunMarcCyrilvallez
authored andcommitted
Fix trainer for py3.9 (#41359)
fix
1 parent e0c6038 commit c6ae19e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5590,7 +5590,7 @@ def _fsdp_qlora_plugin_updates(self):
55905590
self.model.hf_quantizer.quantization_config.bnb_4bit_quant_storage, override=True
55915591
)
55925592

5593-
def _get_num_items_in_batch(self, batch_samples: list, device: torch.device) -> int | None:
5593+
def _get_num_items_in_batch(self, batch_samples: list, device: torch.device) -> Optional[Union[torch.Tensor, int]]:
55945594
"""
55955595
Counts the number of items in the batches to properly scale the loss.
55965596
Args:

0 commit comments

Comments
 (0)