File size: 333 Bytes
fee252b
 
 
d031c18
 
 
 
b6e8d74
d031c18
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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"),
)