Gradio 月活用户破百万之旅!
了解更多Gradio 月活用户破百万之旅!
了解更多gradio.Progress(···)
gradio.Progress()
实例。然后可以通过调用 Progress 对象或在 Iterable 上使用 tqdm
方法在函数中更新 Progress 跟踪器。Progress 跟踪器目前仅在 queue()
中可用。import gradio as gr
import time
def my_function(x, progress=gr.Progress()):
progress(0, desc="Starting...")
time.sleep(1)
for i in progress.tqdm(range(100)):
time.sleep(0.1)
return x
gr.Interface(my_function, gr.Textbox(), gr.Textbox()).queue().launch()