Spaces:
Running
Running
Update index.html
Browse files- index.html +13 -7
index.html
CHANGED
@@ -161,7 +161,7 @@
|
|
161 |
<option value="quality">Highest Quality</option>
|
162 |
</select>
|
163 |
<div id="model-info">
|
164 |
-
TTS: Xenova/mms-tts-eng / STT: Xenova/whisper-tiny.en / LLM: Xenova/
|
165 |
</div>
|
166 |
</div>
|
167 |
<div id="visualizer"></div>
|
@@ -237,10 +237,10 @@
|
|
237 |
[sttPipeline, ttsPipeline, llmPipeline] = await Promise.all([
|
238 |
pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en', { quantized: true }),
|
239 |
pipeline('text-to-speech', 'Xenova/mms-tts-eng', { quantized: true }),
|
240 |
-
pipeline('text-generation', 'Xenova/
|
241 |
]);
|
242 |
|
243 |
-
addLog('System: Digital Human Voice Chat initialized with
|
244 |
startButton.disabled = false;
|
245 |
loadingDiv.style.display = 'none';
|
246 |
} catch (error) {
|
@@ -259,11 +259,17 @@
|
|
259 |
const transcription = await sttPipeline(audio);
|
260 |
addLog(`User: ${transcription.text}`);
|
261 |
|
262 |
-
const
|
263 |
-
|
264 |
-
|
|
|
|
|
|
|
|
|
|
|
265 |
});
|
266 |
-
|
|
|
267 |
addLog(`Bot: ${botResponse}`);
|
268 |
|
269 |
isSpeaking = true;
|
|
|
161 |
<option value="quality">Highest Quality</option>
|
162 |
</select>
|
163 |
<div id="model-info">
|
164 |
+
TTS: Xenova/mms-tts-eng / STT: Xenova/whisper-tiny.en / LLM: Xenova/Qwen1.5-0.5B-Chat
|
165 |
</div>
|
166 |
</div>
|
167 |
<div id="visualizer"></div>
|
|
|
237 |
[sttPipeline, ttsPipeline, llmPipeline] = await Promise.all([
|
238 |
pipeline('automatic-speech-recognition', 'Xenova/whisper-tiny.en', { quantized: true }),
|
239 |
pipeline('text-to-speech', 'Xenova/mms-tts-eng', { quantized: true }),
|
240 |
+
pipeline('text-generation', 'Xenova/Qwen1.5-0.5B-Chat', { quantized: true })
|
241 |
]);
|
242 |
|
243 |
+
addLog('System: Digital Human Voice Chat initialized with Qwen1.5-0.5B-Chat. Click "Begin Call" to start.');
|
244 |
startButton.disabled = false;
|
245 |
loadingDiv.style.display = 'none';
|
246 |
} catch (error) {
|
|
|
259 |
const transcription = await sttPipeline(audio);
|
260 |
addLog(`User: ${transcription.text}`);
|
261 |
|
262 |
+
const messages = [
|
263 |
+
{ role: 'system', content: 'You are a helpful assistant.' },
|
264 |
+
{ role: 'user', content: transcription.text }
|
265 |
+
];
|
266 |
+
|
267 |
+
const llmResponse = await llmPipeline(messages, {
|
268 |
+
max_new_tokens: 128,
|
269 |
+
do_sample: false
|
270 |
});
|
271 |
+
|
272 |
+
const botResponse = llmResponse[0].generated_text.find(msg => msg.role === 'assistant').content;
|
273 |
addLog(`Bot: ${botResponse}`);
|
274 |
|
275 |
isSpeaking = true;
|