Spaces:
Running
Running
use slider to determine boost value
Browse files- app/static/index.html +14 -9
app/static/index.html
CHANGED
@@ -94,7 +94,9 @@
|
|
94 |
color: #2f3640;
|
95 |
}
|
96 |
.controls select,
|
97 |
-
.controls input[type="
|
|
|
|
|
98 |
.controls textarea {
|
99 |
padding: 0.3rem;
|
100 |
border-radius: 5px;
|
@@ -158,10 +160,10 @@
|
|
158 |
<!-- Hotwords List Input -->
|
159 |
<label for="hotwordsList">Hotwords:</label>
|
160 |
<textarea id="hotwordsList" placeholder="Enter one hotword per line"></textarea>
|
161 |
-
<!--
|
162 |
-
<label for="boostScore">Boost Score
|
163 |
-
<input type="
|
164 |
-
<!--
|
165 |
<button id="applyHotwords">Apply Hotwords</button>
|
166 |
</div>
|
167 |
|
@@ -211,6 +213,7 @@
|
|
211 |
const precisionSelect = document.getElementById("precisionSelect");
|
212 |
const hotwordsList = document.getElementById("hotwordsList");
|
213 |
const boostScore = document.getElementById("boostScore");
|
|
|
214 |
const applyBtn = document.getElementById("applyHotwords");
|
215 |
const hotwordStatus = document.getElementById("hotwordStatus");
|
216 |
const modelLangs = document.getElementById("modelLangs");
|
@@ -290,15 +293,17 @@
|
|
290 |
sendConfig();
|
291 |
updateHotwordStatus();
|
292 |
});
|
293 |
-
// hotwordsList.addEventListener("input", sendConfig);
|
294 |
-
// boostScore.addEventListener("input", sendConfig);
|
295 |
-
|
296 |
-
// ← Re-send config & update indicator when the button is clicked
|
297 |
applyBtn.addEventListener("click", () => {
|
298 |
sendConfig();
|
299 |
updateHotwordStatus();
|
300 |
});
|
301 |
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
const source = context.createMediaStreamSource(stream);
|
303 |
const processor = context.createScriptProcessor(4096, 1, 1);
|
304 |
source.connect(processor);
|
|
|
94 |
color: #2f3640;
|
95 |
}
|
96 |
.controls select,
|
97 |
+
.controls input[type="range"] {
|
98 |
+
width: 150px;
|
99 |
+
}
|
100 |
.controls textarea {
|
101 |
padding: 0.3rem;
|
102 |
border-radius: 5px;
|
|
|
160 |
<!-- Hotwords List Input -->
|
161 |
<label for="hotwordsList">Hotwords:</label>
|
162 |
<textarea id="hotwordsList" placeholder="Enter one hotword per line"></textarea>
|
163 |
+
<!-- Boost Score Slider -->
|
164 |
+
<label for="boostScore">Boost Score: <span id="boostValue">2.0</span></label>
|
165 |
+
<input type="range" id="boostScore" min="0" max="10" step="0.1" value="2.0" />
|
166 |
+
<!-- Button to apply hotword settings -->
|
167 |
<button id="applyHotwords">Apply Hotwords</button>
|
168 |
</div>
|
169 |
|
|
|
213 |
const precisionSelect = document.getElementById("precisionSelect");
|
214 |
const hotwordsList = document.getElementById("hotwordsList");
|
215 |
const boostScore = document.getElementById("boostScore");
|
216 |
+
const boostValue = document.getElementById("boostValue");
|
217 |
const applyBtn = document.getElementById("applyHotwords");
|
218 |
const hotwordStatus = document.getElementById("hotwordStatus");
|
219 |
const modelLangs = document.getElementById("modelLangs");
|
|
|
293 |
sendConfig();
|
294 |
updateHotwordStatus();
|
295 |
});
|
|
|
|
|
|
|
|
|
296 |
applyBtn.addEventListener("click", () => {
|
297 |
sendConfig();
|
298 |
updateHotwordStatus();
|
299 |
});
|
300 |
|
301 |
+
// Update boost display and status on slider input
|
302 |
+
boostScore.addEventListener("input", () => {
|
303 |
+
boostValue.textContent = boostScore.value;
|
304 |
+
updateHotwordStatus();
|
305 |
+
});
|
306 |
+
|
307 |
const source = context.createMediaStreamSource(stream);
|
308 |
const processor = context.createScriptProcessor(4096, 1, 1);
|
309 |
source.connect(processor);
|