I noticed when slider value changed whole code is reloaded. though most of code has nothing do with slider value.
import streamlit as st import tempfile uploaded_file = st.file_uploader("Upload Files",accept_multiple_files=False,type=['mp4'])#upload file if uploaded_file is not None:#check if file is present tfile = tempfile.NamedTemporaryFile(delete=False) tfile.write(uploaded_file.read()) print("file is present") d=st.slider('Select threshold', min_value=5 , max_value=15 , value=10 , step=2 ) st.write(d)
If I change the value of the slider it prints
file is present in console again, which mean if there is heavy calculations instead of