Shruti9756 commited on
Commit
866cefe
Β·
verified Β·
1 Parent(s): cdf9519

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -22,14 +22,11 @@ def handle_feedback(feedback_data, feedback_file):
22
  # Save the dataframe to the feedback CSV file
23
  feedback_df.to_csv(feedback_file, mode='a', index=False, header=not st.session_state.feedback_csv_exists)
24
 
25
- # Display a feedback collected message
26
- st.success("Feedback collected successfully!")
 
27
 
28
- # Display a download button for the user
29
- download_button = st.button("Download Feedback CSV")
30
-
31
- # If the download button is clicked, initiate the download
32
- if download_button:
33
  st.markdown(get_binary_file_downloader_html(feedback_file, 'Feedback Data'), unsafe_allow_html=True)
34
 
35
  # Function to create a download link for a binary file
 
22
  # Save the dataframe to the feedback CSV file
23
  feedback_df.to_csv(feedback_file, mode='a', index=False, header=not st.session_state.feedback_csv_exists)
24
 
25
+ # Display a feedback collected message only if thumbs up or thumbs down is clicked
26
+ if 'πŸ‘' in feedback_df['πŸ‘'].values or 'πŸ‘Ž' in feedback_df['πŸ‘Ž'].values:
27
+ st.success("Feedback collected successfully!")
28
 
29
+ # Display a download button for the user
 
 
 
 
30
  st.markdown(get_binary_file_downloader_html(feedback_file, 'Feedback Data'), unsafe_allow_html=True)
31
 
32
  # Function to create a download link for a binary file