File size: 1,344 Bytes
5356a5c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>llama2.c</title>

    <style>
        textarea {
            width: 300px;
            height: 400px;
            font-family: monospace;
            font-size: 12px;
            background: #fff;
            color: #000;
        }
    </style>
</head>
<body>
    <h3><a href="https://github.com/karpathy/llama2.c">llama2.c</a> compiled with Emscripten to run in a web page</h3>

    <p id="msg">loading, please wait ...</p>
    <p id="progress"></p>

    <textarea id="output"></textarea>

    <script>
        "use strict";
        function onStdout(text) {
            text = Array.prototype.slice.call(arguments).join(' ');
            document.getElementById('output').innerHTML += text;
        }
        function onRuntimeInitialized() {
            document.getElementById('msg').innerHTML = "generating ...";
        }
        function onProgress(text) {
            document.getElementById('progress').innerHTML = text;
        }
        var Module = { };
        Module['onRuntimeInitialized'] = onRuntimeInitialized;
        Module['setStatus']            = onProgress;
        Module['print']                = onStdout;
    </script>
    <script src="llama2.js"></script>
</body>
</html>