I noticed that when I store a relatively large and complicated object to session_state from a form callback then streamlit chokes and exists after a while. It doesnât doesnât show me any errors indicating whatâs gone wrong even though I have been running with --logger.level=debug. Any idea what could be going wrong?
I still donât know what to say without the specific information about your script (code snippets, GitHub links, console logs), but I do know that other people have cached models (searching for âcache modelâ will give lots of cases, and instances where Streamlit staff have very kindly inspected the cases closely to debug when it was complicated).
It was my (non-expert) understanding that caching a model would be more in line with best practice generally, but perhaps someone with a deeper understanding may be able to speak on your case of using session state for that.
Thank you so much @mathcatsand! Iâll try to put together a small project to reproduce the isse but Iâm dealing with a big codebase so itâs not easy. However, I think this could be related to https://www.ray.io/ray-core library. The object Iâm trying to save/cache instantiate a ray cluster and my guess is that that doesnât play nicely with streamlit async/await model.