from toolkit.accelerator import get_accelerator def print_acc(*args, **kwargs): if get_accelerator().is_local_main_process: print(*args, **kwargs)