I want to perform expensive computation and I see the documentation so it would be like this but failed every time I change variable
NameError: name ‘topics_coords’ is not defined
@st.cache_data
def topicord():
topics_coords = tmp.prepare_coords(model)
return topics_coords
what I want is when I change the variable with st.selectbox, the computation above doesn’t need to be done and I only need to retrieve the topics_coords data, now every time I change the variable the calculation starts from the beginning so the processing time becomes long