feat(python): add model_root_dir and download_models (API + CLI)

This commit is contained in:
SWHL authored and GitHub committed 2026-03-19 17:27:44 +08:00
1 parent 6e829e313e
commit 8ea96265b5
15 files changed
+372 -74

No files matched your search

+12
View File
@@ -2,6 +2,7 @@
# @Author: SWHL
# @Contact: liekkaskono@163.com
import shlex
import shutil
import sys
from pathlib import Path
@@ -31,6 +32,17 @@ def test_cli(capsys, cmd, gt):
assert gt in output
@mark.parametrize("cmd", [f"download_models --config {tests_dir}/test_config.yaml"])
def test_cli_download_models(capsys, cmd):
main(shlex.split(cmd))
output = capsys.readouterr().out.strip()
assert "Models downloaded to" in output
model_dir = Path("./test_models").expanduser().resolve()
assert model_dir.exists()
shutil.rmtree(model_dir)
@mark.parametrize("cmd", [f"config --save_cfg_file {tests_dir}/config.yaml"])
def test_cli_config(capsys, cmd):
main(shlex.split(cmd))