the following is my code:
sub_selected=‘File Uploading’
username=st.sidebar.text_input(‘Username’)
password=st.sidebar.text_input(‘Password’,type=‘password’)
if 'c01' not in st.session_state:
st.session_state.c01=False
c01_state=st.session_state.c01
c01_state=st.sidebar.checkbox('Login',value=c01_state)
if c01_state:
create_usertable()
hashed_pwsd=generated_hashes(password)
result=login_user(username,verified_hashes(password,hashed_pwsd))
if result:
c01_state=True
st.session_state.c01=True
#st.session_state.checkbox_login = True
progress_bar = st.progress(0.0)
status_text = st.empty()
#st.session_state.c01=c01_state
for i in range(100):
progress_bar.progress((i + 1) / 100)
status_text.text(f"Processing {i+1}%")
time.sleep(0.01) # Add a delay to simulate processing time
status_text.text("Processing completed!")
#st.success('Welcome {}'.format(username))
else:
st.warning('Incorrect usernmae/password')
if st.sidebar.button('Logout'):
# set login state to false and clear credentials
st.sidebar.empty()
c01_state = False
st.session_state.c01 = False
#st.session_state.checkbox_login = False
#st.sidebar.empty()
st.warning('Successfully logged out')
if c01_state:
sub_selected = option_menu(
menu_title='Machine Learning Menu',
options=['File Uploading','EDA','Model Building','Deploying models without parameters',
'Deploying models with parameters',"Comparison of Algorithm's accuracy","Comparison of Algorithm's recall-scores",
"Comparison of Algorithm's precision-scores","Comparison of Algorithm's F1-scores",
"Comparison of Algorithm's AUC-scores"],
orientation='vertical',
default_index=0,
)
if sub_selected=='File Uploading':
file_upload()
elif sub_selected=='EDA':
eda()
elif sub_selected == 'Model Building':
model_building()
elif sub_selected=='Deploying models without parameters':
deploying_models_without_parameters()
elif sub_selected=='Deploying models with parameters':
deploying_models_with_parameters()
elif sub_selected=="Comparison of Algorithm's accuracy":
accuracy()
elif sub_selected=="Comparison of Algorithm's recall-scores":
recall()
elif sub_selected=="Comparison of Algorithm's precision-scores":
precision()
elif sub_selected=="Comparison of Algorithm's F1-scores":
f1_score()
elif sub_selected=="Comparison of Algorithm's AUC-scores":
auc()
# Add a logout button
And the result of the code is below:
The functionality is working some what properly. But, when I click on logout button,
I need to clear all the widget fields into empty state.
Can anyone help me to my query?