mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
bugfix (#1580)
* train * train * train * train * train * train * train * train * train * train * train * train * train * train * train * train * train * train * train * train * whisper_lib for sense voice * aishell recipe * sense voice * docs * bugfix
This commit is contained in:
parent
48693b45c0
commit
edb9656176
@ -19,18 +19,19 @@ def import_submodules(package, recursive=True):
|
||||
package = importlib.import_module(package)
|
||||
except Exception as e:
|
||||
# 如果想要看到导入错误的具体信息,可以取消注释下面的行
|
||||
# print(f"Failed to import {name}: {e}")
|
||||
# print(f"Failed to import {package}: {e}")
|
||||
pass
|
||||
results = {}
|
||||
for loader, name, is_pkg in pkgutil.walk_packages(package.__path__, package.__name__ + '.'):
|
||||
try:
|
||||
results[name] = importlib.import_module(name)
|
||||
except Exception as e:
|
||||
# 如果想要看到导入错误的具体信息,可以取消注释下面的行
|
||||
# print(f"Failed to import {name}: {e}")
|
||||
pass
|
||||
if recursive and is_pkg:
|
||||
results.update(import_submodules(name))
|
||||
if not isinstance(package, str):
|
||||
for loader, name, is_pkg in pkgutil.walk_packages(package.__path__, package.__name__ + '.'):
|
||||
try:
|
||||
results[name] = importlib.import_module(name)
|
||||
except Exception as e:
|
||||
# 如果想要看到导入错误的具体信息,可以取消注释下面的行
|
||||
# print(f"Failed to import {name}: {e}")
|
||||
pass
|
||||
if recursive and is_pkg:
|
||||
results.update(import_submodules(name))
|
||||
return results
|
||||
|
||||
import_submodules(__name__)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user