Spaces:
Sleeping
Sleeping
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Medical Suggestion AI</title> | |
| <link rel="stylesheet" href="style.css"> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <h1>Medical Suggestion AI</h1> | |
| <p>Enter your symptoms below to get treatment and medicine suggestions.</p> | |
| <div class="input-section"> | |
| <label for="symptoms-input">Symptoms (e.g., fever, headache):</label> | |
| <input type="text" id="symptoms-input" placeholder="Enter symptoms separated by commas"> | |
| </div> | |
| <button id="submit-btn">Submit</button> | |
| <div class="output-section"> | |
| <h2>Suggestions</h2> | |
| <div id="output"></div> | |
| </div> | |
| </div> | |
| <script> | |
| // JavaScript to handle form submission and display output | |
| document.getElementById("submit-btn").addEventListener("click", async () => { | |
| const symptoms = document.getElementById("symptoms-input").value; | |
| if (!symptoms) { | |
| alert("Please enter symptoms!"); | |
| return; | |
| } | |
| // Call the Gradio function (suggest_treatment) via the Gradio client | |
| const response = await window.gradioAPI.fn(0, symptoms); | |
| document.getElementById("output").innerHTML = response; | |
| }); | |
| </script> | |
| </body> | |
| </html> |