[Bugfix] Fix torch_xla in V0 which can't handle None seed introduced … (#14844)

Signed-off-by: Yarong Mu <ymu@google.com>
This commit is contained in:
yarongmu-google 2025-03-14 17:41:15 -07:00 committed by GitHub
parent 54a8804455
commit dd344e0342
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,6 +51,9 @@ class TPUWorker(LoRANotSupportedWorkerBase, LocalOrDistributedWorkerBase):
self.model_runner: TPUModelRunner = TPUModelRunner(
vllm_config=vllm_config, is_driver_worker=is_driver_worker)
if self.model_config.seed is None:
self.model_config.seed = 0
def init_device(self) -> None:
os.environ["PJRT_DEVICE"] = "TPU"
torch.set_grad_enabled(False)