Spaces:
Runtime error
Runtime error
Download static/script.js from Omkar1872/pneumonia-fastapi: direct link, hf CLI and curl.
- Browser
- Download file 814 Bytes
-
https://huggingface.co/spaces/Omkar1872/pneumonia-fastapi/resolve/main/static/script.js
- Command line
-
hf download hf://spaces/Omkar1872/pneumonia-fastapi/static/script.js
-
curl -L -o script.js https://huggingface.co/spaces/Omkar1872/pneumonia-fastapi/resolve/main/static/script.js
814 Bytes
| function uploadImage() { | |
| const fileInput = document.getElementById("fileInput"); | |
| const file = fileInput.files[0]; | |
| if (!file) return; | |
| document.getElementById("loading").classList.remove("hidden"); | |
| document.getElementById("result").innerText = ""; | |
| const formData = new FormData(); | |
| formData.append("file", file); | |
| fetch("/predict", { | |
| method: "POST", | |
| body: formData, | |
| }) | |
| .then((res) => res.json()) | |
| .then((data) => { | |
| document.getElementById("loading").classList.add("hidden"); | |
| document.getElementById("result").innerText = "Prediction: " + data.result; | |
| }) | |
| .catch((err) => { | |
| document.getElementById("loading").classList.add("hidden"); | |
| document.getElementById("result").innerText = "Error during prediction."; | |
| }); | |
| } | |