Open KeJunMao opened 16 hours ago
I'm using gr.Timer for loading now, is this reliable?
@gr.render(inputs=[input])
def render(input):
desc = gr.Markdown("# loading...")
timer = gr.Timer(0.1)
def update_desc():
# mock long time job
time.sleep(5)
return '# Success!', gr.Timer(active=False)
timer.tick(fn=update_desc, inputs=[], outputs=[desc, timer])
If I understand @KeJunMao, this is similar to: https://github.com/gradio-app/gradio/issues/3714, right?
I agree btw, cc @aliabid94
Is your feature request related to a problem? Please describe.
Currently, when using
gr.render()
for dynamic rendering, there is no support for custom loading UI. The default loading indicator does not meet specific design needs and may not align with the overall UI style, which can impact the user experience, especially in more complex applications.Describe the solution you'd like
I would like
gr.render()
to support custom loading UIs. This would allow users to implement a loading indicator or animation that fits their design, instead of being limited to the default one.Additional context
For example, it would be helpful if we could pass a custom component or loading animation as an argument when calling
gr.render()
, which would replace the default loading state display. This would greatly enhance flexibility for developers and improve UI consistency.