[FIX BUG] convert env param to int in (#5934)

This commit is contained in:
Gao, Ruiyuan
2024-07-24 10:30:40 +08:00
committed by GitHub
parent a521ffc9f8
commit 5fb958cc83

View File

@@ -44,7 +44,7 @@ class DistCoordinator(metaclass=SingletonMeta):
self._rank = dist.get_rank()
self._world_size = dist.get_world_size()
# this is often passed by launchers such as torchrun
self._local_rank = os.environ.get("LOCAL_RANK", -1)
self._local_rank = int(os.environ.get("LOCAL_RANK", -1))
@property
def rank(self) -> int: