File size: 385 Bytes
798cbb7 38551fd 798cbb7 38551fd 798cbb7 38551fd 3dc9ae5 798cbb7 38551fd 3dc9ae5 798cbb7 38551fd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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() |