Display the progress bar while a cached function is running?

Iā€™m re-uploading this post - Thought I sorted it but it still doesnā€™t work! :sweat_smile:

I would like to run the progress bar st.progress() when a cached function is running - Hereā€™s my code below:

And hereā€™s what it currently does:

ezgif.com-gif-maker (1)

As you can see, the progress bar only runs after the cache function.

Does anyone know if thereā€™s a way to improve this?

Thanks,
Charly

1 Like

If you put suppress_st_warning = True, it wonā€™t show the cache message. So the timing wonā€™t necessarily change, but from a UI perspective, it should just show your progress bar.

Thanks Randy. Better indeed :slight_smile:

Would there be any workaround (e.g. 3rd party library, uncache the function, else) to run that progress bar simultaneously?

Thanks,
Charly

I think it has to work that way, since the decorator is modifying the underlying function. So to me, that implies the cache warning has to happen before the progress bar inside.

Could be wrong though, has never come up before :slight_smile:

1 Like

Good to know Randy, thanks!

Is there a way to customize the message text in that yellow window? thanks

Is there a way to tell the bar that 100 is the maximum value and not 1?

Oh, its because it cannot handle float values.

The progress bar will either do 0 to 100 or 0 to 1.0, you just need to be consistent with the input types of your arguments:

1 Like