ASR-demo/scripts/model_manifest.py

30 lines
756 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"""供共享模型下载脚本使用的兼容性导出。"""
from pathlib import Path
import sys
# 直接执行脚本时,scripts/ 会排在 sys.path 首位;将仓库根目录
# 加入搜索路径,确保两种启动方式都能导入后端共享模型清单。
PROJECT_ROOT = Path(__file__).resolve().parents[1]
if str(PROJECT_ROOT) not in sys.path:
sys.path.insert(0, str(PROJECT_ROOT))
from backend.model_manifest import (
MANIFEST_PATH,
auxiliary_models,
load_manifest,
model_directory,
resolve_auxiliary_model_id,
resolve_model_id,
)
__all__ = [
"MANIFEST_PATH",
"PROJECT_ROOT",
"auxiliary_models",
"load_manifest",
"model_directory",
"resolve_auxiliary_model_id",
"resolve_model_id",
]