import gradio as gr | |
def my_streaming_function(input_text): | |
for i in range(5): | |
yield f"Processing step {i+1}: {input_text}" | |
time.sleep(1) # Simulate processing time | |
gr.Interface( | |
my_streaming_function, | |
gr.Textbox(lines=2, label="Input text"), | |
gr.Textbox(streaming=True, label="Streaming output"), | |
) |