Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +1 -6
templates/index.html
CHANGED
|
@@ -22,9 +22,6 @@
|
|
| 22 |
<option value="ann">ANN</option>
|
| 23 |
</select>
|
| 24 |
|
| 25 |
-
<!-- <label for="token">Token:</label>
|
| 26 |
-
<input type="text" id="token" placeholder="Enter your API token" required /> -->
|
| 27 |
-
|
| 28 |
<div class="features">
|
| 29 |
<label>Danceability: <input type="number" step="0.01" id="danceability" required></label>
|
| 30 |
<label>Energy: <input type="number" step="0.01" id="energy" required></label>
|
|
@@ -51,7 +48,6 @@
|
|
| 51 |
document.getElementById("predictForm").addEventListener("submit", async (e) => {
|
| 52 |
e.preventDefault();
|
| 53 |
const model = document.getElementById("model").value;
|
| 54 |
-
const token = document.getElementById("token").value;
|
| 55 |
|
| 56 |
const features = {
|
| 57 |
danceability: parseFloat(document.getElementById("danceability").value),
|
|
@@ -72,8 +68,7 @@
|
|
| 72 |
const response = await fetch(`/predict/${model}`, {
|
| 73 |
method: "POST",
|
| 74 |
headers: {
|
| 75 |
-
"Content-Type": "application/json"
|
| 76 |
-
"Token": token
|
| 77 |
},
|
| 78 |
body: JSON.stringify(features)
|
| 79 |
});
|
|
|
|
| 22 |
<option value="ann">ANN</option>
|
| 23 |
</select>
|
| 24 |
|
|
|
|
|
|
|
|
|
|
| 25 |
<div class="features">
|
| 26 |
<label>Danceability: <input type="number" step="0.01" id="danceability" required></label>
|
| 27 |
<label>Energy: <input type="number" step="0.01" id="energy" required></label>
|
|
|
|
| 48 |
document.getElementById("predictForm").addEventListener("submit", async (e) => {
|
| 49 |
e.preventDefault();
|
| 50 |
const model = document.getElementById("model").value;
|
|
|
|
| 51 |
|
| 52 |
const features = {
|
| 53 |
danceability: parseFloat(document.getElementById("danceability").value),
|
|
|
|
| 68 |
const response = await fetch(`/predict/${model}`, {
|
| 69 |
method: "POST",
|
| 70 |
headers: {
|
| 71 |
+
"Content-Type": "application/json"
|
|
|
|
| 72 |
},
|
| 73 |
body: JSON.stringify(features)
|
| 74 |
});
|