|
<!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> |
|
|
|
<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!!", |
|
exampleImage, |
|
]); |
|
|
|
console.log(result.data); |
|
} |
|
|
|
runExample(); |
|
</script> |
|
</body> |
|
</html> |
|
|