Spaces:
Runtime error
Runtime error
| <html> | |
| <head> | |
| <title>EthioDocs AI</title> | |
| <style> | |
| body { font-family: sans-serif; display: flex; justify-content: center; padding: 50px; background: #f0f2f5; } | |
| .card { background: white; padding: 30px; border-radius: 12px; width: 400px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); } | |
| button { width: 100%; padding: 10px; background: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer; } | |
| #result { margin-top: 20px; font-size: 14px; color: #333; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="card"> | |
| <h2>🏥 EthioDocs</h2> | |
| <textarea id="inp" style="width:100%; height:80px;"></textarea> | |
| <button onclick="ask()">Consult AI</button> | |
| <div id="result">Waiting...</div> | |
| </div> | |
| <script> | |
| async function ask() { | |
| const out = document.getElementById('result'); | |
| const txt = document.getElementById('inp').value; | |
| out.innerText = "Thinking..."; | |
| const res = await fetch("/ask", { | |
| method: "POST", | |
| body: JSON.stringify({ inputs: txt }) | |
| }); | |
| const data = await res.json(); | |
| out.innerText = data[0].generated_text || "Error: AI is busy."; | |
| } | |
| </script> | |
| </body> | |
| </html> |