Spaces:
Runtime error
Runtime error
import gradio as gr | |
from transformers import BlenderbotTokenizer, BlenderbotForConditionalGeneration | |
tokenizer = BlenderbotTokenizer.from_pretrained('facebook/blenderbot-1B-distill') | |
model = BlenderbotForConditionalGeneration.from_pretrained('facebook/blenderbot-1B-distill') | |
def func (message): | |
inputs = tokenizer(message, return_tensors='pt') | |
result = model.generate(**inputs) | |
return tokenizer.decode(result[0]) | |
app = gr.Interface(fn=func, inputs = 'textbox', outputs = 'textbox', title='Chatbot Three') | |
app.launch() |