cuxtest / app.py
habi01's picture
Update app.py
3dc9ae5 verified
raw
history blame contribute delete
385 Bytes
import gradio as gr
from transformers import pipeline
chatbot = pipeline('text-generation', model='gpt2')
def respond(message, history):
response = chatbot(message, max_length=50)[0]['generated_text']
return response
demo = gr.ChatInterface(
fn=respond,
title="AI Chatbot",
examples=["What is AI?", "Tell me a joke", "Explain quantum computing"]
)
demo.launch()