Update app.py
Browse files
app.py
CHANGED
@@ -21,21 +21,21 @@
|
|
21 |
# demo.launch(share=True)
|
22 |
|
23 |
import gradio as gr
|
24 |
-
import numpy as np
|
25 |
import time
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
33 |
|
|
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
# define queue - required for generators
|
38 |
-
demo.queue()
|
39 |
|
40 |
-
demo.launch(share=True)
|
41 |
|
|
|
21 |
# demo.launch(share=True)
|
22 |
|
23 |
import gradio as gr
|
|
|
24 |
import time
|
25 |
|
26 |
+
def slowly_reverse(word, progress=gr.Progress()):
|
27 |
+
progress(0, desc="Starting")
|
28 |
+
time.sleep(1)
|
29 |
+
progress(0.05)
|
30 |
+
new_string = ""
|
31 |
+
for letter in progress.tqdm(word, desc="Reversing"):
|
32 |
+
time.sleep(0.25)
|
33 |
+
new_string = letter + new_string
|
34 |
+
return new_string
|
35 |
|
36 |
+
demo = gr.Interface(slowly_reverse, gr.Text(), gr.Text())
|
37 |
|
38 |
+
if __name__ == "__main__":
|
39 |
+
demo.queue(concurrency_count=10).launch()
|
|
|
|
|
40 |
|
|
|
41 |
|