Spaces:
Sleeping
Sleeping
Download app/index.html from Michael1306/iris-mlops-api: direct link, hf CLI and curl.
- Browser
- Download file 3.14 kB
-
https://huggingface.co/spaces/Michael1306/iris-mlops-api/resolve/main/app/index.html
- Command line
-
hf download hf://spaces/Michael1306/iris-mlops-api/app/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Michael1306/iris-mlops-api/resolve/main/app/index.html
3.14 kB
| <html lang="fr"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Iris MLOps</title> | |
| <style> | |
| :root { --bg:#f6f7f9; --card:#fff; --text:#1d2330; --muted:#5c6577; --accent:#2f6fde; --border:#dde1e8; } | |
| @media (prefers-color-scheme: dark) { | |
| :root { --bg:#11141a; --card:#1a1f28; --text:#e6e9ef; --muted:#98a1b3; --accent:#6b9cff; --border:#2c3340; } | |
| } | |
| * { box-sizing: border-box; } | |
| body { margin:0; font-family: system-ui, sans-serif; background:var(--bg); color:var(--text); } | |
| main { max-width: 560px; margin: 40px auto; padding: 0 16px; } | |
| .card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:24px; } | |
| h1 { margin:0 0 4px; font-size:1.5rem; } | |
| p { color:var(--muted); margin:0 0 20px; } | |
| .grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; } | |
| label { font-size:.85rem; color:var(--muted); display:block; margin-bottom:4px; } | |
| input { width:100%; padding:10px; border:1px solid var(--border); border-radius:8px; background:var(--bg); color:var(--text); font-size:1rem; } | |
| button { margin-top:16px; width:100%; padding:12px; border:0; border-radius:8px; background:var(--accent); color:#fff; font-size:1rem; cursor:pointer; } | |
| #result { margin-top:20px; font-size:1.1rem; } | |
| .links { margin-top:16px; font-size:.9rem; } | |
| a { color:var(--accent); } | |
| </style> | |
| </head> | |
| <body> | |
| <main> | |
| <div class="card"> | |
| <h1>Classification d'Iris</h1> | |
| <p>Modèle scikit-learn servi par FastAPI, déployé via GitHub Actions + Docker sur Hugging Face Spaces.</p> | |
| <form id="f"> | |
| <div class="grid"> | |
| <div><label>Longueur sépale (cm)</label><input name="sepal_length" type="number" step="0.1" value="5.1" required></div> | |
| <div><label>Largeur sépale (cm)</label><input name="sepal_width" type="number" step="0.1" value="3.5" required></div> | |
| <div><label>Longueur pétale (cm)</label><input name="petal_length" type="number" step="0.1" value="1.4" required></div> | |
| <div><label>Largeur pétale (cm)</label><input name="petal_width" type="number" step="0.1" value="0.2" required></div> | |
| </div> | |
| <button type="submit">Prédire</button> | |
| </form> | |
| <div id="result"></div> | |
| <div class="links"><a href="gradio/">Interface Gradio</a> · <a href="docs">Documentation API (Swagger)</a> · <a href="health">Health check</a></div> | |
| </div> | |
| </main> | |
| <script> | |
| document.getElementById("f").addEventListener("submit", async (e) => { | |
| e.preventDefault(); | |
| const body = Object.fromEntries([...new FormData(e.target)].map(([k, v]) => [k, parseFloat(v)])); | |
| const res = await fetch("predict", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body) }); | |
| const out = document.getElementById("result"); | |
| if (!res.ok) { out.textContent = "Erreur : valeurs invalides"; return; } | |
| const data = await res.json(); | |
| const probs = Object.entries(data.probabilities).map(([k, v]) => `${k} ${(v * 100).toFixed(1)}%`).join(" · "); | |
| out.innerHTML = `<strong>${data.class_name}</strong><br><small>${probs}</small>`; | |
| }); | |
| </script> | |
| </body> | |
| </html> | |