File size: 1,111 Bytes
967ec2e
c155fff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
967ec2e
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Gradio Integration Example</title>
</head>
<body>
    <h1>Gradio Integration</h1>
    <!-- Votre balise script pour le code JavaScript -->
    <script type="module">
        import { client } from "@gradio/client";

        async function runExample() {
            const response_0 = await fetch("https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png");
            const exampleImage = await response_0.blob();
                            
            const app = await client("https://docfile-mariam-physique1.hf.space/--replicas/ptlbx/");
            const result = await app.predict("/predict", [     
                        "Hello!!", // string  in 'pro' Textbox component
                        exampleImage,   // blob in 'image' Image component
            ]);

            console.log(result.data);
        }

        runExample();
    </script>
</body>
</html>