| import { client } from "@gradio/client"; | |
| async function getPrediction() { | |
| try { | |
| const app = await client("user/space-name"); | |
| const result = await app.predict("/predict", [input_data]); | |
| console.log(result); | |
| } catch (error) { | |
| console.error("Error connecting to the Space:", error.message); | |
| } | |
| } | |
| getPrediction(); | |