chatbot / app.py
sarath2803's picture
Update app.py
580ef04 verified
raw
history blame contribute delete
576 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("text-generation", model="tiiuae/falcon-rw-1b")
def chat(text):
result= pipe(text)
return result
with gr.Blocks(title='Basic chatbot based on gpt2') as demo:
with gr.Row():
user_input = gr.Textbox(placeholder="Type your message here...", label="Your Message", lines=2)
with gr.Row():
output = gr.Textbox(label="Response", lines=4)
with gr.Row():
submit_btn = gr.Button("Send")
submit_btn.click(fn=chat, inputs=user_input, outputs=output)
demo.launch()