safwansajad's picture
Update app.py
65f2296 verified
raw
history blame contribute delete
456 Bytes
import gradio as gr
from transformers import pipeline
# Use the text generation pipeline with DialoGPT-medium
chatbot = pipeline("text-generation", model="microsoft/DialoGPT-medium")
def chat(input_text):
response = chatbot(input_text, max_length=50, num_return_sequences=1)
return response[0]['generated_text']
# Gradio Interface setup
interface = gr.Interface(fn=chat, inputs="text", outputs="text")
# Launch the interface
interface.launch()