From 59f920f17c781be3a9b31d2b82dbda28c9b0c362 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期一, 08 五月 2023 16:14:25 +0800
Subject: [PATCH] websocket python offline/online 2pass demo

---
 funasr/tasks/abs_task.py |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/funasr/tasks/abs_task.py b/funasr/tasks/abs_task.py
index 775cba8..31057f9 100644
--- a/funasr/tasks/abs_task.py
+++ b/funasr/tasks/abs_task.py
@@ -467,7 +467,7 @@
         parser.add_argument(
             "--batch_interval",
             type=int,
-            default=10000,
+            default=-1,
             help="The batch interval for saving model.",
         )
         group.add_argument(
@@ -547,6 +547,12 @@
             type=int,
             default=1,
             help="The number of gradient accumulation",
+        )
+        group.add_argument(
+            "--bias_grad_times",
+            type=float,
+            default=1.0,
+            help="To scale the gradient of contextual related params",
         )
         group.add_argument(
             "--no_forward_run",
@@ -1582,8 +1588,11 @@
     ) -> AbsIterFactory:
         assert check_argument_types()
 
-        if args.frontend_conf is not None and "fs" in args.frontend_conf:
-            dest_sample_rate = args.frontend_conf["fs"]
+        if hasattr(args, "frontend_conf"):
+            if args.frontend_conf is not None and "fs" in args.frontend_conf:
+                dest_sample_rate = args.frontend_conf["fs"]
+            else:
+                dest_sample_rate = 16000
         else:
             dest_sample_rate = 16000
 

--
Gitblit v1.9.1