Spaces:
Sleeping
Sleeping
| 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() |