oneone / app.py
VIATEUR-AI's picture
Update app.py
486ee58 verified
raw
history blame contribute delete
682 Bytes
import gradio as gr
from transformers import pipeline
# Shyiramo model ya chatbot
chatbot = pipeline("conversational", model="microsoft/DialoGPT-medium")
def ai_chatbot(user_input):
# Gukora conversation object
from transformers import Conversation
conv = Conversation(user_input)
result = chatbot(conv)
return result.generated_responses[-1] # Subiza response ya AI
# Gushyiraho interface
iface = gr.Interface(
fn=ai_chatbot,
inputs=gr.Textbox(label="Andika ubutumwa bwawe hano"),
outputs=gr.Textbox(label="Chatbot igusubiza"),
title="AI Chatbot",
description="Interactive AI chatbot ikoresha Hugging Face Transformers."
)
iface.launch()