def disable():
#st.sidebar.title('File Upload and Processing')
st.session_state.disabled = True
def main():
#keys and uploads are active
if 'disabled' not in st.session_state:
st.session_state.disabled = False
if 'clicked_pred'not in st.session_state:
st.session_state.clicked_pred = False
with st.sidebar:
st.write('### Upload :orange Mammogram image/images')
files = st.file_uploader("Upload a file", key='file_upload_widget' , accept_multiple_files= True ,
type = ['dicom' , 'dcm' , 'zip' ] , disabled = st.session_state.disabled)
keys = st.button(f"### :green[Run Detector]" , help = 'Run Model prediction on Image' , use_container_width=True ,
on_click=disable() ,disabled = st.session_state.clicked_pred )
for file in files:
process......
if keys:
#I should shut download button and keys button after this line
output.........
what is happening here is weired, 1st the upload button starts the session with disabled state = True
2nd the keys button get disabled after clicked twice not once??
for your kind advice.
thanks