From fe588bc508c0076bb007d6ed36c18ac8ecb341ac Mon Sep 17 00:00:00 2001
From: 王梦迪 <73778524+di-osc@users.noreply.github.com>
Date: 星期二, 20 五月 2025 16:10:59 +0800
Subject: [PATCH] Fsmn_vad支持多线程并发调用 (#2519)

---
 funasr/download/download_model_from_hub.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/funasr/download/download_model_from_hub.py b/funasr/download/download_model_from_hub.py
index 8e51144..c826b5f 100644
--- a/funasr/download/download_model_from_hub.py
+++ b/funasr/download/download_model_from_hub.py
@@ -7,9 +7,9 @@
 
 def download_model(**kwargs):
     hub = kwargs.get("hub", "ms")
-    if hub == "ms":
+    if hub == "ms" or hub == "modelscope":
         kwargs = download_from_ms(**kwargs)
-    elif hub == "hf":
+    elif hub == "hf" or hub == "huggingface":
         kwargs = download_from_hf(**kwargs)
     elif hub == "openai":
         model_or_path = kwargs.get("model")
@@ -43,7 +43,7 @@
             print(f"Download: {model_or_path} failed!: {e}")
 
     kwargs["model_path"] = model_or_path if "model_path" not in kwargs else kwargs["model_path"]
-
+    model_or_path = kwargs["model_path"]
     if os.path.exists(os.path.join(model_or_path, "configuration.json")):
         with open(os.path.join(model_or_path, "configuration.json"), "r", encoding="utf-8") as f:
             conf_json = json.load(f)
@@ -162,6 +162,7 @@
     if isinstance(file_path_metas, dict):
         if isinstance(cfg, list):
             cfg.append({})
+
         for k, v in file_path_metas.items():
             if isinstance(v, str):
                 p = os.path.join(model_or_path, v)
@@ -186,8 +187,8 @@
                     if k not in cfg:
                         cfg[k] = []
                     if isinstance(vv, str):
-                        p = os.path.join(model_or_path, v)
-                        file_path_metas[i] = p
+                        p = os.path.join(model_or_path, vv)
+                        # file_path_metas[i] = p
                         if os.path.exists(p):
                             if isinstance(cfg[k], dict):
                                 cfg[k] = p

--
Gitblit v1.9.1