srjosueaaron's picture
Primer subida
a075133 verified
raw
history blame contribute delete
398 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("text2text-generation", model="facebook/blenderbot-400M-distill")
def chatbot_response(message, history):
response = pipe(message, max_length=150)[0]["generated_text"]
return response
demo = gr.ChatInterface(chatbot_response, type="messages", autofocus=False)
if __name__ == "__main__":
demo.launch()