Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import requests
|
3 |
+
|
4 |
+
API_URL = "https://curly-space-waffle-x7g59v6qg7vcp6g9-8000.app.github.dev/predict"
|
5 |
+
|
6 |
+
def predict_symptoms(symptoms):
|
7 |
+
response = requests.post(API_URL, json={"symptoms": symptoms})
|
8 |
+
return response.json().get("prediction", "Error: Could not fetch prediction.")
|
9 |
+
|
10 |
+
iface = gr.Interface(
|
11 |
+
fn=predict_symptoms,
|
12 |
+
inputs=gr.Textbox(placeholder="Enter symptoms..."),
|
13 |
+
outputs="text",
|
14 |
+
title="AI-Powered Symptom Checker",
|
15 |
+
description="Enter your symptoms and get possible conditions based on AI predictions."
|
16 |
+
)
|
17 |
+
|
18 |
+
if __name__ == "__main__":
|
19 |
+
iface.launch()
|