webworker-test / index.html
ZaheraFT's picture
Upload 3 files
f799f05 verified
Raw History Blame Contribute Delete
2.81 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<meta name="color-scheme" content="light dark" />
<title>Qwen WebGPU Worker Test</title>
<style>
:root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; background: Canvas; color: CanvasText; }
main { max-width: 720px; margin: 0 auto; padding: 20px; }
h1 { font-size: 24px; margin: 0 0 8px; }
.muted { opacity: .72; font-size: 14px; }
.card { border: 1px solid color-mix(in srgb, CanvasText 18%, transparent); border-radius: 14px; padding: 16px; margin: 16px 0; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
select, textarea, button { width: 100%; box-sizing: border-box; font: inherit; }
select, textarea { padding: 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, CanvasText 22%, transparent); background: Canvas; color: CanvasText; }
textarea { min-height: 110px; resize: vertical; }
button { margin-top: 12px; padding: 13px 14px; border: 0; border-radius: 10px; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
progress { width: 100%; height: 16px; }
#output, #log { white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 10px; padding: 12px; background: color-mix(in srgb, CanvasText 7%, Canvas); min-height: 70px; }
#log { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 220px; overflow: auto; }
.ok { color: #188038; }
.err { color: #c5221f; }
</style>
</head>
<body>
<main>
<h1>Qwen WebGPU Worker Test</h1>
<p class="muted">Runs the ML pipeline in a Web Worker. Test Qwen3.5-0.8B first; if Safari reloads, retry with Qwen3-0.6B.</p>
<section class="card">
<label for="model">Model</label>
<select id="model">
<option value="qwen35-08" selected>Qwen3.5-0.8B q4f16 — first test</option>
<option value="qwen3-06">Qwen3-0.6B q4f16 — fallback/control</option>
</select>
<button id="initBtn">Load selected model</button>
<p id="status">Idle</p>
<div id="fileName" class="muted"></div>
<progress id="progress" value="0" max="100"></progress>
<div id="percent" class="muted">0%</div>
</section>
<section class="card">
<label for="prompt">Prompt</label>
<textarea id="prompt">Say hello in one short sentence.</textarea>
<button id="generateBtn" disabled>Generate</button>
<h3>Output</h3>
<div id="output"></div>
</section>
<section class="card">
<h3>Technical log</h3>
<div id="log"></div>
</section>
<script type="module" src="./main.js"></script>
</main>
</body>
</html>