Re / index.html
Docfile's picture
Update index.html
c155fff verified
raw
history blame
1.11 kB
<!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>