Lech-Iyoko commited on
Commit
88009c2
·
verified ·
1 Parent(s): de8153c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
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()