Update index.html
Browse files- index.html +8 -3
index.html
CHANGED
|
@@ -30,7 +30,8 @@
|
|
| 30 |
let speaking = false
|
| 31 |
let total_infer_time=0
|
| 32 |
let count_infer=0
|
| 33 |
-
async function main() {
|
|
|
|
| 34 |
if (speaking){
|
| 35 |
console.log("speaking return")
|
| 36 |
}
|
|
@@ -40,7 +41,7 @@
|
|
| 40 |
if(!matcha_tts_raw){
|
| 41 |
matcha_tts_raw = new MatchaTTSRaw()
|
| 42 |
console.time("load model");
|
| 43 |
-
await matcha_tts_raw.load_model('./models/matcha-tts/
|
| 44 |
|
| 45 |
console.timeEnd("load model");
|
| 46 |
|
|
@@ -107,9 +108,13 @@
|
|
| 107 |
document.getElementById('temperature').onchange = update_range2
|
| 108 |
document.getElementById('speed').onchange = update_range3
|
| 109 |
}
|
| 110 |
-
|
|
|
|
|
|
|
| 111 |
|
| 112 |
</script>
|
|
|
|
|
|
|
| 113 |
<div id="result"></div>
|
| 114 |
<br><br>
|
| 115 |
<input type="text" id="textInput" value ="Hello Huggingface." placeholder="Enter some text here...">
|
|
|
|
| 30 |
let speaking = false
|
| 31 |
let total_infer_time=0
|
| 32 |
let count_infer=0
|
| 33 |
+
async function main(model_name="en001_ep6399_univ_simplify_q8") {
|
| 34 |
+
console.log(model_name)
|
| 35 |
if (speaking){
|
| 36 |
console.log("speaking return")
|
| 37 |
}
|
|
|
|
| 41 |
if(!matcha_tts_raw){
|
| 42 |
matcha_tts_raw = new MatchaTTSRaw()
|
| 43 |
console.time("load model");
|
| 44 |
+
await matcha_tts_raw.load_model('./models/matcha-tts/'+model_name+'.onnx',{ executionProviders: ['webgpu','wasm'] });
|
| 45 |
|
| 46 |
console.timeEnd("load model");
|
| 47 |
|
|
|
|
| 108 |
document.getElementById('temperature').onchange = update_range2
|
| 109 |
document.getElementById('speed').onchange = update_range3
|
| 110 |
}
|
| 111 |
+
function loadModel(model_name){
|
| 112 |
+
main(model_name)
|
| 113 |
+
}
|
| 114 |
|
| 115 |
</script>
|
| 116 |
+
|
| 117 |
+
<button onclick="loadModel('ljspeech_sim')">LJSpeech</button><br><br>
|
| 118 |
<div id="result"></div>
|
| 119 |
<br><br>
|
| 120 |
<input type="text" id="textInput" value ="Hello Huggingface." placeholder="Enter some text here...">
|