mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-30 11:00:11 +08:00
79c8156ebb
* changes * add changeset * changes * changes * changes * Update client/python/test/conftest.py Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * changes * changes * changes --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
18 lines
423 B
Python
18 lines
423 B
Python
import gradio as gr
|
|
import time
|
|
|
|
def slowly_reverse(word, progress=gr.Progress()):
|
|
progress(0, desc="Starting")
|
|
time.sleep(1)
|
|
progress(0.05)
|
|
new_string = ""
|
|
for letter in progress.tqdm(word, desc="Reversing"):
|
|
time.sleep(0.25)
|
|
new_string = letter + new_string
|
|
return new_string
|
|
|
|
demo = gr.Interface(slowly_reverse, gr.Text(), gr.Text())
|
|
|
|
if __name__ == "__main__":
|
|
demo.launch()
|