[Bugfix] Fix torch_xla which can't handle None seed introduced in #14274 (#14459)

Signed-off-by: Yarong Mu <ymu@google.com>
This commit is contained in:
yarongmu-google
2025-03-07 15:17:04 -08:00
committed by GitHub
parent e1f0835ae0
commit 66e16a038e

View File

@ -75,6 +75,9 @@ class TPUWorker:
self.profile_dir)
self.profiler = xp.start_server(9012)
if self.model_config.seed is None:
self.model_config.seed = 0
def init_device(self):
os.environ["PJRT_DEVICE"] = "TPU"
torch.set_grad_enabled(False)