App refreshes when processing a model output (>10 mins)

Hi,

I have an app hosted on steamlit cloud that uses an inference API (huggingface) to write predictions to a dataframe. I have noticed that sometimes, after a few minutes (10 mins) the app refreshes before the inferencing is done. No widgets or anything are touched. The logs don’t indicate anything and the app hasn’t crashed. It just refreshes to the app’s original state. The loaded file is about 1.5 mb.

I though it might have been a browser issue which can occur if the streamlit is not the active tab, but in this case it is the active tab.

What might be the cause of this? Has anything like this happened to anyone before?

Thanks for your help.

I asked a similar question the other day

Does streamlit has a maximum run time for functions?

The reason for that is that streamlit uses a web socket for your app. This web socket has a maximum run time and stops your functions after around 10-15 mins.

Thanks for this link - appreciate it