From b32b21d9c8b0ea659711760e7c80fb572d6b7a41 Mon Sep 17 00:00:00 2001
From: zhaomingwork <61895407+zhaomingwork@users.noreply.github.com>
Date: 星期二, 19 三月 2024 16:28:54 +0800
Subject: [PATCH] for h5 missing some result (#1514)
---
funasr/utils/misc.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/funasr/utils/misc.py b/funasr/utils/misc.py
index f27a63c..a08f263 100644
--- a/funasr/utils/misc.py
+++ b/funasr/utils/misc.py
@@ -12,7 +12,7 @@
return numel
-def int2vec(x, vec_dim=8, dtype=np.int):
+def int2vec(x, vec_dim=8, dtype=np.int32):
b = ('{:0' + str(vec_dim) + 'b}').format(x)
# little-endian order: lower bit first
return (np.array(list(b)[::-1]) == '1').astype(dtype)
@@ -46,3 +46,10 @@
value = value.split(' ')
ret_dict.append((key, value))
return ret_dict
+
+def deep_update(original, update):
+ for key, value in update.items():
+ if isinstance(value, dict) and key in original:
+ deep_update(original[key], value)
+ else:
+ original[key] = value
\ No newline at end of file
--
Gitblit v1.9.1