From 6f4d67d657b04032ee1749890a359341dc087fe5 Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Sat, 18 Oct 2025 20:27:28 +0300 Subject: [PATCH] Fix exception causes in data_loader.py --- src/MaxText/data_loader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MaxText/data_loader.py b/src/MaxText/data_loader.py index 58c6171ceb..1f63e191ce 100644 --- a/src/MaxText/data_loader.py +++ b/src/MaxText/data_loader.py @@ -52,9 +52,9 @@ def load_next_batch(self): self.check_example_batch() except Exception as e: # pylint: disable=broad-except if isinstance(e, StopIteration): - raise exceptions.StopTraining(f"You may have run out of training data. Received {type(e)} exception: ({e})") + raise exceptions.StopTraining(f"You may have run out of training data. Received {type(e)} exception: ({e})") from e else: - raise exceptions.StopTraining(f"`load_next_batch()` failed with {type(e)} exception: ({e}).") + raise exceptions.StopTraining(f"`load_next_batch()` failed with {type(e)} exception: ({e}).") from e return self.last_batch def check_example_batch(self):