mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-04 18:11:02 +00:00
fix: allow for print for fns that are used in both dist and single
This commit is contained in:
@@ -2,5 +2,8 @@ import torch.distributed as dist
|
|||||||
|
|
||||||
|
|
||||||
def rank0_print(msg):
|
def rank0_print(msg):
|
||||||
if dist.get_rank() == 0:
|
if dist.is_initialized():
|
||||||
|
if dist.get_rank() == 0:
|
||||||
|
print(msg)
|
||||||
|
else:
|
||||||
print(msg)
|
print(msg)
|
||||||
|
Reference in New Issue
Block a user