mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-17 13:37:36 +08:00
feat(transcriber): 使用 ModelScope 替代 Hugging Face 下载模型
- 在 requirements.txt 中添加 modelscope 依赖 - 修改 whisper.py 中的模型下载逻辑,使用 ModelScope 的 snapshot_download 函数- 更新 MODEL_MAP 字典,映射不同大小的模型到对应的 ModelScope 仓库 - 调整模型路径,直接使用 ModelScope 下载的路径
This commit is contained in:
@@ -2,11 +2,13 @@ import os
|
||||
|
||||
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../"))
|
||||
|
||||
|
||||
def get_data_dir():
|
||||
data_path = os.path.join(PROJECT_ROOT, "data")
|
||||
os.makedirs(data_path, exist_ok=True)
|
||||
return data_path
|
||||
|
||||
|
||||
def get_model_dir(subdir: str = "whisper") -> str:
|
||||
base = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../models"))
|
||||
path = os.path.join(base, subdir)
|
||||
@@ -15,4 +17,4 @@ def get_model_dir(subdir: str = "whisper") -> str:
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(get_data_dir())
|
||||
print(get_data_dir())
|
||||
|
||||
Reference in New Issue
Block a user