From 7357bb6c45eb3f0b4d2be5a4b025385ff9eec9e5 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期三, 21 二月 2024 14:34:36 +0800
Subject: [PATCH] update train recipe

---
 funasr/bin/train.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/funasr/bin/train.py b/funasr/bin/train.py
index d916509..0661452 100644
--- a/funasr/bin/train.py
+++ b/funasr/bin/train.py
@@ -44,14 +44,16 @@
 
 def main(**kwargs):
     print(kwargs)
+    
     # set random seed
-    tables.print()
     set_all_random_seed(kwargs.get("seed", 0))
     torch.backends.cudnn.enabled = kwargs.get("cudnn_enabled", torch.backends.cudnn.enabled)
     torch.backends.cudnn.benchmark = kwargs.get("cudnn_benchmark", torch.backends.cudnn.benchmark)
     torch.backends.cudnn.deterministic = kwargs.get("cudnn_deterministic", True)
     
     local_rank = int(os.environ.get('LOCAL_RANK', 0))
+    if local_rank == 0:
+        tables.print()
     # Check if we are using DDP or FSDP
     use_ddp = 'WORLD_SIZE' in os.environ and int(os.environ["WORLD_SIZE"]) > 1
     use_fsdp = kwargs.get("use_fsdp", None)

--
Gitblit v1.9.1