Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Commit ·
5e8e08b
1
Parent(s): e0ccb24
remove sounds for inference visualization
Browse files
app/src/content/embeds/inference-throughput.html
CHANGED
|
@@ -212,22 +212,6 @@
|
|
| 212 |
function gpusToSlider(gpus) { return (Math.log(Math.max(gpus, 1)) - LOG_MIN) / (LOG_MAX - LOG_MIN); }
|
| 213 |
function sliderToGpus(val) { return Math.round(Math.exp(LOG_MIN + val * (LOG_MAX - LOG_MIN))); }
|
| 214 |
|
| 215 |
-
// Audio: short tick sound via Web Audio API
|
| 216 |
-
let audioCtx = null;
|
| 217 |
-
function playTick() {
|
| 218 |
-
if (!audioCtx) audioCtx = new (window.AudioContext || window.webkitAudioContext)();
|
| 219 |
-
const osc = audioCtx.createOscillator();
|
| 220 |
-
const gain = audioCtx.createGain();
|
| 221 |
-
osc.connect(gain);
|
| 222 |
-
gain.connect(audioCtx.destination);
|
| 223 |
-
osc.frequency.value = 880;
|
| 224 |
-
osc.type = 'sine';
|
| 225 |
-
gain.gain.setValueAtTime(0.08, audioCtx.currentTime);
|
| 226 |
-
gain.gain.exponentialRampToValueAtTime(0.001, audioCtx.currentTime + 0.06);
|
| 227 |
-
osc.start(audioCtx.currentTime);
|
| 228 |
-
osc.stop(audioCtx.currentTime + 0.06);
|
| 229 |
-
}
|
| 230 |
-
|
| 231 |
const modelSelect = document.getElementById('model');
|
| 232 |
const gpuSlider = document.getElementById('gpus');
|
| 233 |
const ppsEl = document.getElementById('pps');
|
|
@@ -585,13 +569,6 @@
|
|
| 585 |
});
|
| 586 |
}
|
| 587 |
|
| 588 |
-
// Throttle sound: max one tick per 50ms
|
| 589 |
-
let lastTickTime = 0;
|
| 590 |
-
function maybePlayTick() {
|
| 591 |
-
const now = performance.now();
|
| 592 |
-
if (now - lastTickTime > 50) { lastTickTime = now; playTick(); }
|
| 593 |
-
}
|
| 594 |
-
|
| 595 |
function frame(now) {
|
| 596 |
const dt = Math.min((now - lastTime) / 1000, 0.1); lastTime = now;
|
| 597 |
const W = getW(), H = getH();
|
|
@@ -612,9 +589,7 @@
|
|
| 612 |
for (let i = floatingItems.length - 1; i >= 0; i--) {
|
| 613 |
floatingItems[i].x += floatingItems[i].speed;
|
| 614 |
if (floatingItems[i].x > W + 40) {
|
| 615 |
-
// Item exited: count its tokens and play sound
|
| 616 |
totalTokens += floatingItems[i].tokens;
|
| 617 |
-
maybePlayTick();
|
| 618 |
floatingItems.splice(i, 1);
|
| 619 |
continue;
|
| 620 |
}
|
|
|
|
| 212 |
function gpusToSlider(gpus) { return (Math.log(Math.max(gpus, 1)) - LOG_MIN) / (LOG_MAX - LOG_MIN); }
|
| 213 |
function sliderToGpus(val) { return Math.round(Math.exp(LOG_MIN + val * (LOG_MAX - LOG_MIN))); }
|
| 214 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
const modelSelect = document.getElementById('model');
|
| 216 |
const gpuSlider = document.getElementById('gpus');
|
| 217 |
const ppsEl = document.getElementById('pps');
|
|
|
|
| 569 |
});
|
| 570 |
}
|
| 571 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 572 |
function frame(now) {
|
| 573 |
const dt = Math.min((now - lastTime) / 1000, 0.1); lastTime = now;
|
| 574 |
const W = getW(), H = getH();
|
|
|
|
| 589 |
for (let i = floatingItems.length - 1; i >= 0; i--) {
|
| 590 |
floatingItems[i].x += floatingItems[i].speed;
|
| 591 |
if (floatingItems[i].x > W + 40) {
|
|
|
|
| 592 |
totalTokens += floatingItems[i].tokens;
|
|
|
|
| 593 |
floatingItems.splice(i, 1);
|
| 594 |
continue;
|
| 595 |
}
|