dsh-sixlayer-memory 2.5.1 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/memory/stream-asr.js +5 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
dsh plugin --profile desktop add dsh-sixlayer-memory
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
**当前版本**:2.5.
|
|
14
|
+
**当前版本**:2.5.2 · **35 个工具** · schema v9 · 零外部依赖 · 回归 35 个套件全绿
|
|
15
15
|
|
|
16
16
|
📦 [npm](https://www.npmjs.com/package/dsh-sixlayer-memory) · 🎬 [40 秒介绍视频](media/intro-40s.mp4) · 📝 [变更记录](CHANGELOG.md)
|
|
17
17
|
|
package/lib/memory/stream-asr.js
CHANGED
|
@@ -37,11 +37,13 @@ export function dshHomeCandidates({ env = process.env } = {}) {
|
|
|
37
37
|
|
|
38
38
|
/** 找模型目录:配置 > 各 $DSH_HOME 候选。返回 {dir, tried} 便于诊断。 */
|
|
39
39
|
export function resolveModelDirDetailed({ name = DEFAULT_MODEL, dataDir = '', env = process.env } = {}) {
|
|
40
|
+
// 注意:调用方常传空串(配置没写),空串不能当"用户指定了空名字",要回落到默认模型。
|
|
41
|
+
const modelName = (typeof name === 'string' && name.trim()) || DEFAULT_MODEL
|
|
40
42
|
const tried = []
|
|
41
43
|
const candidates = []
|
|
42
|
-
if (
|
|
43
|
-
for (const home of dshHomeCandidates({ env })) candidates.push(path.join(home, 'memory-core', 'models',
|
|
44
|
-
if (dataDir) candidates.push(path.join(dataDir, 'models',
|
|
44
|
+
if (path.isAbsolute(modelName)) candidates.push(modelName)
|
|
45
|
+
for (const home of dshHomeCandidates({ env })) candidates.push(path.join(home, 'memory-core', 'models', modelName))
|
|
46
|
+
if (dataDir) candidates.push(path.join(dataDir, 'models', modelName))
|
|
45
47
|
for (const dir of candidates) {
|
|
46
48
|
tried.push(dir)
|
|
47
49
|
if (fs.existsSync(path.join(dir, 'tokens.txt')) && fs.existsSync(path.join(dir, 'encoder-epoch-99-avg-1.onnx'))) {
|