File size: 1,045 Bytes
cdb2eb0
a0c69c3
 
cdb2eb0
 
53ce61e
cdb2eb0
 
 
 
 
 
a0c69c3
cdb2eb0
 
 
ff2309c
cdb2eb0
a0c69c3
 
53ce61e
cdb2eb0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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  Viateur y'Ubuvuzi bw'Ibimenyetso",
                     description="Andika ibimenyetso ufite (nko: umutwe, umuriro, gukorora...) maze AI iguhe inama y’ibanze.")

iface.launch()