import gradio as gr import time def generate_markdown(): response = "" for word in ["Hello", "World", "Gradio", "Markdown", "!"]: response += word + " " time.sleep(0.5) yield response with gr.Blocks() as demo: markdown_output = gr.Markdown(label="回應") button = gr.Button("生成") button.click(generate_markdown, outputs=markdown_output) demo.queue() demo.launch()