Spaces:
Running
Running
import gradio as gr | |
import time | |
# Dictionnaire de réponses préenregistrées | |
responses = { | |
"Mbolo": "Mbolo, nlem a ye dzam. Wanyinyi ?", | |
"Wa kôkh mvè ?": "Me kôkh mvè, abora.", | |
"Ma sum èsè": "Yô ! M'asumga èsè avé? Wa kôgha ?" | |
} | |
def chatbot(input_text): | |
time.sleep(3) | |
return responses.get(input_text, "Je ne comprends pas votre question.") | |
# Interface Gradio | |
iface = gr.Interface( | |
fn=chatbot, | |
inputs="text", | |
outputs="text", | |
title="Chatbot Préenregistré", | |
description="Entrez une phrase et obtenez une réponse préenregistrée." | |
) | |
# Lancer l'interface | |
if __name__ == "__main__": | |
iface.launch() |