Spaces:
Sleeping
Sleeping
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() | |