File size: 1,906 Bytes
61e6275
 
 
 
 
 
 
 
 
 
b4867cc
61e6275
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b4867cc
 
 
 
 
 
 
 
29e20e0
 
 
 
 
b4867cc
61e6275
 
 
 
29e20e0
f8d016c
61e6275
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Transformers.js Bench (Web)</title>
    <style>
      body { font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; margin: 2rem; }
      button { padding: 0.6rem 1rem; font-size: 1rem; }
      pre { background: #f6f8fa; padding: 1rem; border-radius: 8px; overflow: auto; }
      .row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; flex-wrap: wrap; }
      label { font-weight: 600; }
      input, select { padding: 0.4rem 0.6rem; }
    </style>
  </head>
  <body>
    <h1>Transformers.js Bench (Web)</h1>
    <div class="row">
      <label for="model">Model</label>
      <input id="model" value="Xenova/distilbert-base-uncased" size="34" />
      <label for="task">Task</label>
      <select id="task">
        <option value="feature-extraction" selected>feature-extraction</option>
        <option value="text-classification">text-classification</option>
      </select>
    </div>
    <div class="row">
      <label for="mode">Mode</label>
      <select id="mode">
        <option value="warm" selected>warm (prefetch + reload)</option>
        <option value="cold">cold (clear caches once)</option>
      </select>
      <label for="repeats">Repeats</label>
      <input id="repeats" type="number" value="3" min="1" style="width: 5rem;" />
      <label for="device">Device</label>
      <select id="device">
        <option value="webgpu" selected>webgpu</option>
        <option value="wasm">wasm (CPU)</option>
      </select>
    </div>
    <div class="row">
      <button id="run">Run benchmark</button>
      <span id="status"></span>
    </div>
    <code><pre id="out">{}</pre></code>
    <script type="module" src="/src/web/main.ts"></script>
  </body>
</html>