mn-docs-mcp 0.2.4 → 0.3.0
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/mcp/lib.mjs +0 -3
- package/package.json +1 -1
package/mcp/lib.mjs
CHANGED
|
@@ -117,13 +117,11 @@ async function getExtractor() {
|
|
|
117
117
|
if (extractorPromise) return extractorPromise;
|
|
118
118
|
loadEnv();
|
|
119
119
|
setupProxy();
|
|
120
|
-
env.cacheDir = path.join(MCP_DIR, 'models');
|
|
121
120
|
env.allowRemoteModels = true;
|
|
122
121
|
if (process.env.HF_ENDPOINT) {
|
|
123
122
|
env.HF_ENDPOINT = process.env.HF_ENDPOINT;
|
|
124
123
|
}
|
|
125
124
|
|
|
126
|
-
const modelDir = path.join(env.cacheDir, 'Xenova', 'bge-small-zh-v1.5');
|
|
127
125
|
const create = async () =>
|
|
128
126
|
pipeline('feature-extraction', MODEL_ID, {
|
|
129
127
|
progress_callback: logDownloadProgress,
|
|
@@ -146,7 +144,6 @@ async function getExtractor() {
|
|
|
146
144
|
}
|
|
147
145
|
|
|
148
146
|
logInfo(`模型下载失败,准备重试(${attempt}/${MAX_EXTRACTOR_RETRIES})...`);
|
|
149
|
-
await fs.rm(modelDir, { recursive: true, force: true });
|
|
150
147
|
}
|
|
151
148
|
}
|
|
152
149
|
throw new Error('模型加载失败');
|