Can't get st.cache() to work for me

I have an app that generates horror movie descriptions but I keep having the app run out of memory and needs to reboot. I’ve tried st.cache() and even if I solve for one issue, another shows up.

My app is here: https://share.streamlit.io/steven-shoemaker/horror-stream

I’d really like to be able to share this with people but I can’t if it is going to crash every 4 minutes.

Hi @steven-shoemaker, welcome to the Streamlit community!

What’s the measurement for “every 4 minutes”? Is it continuously pushing the generate button, multiple users…

Best,
Randy

Sorry Randy, I was just saying 4 minutes as an example. I’m not exactly sure how often I need to reboot it but it seems to go down after a few individuals generate their responses. It should only press the generate button and run the generate() function when the button is pressed.