File size: 1,294 Bytes
afed82d
 
 
 
 
b8e7170
 
 
 
 
 
 
afed82d
b8e7170
afed82d
 
 
 
 
 
 
 
b8e7170
afed82d
b8e7170
 
 
 
afed82d
b8e7170
 
 
 
4535423
b8e7170
 
 
 
 
 
 
afed82d
 
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
<title>WebGPU AI Demos</title>
<body>
  <h1 align="center">WebGPU AI Demos</h1>
  <script>
    "use strict";
    const demos = [
      [
        "LLMs with MediaPipe and TFLite",
        "llm-inference",
        "<a href=https://github.com/googlesamples/mediapipe/tree/main/examples/llm_inference/js>original code</a>, <a href=https://developers.googleblog.com/2024/03/running-large-language-models-on-device-with-mediapipe-andtensorflow-lite.html>more info</a>",
      ],
    ];

    // table
    const table = document.createElement("table");
    table.align = "center";
    table.style.width = "80%";
    table.setAttribute("border", "1");
    document.body.appendChild(table);

    // first line
    let row = table.insertRow(-1);
    const headers = ["Name", "Description"];
    row.style.fontWeight = "bold";
    for (let header of headers) {
      let td = row.insertCell(-1);
      td.innerHTML = header;
    }

    // rest of lines
    for (let demo of demos) {
      row = table.insertRow(-1);
      let td = row.insertCell(-1);
	  let href = `${demo[1]}/index.html`;
	  if (window.location.origin.includes("hf")) {
		href = `/${href}`;
	  }
      td.innerHTML = `<a href=${href}>${demo[0]}</a>`;
      td = row.insertCell(-1);
      td.innerHTML = demo[2];
    }
  </script>
</body>