Spaces:
Running
Running
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width" /> | |
| <title>My static Space</title> | |
| <link rel="stylesheet" href="style.css" /> | |
| </head> | |
| <body> | |
| <div class="card"> | |
| <h1>Welcome to your static Space!</h1> | |
| <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p> | |
| <p> | |
| Also don't forget to check the | |
| <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>. | |
| </p> | |
| </div> | |
| <script> | |
| async function query(filename) { | |
| const data = fs.readFileSync(filename); | |
| const response = await fetch( | |
| "https://api-inference.huggingface.co/models/u2003158/bestmodelv5", | |
| { | |
| headers: { Authorization: "Bearer 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" }, | |
| method: "POST", | |
| body: data, | |
| } | |
| ); | |
| const result = await response.json(); | |
| return result; | |
| } | |
| query("cats.jpg").then((response) => { | |
| console.log(JSON.stringify(response)); | |
| }); | |
| </script> | |
| </body> | |
| </html> | |