Spaces:
Build error
Build error
| import gradio as gr | |
| from transformers import pipeline | |
| # Charger le modèle préexistant | |
| chatbot = pipeline("conversational", model="microsoft/DialoGPT-medium") | |
| # Fonction qui gère la réponse du chatbot | |
| def chatbot_response(message): | |
| response = chatbot(message) | |
| return response[0]['generated_text'] | |
| # Interface Gradio | |
| iface = gr.Interface(fn=chatbot_response, inputs="text", outputs="text") | |
| iface.launch() | |