mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
14 lines
309 B
Python
14 lines
309 B
Python
import sys
|
|
import torch.distributed
|
|
import logging
|
|
|
|
HINTED = set()
|
|
|
|
|
|
def hint_once(content, uid, rank=None):
|
|
if (rank is None) or (not torch.distributed.is_initialized()) or torch.distributed.get_rank() == rank:
|
|
if uid not in HINTED:
|
|
logging.info(content)
|
|
HINTED.add(uid)
|
|
|