File size: 283 Bytes
f549064
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
# Copyright (c) OpenMMLab. All rights reserved.
import mmengine.dist as dist
import rich.progress as progress


def track_on_main_process(sequence, *args, **kwargs):
    if not dist.is_main_process():
        return sequence

    yield from progress.track(sequence, *args, **kwargs)