Spaces:
Running
Running
# Filename: app.py import gradio as gr def check_symptoms(symptoms): symptoms = symptoms.lower() if "umuriro" in symptoms and "umutwe" in symptoms and "gukorora" in symptoms: return "Waba ufite ibimenyetso bya Grippe cyangwa COVID-19. Nywa amazi, ruhuka, kandi ushobora gufata Paracetamol. Saba muganga inama yihariye." elif "kuruka" in symptoms or "guhaguruka bikakugora": return "Ibi bishobora kuba ari ikibazo cy’indwara yo mu nda cyangwa umwuka. Gerageza kunywa amazi gahoro gahoro. Saba muganga." else: return "Sinyashoboye kumenya neza indwara ishingiye ku bimenyetso wampaye. Nyamuneka saba muganga." iface = gr.Interface(fn=check_symptoms, inputs=gr.Textbox(lines=3, placeholder="Andika ibimenyetso byawe hano..."), outputs="text", title="AI y'Ubuvuzi bw'Ibimenyetso", description="Andika ibimenyetso ufite (nko: umutwe, umuriro, gukorora...) maze AI iguhe inama y’ibanze.") iface.launch()
Browse files
app.py
CHANGED
@@ -1,28 +1,22 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
-
from PIL import Image
|
3 |
-
import random
|
4 |
|
5 |
-
def
|
6 |
-
|
7 |
-
findings = [
|
8 |
-
"Nta bimenyetso by'indwara byabonetse.",
|
9 |
-
"Habonetse tumor ntoya ku gice cya mbere cya scan.",
|
10 |
-
"Ibibyimba bito byabonetse, bisaba gusuzuma birambuye.",
|
11 |
-
"Hari ibisebe ku gice cyo hagati, byasaba kwitonda.",
|
12 |
-
"Scan yerekanye ibimenyetso by'umuvuduko w'amaraso mu bwonko.",
|
13 |
-
"Hari ikimenyetso cy'ibibyimba binini, jya kwa muganga byihutirwa.",
|
14 |
-
]
|
15 |
-
result = random.choice(findings) # Muri version nyayo, aha niho wakoresha AI model
|
16 |
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
iface = gr.Interface(
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
description="Shyiraho ifoto ya MRI cyangwa CT-scan, AI ikwereke ibimenyetso by'indwara hakiri kare."
|
25 |
-
)
|
26 |
|
27 |
iface.launch()
|
28 |
|
|
|
|
1 |
+
# Filename: app.py
|
2 |
import gradio as gr
|
|
|
|
|
3 |
|
4 |
+
def check_symptoms(symptoms):
|
5 |
+
symptoms = symptoms.lower()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
+
if "umuriro" in symptoms and "umutwe" in symptoms and "gukorora" in symptoms:
|
8 |
+
return "Waba ufite ibimenyetso bya Grippe cyangwa COVID-19. Nywa amazi, ruhuka, kandi ushobora gufata Paracetamol. Saba muganga inama yihariye."
|
9 |
+
elif "kuruka" in symptoms or "guhaguruka bikakugora":
|
10 |
+
return "Ibi bishobora kuba ari ikibazo cy’indwara yo mu nda cyangwa umwuka. Gerageza kunywa amazi gahoro gahoro. Saba muganga."
|
11 |
+
else:
|
12 |
+
return "Sinyashoboye kumenya neza indwara ishingiye ku bimenyetso wampaye. Nyamuneka saba muganga."
|
13 |
|
14 |
+
iface = gr.Interface(fn=check_symptoms,
|
15 |
+
inputs=gr.Textbox(lines=3, placeholder="Andika ibimenyetso byawe hano..."),
|
16 |
+
outputs="text",
|
17 |
+
title="AI y'Ubuvuzi bw'Ibimenyetso",
|
18 |
+
description="Andika ibimenyetso ufite (nko: umutwe, umuriro, gukorora...) maze AI iguhe inama y’ibanze.")
|
|
|
|
|
19 |
|
20 |
iface.launch()
|
21 |
|
22 |
+
|