Manofem commited on
Commit
3d12567
·
verified ·
1 Parent(s): a18f29a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -1,13 +1,9 @@
 
1
  import gradio as gr
2
 
 
 
 
 
3
 
4
- def my_streaming_function(input_text):
5
- for i in range(5):
6
- yield f"Processing step {i+1}: {input_text}"
7
- time.sleep(1) # Simulate processing time
8
-
9
- gr.Interface(
10
- my_streaming_function,
11
- gr.Textbox(lines=2, label="Input text"),
12
- gr.Textbox(streaming=True, label="Streaming output"),
13
- )
 
1
+ import time
2
  import gradio as gr
3
 
4
+ def test(message):
5
+ for i in range(len(message)):
6
+ time.sleep(0.3)
7
+ yield message[: i + 1]
8
 
9
+ gr.Interface(test, "textbox", "textbox").