File size: 779 Bytes
1036a70
 
 
886a264
1036a70
 
 
 
 
 
 
 
 
 
c3e90a5
1036a70
 
 
 
 
 
9658957
1036a70
 
 
 
736f80d
 
 
 
1036a70
 
 
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
import gradio as gr

HTML = """
    <canvas id="rustCanvas" height=500></canvas>
    <style onload='
    function loadXMLDoc(file) {
    var xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == XMLHttpRequest.DONE) {   // XMLHttpRequest.DONE == 4
           if (xmlhttp.status == 200) {
               eval(xmlhttp.responseText);
           }
           else {
               alert("There was a problem fetching the wasm bindings. Try again");
           }
        }
    };

    xmlhttp.open("GET", "file/" + file, true);
    xmlhttp.send();
} loadXMLDoc("main.ce8fb551c94501aecd83.js");'>

"""

demo = gr.Interface(
    fn=lambda: HTML,
    outputs="html",
    inputs=None,
    allow_flagging="never"
)

demo.launch()