修改:删除模型下载需要指定的分支参数
parent
f4747f3539
commit
e7f3dea8dc
|
|
@ -26,7 +26,7 @@
|
|||
~~~powershell
|
||||
python -m pip install -r requirements.txt
|
||||
if (-not (Test-Path .env)) { Copy-Item .env.example .env }
|
||||
python scripts/download_models.py --funasr-runtime
|
||||
python scripts/download_models.py
|
||||
~~~
|
||||
|
||||
在两个终端中分别启动后端和前端:
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@
|
|||
~~~powershell
|
||||
python -m pip install -r requirements.txt
|
||||
if (-not (Test-Path .env)) { Copy-Item .env.example .env }
|
||||
python scripts/download_models.py --funasr-runtime
|
||||
python scripts/download_models.py
|
||||
~~~
|
||||
|
||||
`--funasr-runtime` 会下载流式 Paraformer、Contextual 热词模型、FSMN-VAD、CAM++ 和标点模型。若要下载 `model_manifest.json` 中列出的全部模型资源,请运行 `python scripts/download_models.py`。
|
||||
默认运行 `python scripts/download_models.py` 会下载当前 ASR 模型、热词定稿模型及清单中的辅助模型;已完整下载的模型会自动跳过。
|
||||
|
||||
## 启动
|
||||
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ class AuxiliaryRuntime:
|
|||
)
|
||||
raise RuntimeError(
|
||||
"Auxiliary core model is missing or failed to load: " + details
|
||||
+ ". Run python scripts/download_models.py --funasr-runtime, "
|
||||
+ ". Run python scripts/download_models.py, "
|
||||
"or set MODEL_DIR/CAM_MODEL_PATH to the local CAM++ asset."
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -181,11 +181,6 @@ def main() -> int:
|
|||
action="store_true",
|
||||
help="Only download/check configured auxiliary assets",
|
||||
)
|
||||
auxiliary_group.add_argument(
|
||||
"--funasr-runtime",
|
||||
action="store_true",
|
||||
help="下载或检查流式 ASR、Contextual 热词 ASR、FSMN-VAD、CAM++ 和标点模型",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
manifest = load_manifest()
|
||||
|
|
@ -196,35 +191,7 @@ def main() -> int:
|
|||
cache_dir = args.cache_dir.resolve() if args.cache_dir else None
|
||||
selected_assets: list[tuple[str, dict[str, object]]] = []
|
||||
hotword_model_id = str(manifest.get("hotword_model") or "").strip()
|
||||
if args.funasr_runtime:
|
||||
# 标点模型在运行时可选,但下载后可获得完整的本地输出。
|
||||
asr_id = resolve_model_id(args.model, manifest)
|
||||
model_ids = [asr_id]
|
||||
if hotword_model_id:
|
||||
model_ids.append(resolve_model_id(hotword_model_id, manifest))
|
||||
selected_assets.extend(
|
||||
(model_id, manifest["models"][model_id])
|
||||
for model_id in dict.fromkeys(model_ids)
|
||||
)
|
||||
assets = auxiliary_models(manifest)
|
||||
vad_id = next(
|
||||
model_id for model_id, config in assets.items()
|
||||
if config.get("kind") == "vad"
|
||||
)
|
||||
cam_id = next(
|
||||
model_id for model_id, config in assets.items()
|
||||
if config.get("kind") == "speaker_verification"
|
||||
and model_id.startswith("iic/")
|
||||
)
|
||||
punctuation_id = next(
|
||||
model_id for model_id, config in assets.items()
|
||||
if config.get("kind") == "punctuation"
|
||||
)
|
||||
selected_assets.extend(
|
||||
(model_id, assets[model_id])
|
||||
for model_id in (vad_id, cam_id, punctuation_id)
|
||||
)
|
||||
else:
|
||||
# 不带模型筛选参数时,默认下载当前 ASR、热词模型和清单中的辅助模型。
|
||||
if not args.auxiliary_only:
|
||||
model_id = resolve_model_id(args.model, manifest)
|
||||
model_ids = [model_id]
|
||||
|
|
|
|||
Loading…
Reference in New Issue