Create test_progress.py
Browse files- test_progress.py +11 -0
test_progress.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import time
|
| 3 |
+
|
| 4 |
+
def test_progress(progress=gr.Progress()):
|
| 5 |
+
for i in range(11):
|
| 6 |
+
progress.update(i/10, f"Step {i}/10")
|
| 7 |
+
time.sleep(0.5)
|
| 8 |
+
return "Done"
|
| 9 |
+
|
| 10 |
+
iface = gr.Interface(fn=test_progress, inputs=[], outputs="text", title="Progress Test")
|
| 11 |
+
iface.launch()
|