atlury commited on
Commit
553e1ac
·
verified ·
1 Parent(s): bea6e1a

Update index.html

Browse files
Files changed (1) hide show
  1. 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/gpt2-tiny-english
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/gpt2-tiny-english', { quantized: true })
241
  ]);
242
 
243
- addLog('System: Digital Human Voice Chat initialized with GPT-2 Tiny. Click "Begin Call" to start.');
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 llmResponse = await llmPipeline(transcription.text, {
263
- max_new_tokens: 50,
264
- temperature: 0.7
 
 
 
 
 
265
  });
266
- const botResponse = llmResponse[0].generated_text;
 
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;