Update index.html
Browse files- index.html +7 -6
index.html
CHANGED
@@ -100,12 +100,12 @@
|
|
100 |
resultBox.style.display = "block";
|
101 |
|
102 |
try {
|
103 |
-
const response = await fetch("https://gaur3009-speech
|
104 |
method: "POST",
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
})
|
110 |
});
|
111 |
|
@@ -118,7 +118,8 @@
|
|
118 |
const confidence = data?.data?.[1];
|
119 |
|
120 |
if (prediction !== undefined) {
|
121 |
-
|
|
|
122 |
} else {
|
123 |
resultText.innerText = "⚠️ Unexpected API response format.";
|
124 |
}
|
|
|
100 |
resultBox.style.display = "block";
|
101 |
|
102 |
try {
|
103 |
+
const response = await fetch("https://gaur3009-gr-speech.hf.space/api/predict", {
|
104 |
method: "POST",
|
105 |
+
headers: { "Content-Type": "application/json" },
|
106 |
+
body: JSON.stringify({
|
107 |
+
data: [document.getElementById("speechInput").value.trim()],
|
108 |
+
fn_index: 0
|
109 |
})
|
110 |
});
|
111 |
|
|
|
118 |
const confidence = data?.data?.[1];
|
119 |
|
120 |
if (prediction !== undefined) {
|
121 |
+
const [corrected, score] = data.data;
|
122 |
+
resultText.innerText = `✅ Corrected: ${corrected}\n🔍 Score: ${score}%`;
|
123 |
} else {
|
124 |
resultText.innerText = "⚠️ Unexpected API response format.";
|
125 |
}
|