| import gradio as gr | |
| import time | |
| def generate(): | |
| text = "Hello, this is a demo without using streaming that emulates a model" | |
| time.sleep(2.4) | |
| return text | |
| with gr.Blocks() as demo: | |
| btn = gr.Button("Generate") | |
| out = gr.Textbox() | |
| btn.click(fn=generate, outputs=out) | |
| demo.launch(debug=True) |