Skip to content

Commit b4ceea5

Browse files
committed
fix(asr): update FunASR model cache directory handling for clarity and compatibility
1 parent 69d7e82 commit b4ceea5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

desktop/src/asr/model-manager.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,17 @@ export default class ASRModelManager extends EventEmitter {
273273
const modelDirs = Object.values(onnxModels);
274274

275275
// funasr_onnx 使用的缓存目录
276-
// 注意:ModelScope 有时会将模型放在 hub/models/ 下,有时直接在 hub/ 下
276+
// 注意:ModelScope 有时会将模型放在 hub/ 下,有时放在与 hub 同级的 models/ 下
277+
// funasr_onnx 实际下载位置是 ~/.cache/modelscope/models/damo/...
277278
const funasrCacheDirs = [
279+
// 优先检查 models 目录(funasr_onnx 实际下载位置)
280+
path.join(os.homedir(), '.cache', 'modelscope', 'models'),
281+
// 兼容其他可能的目录结构
278282
path.join(os.homedir(), '.cache', 'modelscope', 'hub'),
279283
path.join(os.homedir(), '.cache', 'modelscope', 'hub', 'models'),
280284
this.msCacheHub,
281285
this.msCacheHub ? path.join(this.msCacheHub, 'models') : null,
286+
this.msCacheBase ? path.join(this.msCacheBase, 'models') : null,
282287
this.systemMsCache,
283288
path.join(this.systemMsCache, 'models'),
284289
].filter(Boolean);

0 commit comments

Comments
 (0)