|
import gradio as gr |
|
from transformers import pipeline ,Conversation |
|
|
|
def talk_together(message, history): |
|
chatbot=pipeline(model="facebook/blenderbot-400M-distill") |
|
conversation = chatbot(message) |
|
|
|
return conversation[0]['generated_text'] |
|
|
|
talk_chatbot = gr.ChatInterface(talk_together, title="MY TALKACTIVE FRIEND" ,chatbot=gr.Chatbot(height=300), |
|
textbox=gr.Textbox(placeholder="Ask me anything you want in english", container=False, scale=7), |
|
|
|
description="Let's Talk Together my Friend", |
|
theme="soft", |
|
examples=["Hello", "Am I cool?", "Are tomatoes vegetables?"], |
|
cache_examples=True, |
|
retry_btn=None, |
|
undo_btn="Delete Previous", |
|
clear_btn="Clear",) |
|
|
|
talk_chatbot.launch() |