File size: 1,035 Bytes
4e855aa
862094b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4e855aa
862094b
 
 
 
 
 
 
 
4e855aa
862094b
 
 
4e855aa
862094b
 
 
4e855aa
862094b
4e855aa
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Gradio Lite Demo</title>
    <script src="https://cdn.jsdelivr.net/npm/@gradio/gradio-lite@latest"></script>
</head>
<body>

<div id="gradio-app"></div>

<script>
    const config = {
        "fn": "hello_world", // Название функции, которая будет вызываться
        "inputs": [
            {
                "type": "text", // Тип входного поля
                "label": "Input Text" // Метка для входного поля
            }
        ],
        "outputs": [
            {
                "type": "text", // Тип выходного поля
                "label": "Output Text" // Метка для выходного поля
            }
        ]
    };

    function hello_world(input_text) {
        return `Hello, ${input_text}!`;
    }

    gradioApp = new GradioApp(config, {hello_world});
    gradioApp.run(document.querySelector("#gradio-app"));
</script>

</body>
</html>