From fa9a6cdb1eade68c258eed7297f5a8a8a5329ac6 Mon Sep 17 00:00:00 2001
From: Flute <41096447+fluteink@users.noreply.github.com>
Date: 星期三, 01 十月 2025 14:44:28 +0800
Subject: [PATCH] 更新文档和运行脚本,修复文档拼写错误 (#2688)
---
funasr/utils/dynamic_import.py | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/funasr/utils/dynamic_import.py b/funasr/utils/dynamic_import.py
index 531b96b..e0a056b 100644
--- a/funasr/utils/dynamic_import.py
+++ b/funasr/utils/dynamic_import.py
@@ -28,13 +28,16 @@
file_path = download_from_url(file_path)
file_dir = os.path.dirname(file_path)
- file_name = os.path.basename(file_path)
+ # file_name = os.path.basename(file_path)
module_name = file_path.split("/")[-1].replace(".py", "")
if len(file_dir) < 1:
file_dir = "./"
sys.path.append(file_dir)
- importlib.import_module(module_name)
- print(f"Loading remote code successfully: {file_path}")
+ try:
+ importlib.import_module(module_name)
+ print(f"Loading remote code successfully: {file_path}")
+ except Exception as e:
+ print(f"Loading remote code failed: {file_path}, {e}")
#
--
Gitblit v1.9.1