How to use st.cache even when values in the inner function change?

So I’m using @st.cache decorator on a function that takes in one argument and later makes calls to another secondary function outside of that primary function whose input parameters are generated randomly every single time.

How can I make sure that regardless of what input parameters are sent to the second function, the first primary function gets cached and doesn’t run again? I want the primary function to be skipped so the second function isn’t even called. Turns out just using @st.cache or @st.cache_data on the primary function isn’t doing the trick :confused:

cache_data does the trick for me, I must be missing something in your description of the problem.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.