From 4e95ad3c4985dce64009ceeee70e30f9742418cd Mon Sep 17 00:00:00 2001
From: zhaomingwork <61895407+zhaomingwork@users.noreply.github.com>
Date: 星期四, 15 六月 2023 16:41:36 +0800
Subject: [PATCH] For python ws client long wav not recv asr result bug (#633)

---
 funasr/layers/global_mvn.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/funasr/layers/global_mvn.py b/funasr/layers/global_mvn.py
index 11c459d..8e43582 100644
--- a/funasr/layers/global_mvn.py
+++ b/funasr/layers/global_mvn.py
@@ -7,12 +7,13 @@
 from typeguard import check_argument_types
 
 from funasr.modules.nets_utils import make_pad_mask
+from funasr.layers.abs_normalize import AbsNormalize
+from funasr.layers.inversible_interface import InversibleInterface
 
-class GlobalMVN(torch.nn.Module):
+
+class GlobalMVN(AbsNormalize, InversibleInterface):
     """Apply global mean and variance normalization
-
     TODO(kamo): Make this class portable somehow
-
     Args:
         stats_file: npy file
         norm_means: Apply mean normalization
@@ -63,7 +64,6 @@
         self, x: torch.Tensor, ilens: torch.Tensor = None
     ) -> Tuple[torch.Tensor, torch.Tensor]:
         """Forward function
-
         Args:
             x: (B, L, ...)
             ilens: (B,)
@@ -115,4 +115,4 @@
         if norm_means:
             x += self.mean
             x.masked_fill_(make_pad_mask(ilens, x, 1), 0.0)
-        return x, ilens
+        return x, ilens
\ No newline at end of file

--
Gitblit v1.9.1