agentgui 1.0.300 → 1.0.301
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/lib/speech.js +1 -1
- package/package.json +1 -1
- package/server.js +1 -14
package/lib/speech.js
CHANGED
|
@@ -14,7 +14,7 @@ let serverSTT = null;
|
|
|
14
14
|
let audioDecode = null;
|
|
15
15
|
let ttsUtils = null;
|
|
16
16
|
|
|
17
|
-
try { serverTTS = require('webtalk/server-tts
|
|
17
|
+
try { serverTTS = require('webtalk/server-tts'); } catch(e) { console.warn('[TTS] webtalk/server-tts unavailable:', e.message); }
|
|
18
18
|
try { serverSTT = require('webtalk/server-stt'); } catch(e) { console.warn('[STT] webtalk/server-stt unavailable:', e.message); }
|
|
19
19
|
try { audioDecode = require('audio-decode'); } catch(e) { console.warn('[TTS] audio-decode unavailable:', e.message); }
|
|
20
20
|
try { ttsUtils = require('webtalk/tts-utils'); } catch(e) {}
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -86,20 +86,7 @@ async function ensureModelsDownloaded() {
|
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
const { checkTTSModelExists } = createRequire(import.meta.url)('webtalk/tts-models');
|
|
89
|
-
const
|
|
90
|
-
const checkWhisperModelExists = whisperModelsLib.checkWhisperModelExists || (async (modelName, cfg) => {
|
|
91
|
-
const { isFileCorrupted } = whisperModelsLib;
|
|
92
|
-
const modelDir = path.join(cfg.modelsDir, modelName);
|
|
93
|
-
if (!fs.existsSync(modelDir)) return false;
|
|
94
|
-
const encoderPath = path.join(modelDir, 'onnx', 'encoder_model.onnx');
|
|
95
|
-
const decoderPath = path.join(modelDir, 'onnx', 'decoder_model_merged_q4.onnx');
|
|
96
|
-
const decoderFallback = path.join(modelDir, 'onnx', 'decoder_model_merged.onnx');
|
|
97
|
-
const hasEncoder = fs.existsSync(encoderPath);
|
|
98
|
-
const hasDecoder = fs.existsSync(decoderPath) || fs.existsSync(decoderFallback);
|
|
99
|
-
if (!hasEncoder || !hasDecoder) return false;
|
|
100
|
-
return !isFileCorrupted(encoderPath, 40 * 1024 * 1024) &&
|
|
101
|
-
(!isFileCorrupted(decoderPath, 100 * 1024 * 1024) || !isFileCorrupted(decoderFallback, 100 * 1024 * 1024));
|
|
102
|
-
});
|
|
89
|
+
const { checkWhisperModelExists } = createRequire(import.meta.url)('webtalk/whisper-models');
|
|
103
90
|
|
|
104
91
|
const sttOk = await checkWhisperModelExists(config.defaultWhisperModel, config).catch(() => false);
|
|
105
92
|
const ttsOk = await checkTTSModelExists(config).catch(() => false);
|