gave unique keys to all buttons
Browse files- app.py +6 -6
- pages/about.py +1 -2
- pages/scoreboard.py +2 -4
app.py
CHANGED
@@ -366,14 +366,14 @@ def main():
|
|
366 |
with col2:
|
367 |
st.markdown("### Random Audio Example")
|
368 |
with st.container():
|
369 |
-
st.button("π² Random Audio",on_click=on_random_click)
|
370 |
|
371 |
if st.session_state.has_audio:
|
372 |
st.audio(**st.session_state.audio)
|
373 |
|
374 |
|
375 |
with st.container():
|
376 |
-
st.button("π Transcribe Audio",on_click=on_click_transcribe,use_container_width=True)
|
377 |
|
378 |
text_containers = st.columns([1, 1])
|
379 |
name_containers = st.columns([1, 1])
|
@@ -395,16 +395,16 @@ def main():
|
|
395 |
c1, c2, c3, c4 = st.columns(4)
|
396 |
|
397 |
with c1:
|
398 |
-
st.button("Prefer Option 1",on_click=on_option_1_click)
|
399 |
|
400 |
with c2:
|
401 |
-
st.button("Prefer Option 2",on_click=on_option_2_click)
|
402 |
|
403 |
with c3:
|
404 |
-
st.button("Prefer Both",on_click=on_option_both_click)
|
405 |
|
406 |
with c4:
|
407 |
-
st.button("Prefer None",on_click=on_option_none_click)
|
408 |
|
409 |
create_files()
|
410 |
main()
|
|
|
366 |
with col2:
|
367 |
st.markdown("### Random Audio Example")
|
368 |
with st.container():
|
369 |
+
st.button("π² Random Audio",on_click=on_random_click,key="random_btn")
|
370 |
|
371 |
if st.session_state.has_audio:
|
372 |
st.audio(**st.session_state.audio)
|
373 |
|
374 |
|
375 |
with st.container():
|
376 |
+
st.button("π Transcribe Audio",on_click=on_click_transcribe,use_container_width=True,key="transcribe_btn")
|
377 |
|
378 |
text_containers = st.columns([1, 1])
|
379 |
name_containers = st.columns([1, 1])
|
|
|
395 |
c1, c2, c3, c4 = st.columns(4)
|
396 |
|
397 |
with c1:
|
398 |
+
st.button("Prefer Option 1",on_click=on_option_1_click,key="option1_btn")
|
399 |
|
400 |
with c2:
|
401 |
+
st.button("Prefer Option 2",on_click=on_option_2_click,key="option2_btn")
|
402 |
|
403 |
with c3:
|
404 |
+
st.button("Prefer Both",on_click=on_option_both_click,key="both_btn")
|
405 |
|
406 |
with c4:
|
407 |
+
st.button("Prefer None",on_click=on_option_none_click,key="none_btn")
|
408 |
|
409 |
create_files()
|
410 |
main()
|
pages/about.py
CHANGED
@@ -42,9 +42,8 @@ with st.form("login_form"):
|
|
42 |
|
43 |
email = st.text_input("Email")
|
44 |
|
45 |
-
submit_button = st.form_submit_button("Submit")
|
46 |
|
47 |
-
if
|
48 |
if not email:
|
49 |
st.error("Please fill in all fields")
|
50 |
else:
|
|
|
42 |
|
43 |
email = st.text_input("Email")
|
44 |
|
|
|
45 |
|
46 |
+
if st.form_submit_button("Submit",key="submit_btn_about"):
|
47 |
if not email:
|
48 |
st.error("Please fill in all fields")
|
49 |
else:
|
pages/scoreboard.py
CHANGED
@@ -204,7 +204,7 @@ def dashboard():
|
|
204 |
elo_df = pd.read_csv(f)
|
205 |
st.session_state.elo_df = elo_df
|
206 |
|
207 |
-
st.button("Refresh",on_click=on_refresh_click)
|
208 |
|
209 |
if len(st.session_state.df) != 0:
|
210 |
metrics = calculate_metrics(st.session_state.df)
|
@@ -295,9 +295,7 @@ if __name__ == "__main__":
|
|
295 |
|
296 |
email = st.text_input("Email")
|
297 |
|
298 |
-
|
299 |
-
|
300 |
-
if submit_button:
|
301 |
if not email:
|
302 |
st.error("Please fill in all fields")
|
303 |
else:
|
|
|
204 |
elo_df = pd.read_csv(f)
|
205 |
st.session_state.elo_df = elo_df
|
206 |
|
207 |
+
st.button("Refresh",on_click=on_refresh_click,key="refresh_btn")
|
208 |
|
209 |
if len(st.session_state.df) != 0:
|
210 |
metrics = calculate_metrics(st.session_state.df)
|
|
|
295 |
|
296 |
email = st.text_input("Email")
|
297 |
|
298 |
+
if st.form_submit_button("Submit",key="submit_btn_scoreboard"):
|
|
|
|
|
299 |
if not email:
|
300 |
st.error("Please fill in all fields")
|
301 |
else:
|