rk68 commited on
Commit
771eeb4
Β·
verified Β·
1 Parent(s): e54614b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -293,13 +293,13 @@ def run_streamlit_app():
293
  col1, col2, col3 = st.columns([1, 1, 3])
294
  with col1:
295
  if st.button("πŸ‘", key=f"up_{chat_index}"):
296
- if 'feedback' not in chat:
297
  chat['feedback'] = 1
298
  st.session_state.chat_history[chat_index] = chat
299
  update_google_sheets(chat['id'], feedback=1)
300
  with col2:
301
  if st.button("πŸ‘Ž", key=f"down_{chat_index}"):
302
- if 'feedback' not in chat:
303
  chat['feedback'] = -1
304
  st.session_state.chat_history[chat_index] = chat
305
  update_google_sheets(chat['id'], feedback=-1)
 
293
  col1, col2, col3 = st.columns([1, 1, 3])
294
  with col1:
295
  if st.button("πŸ‘", key=f"up_{chat_index}"):
296
+ if chat['feedback'] == 0:
297
  chat['feedback'] = 1
298
  st.session_state.chat_history[chat_index] = chat
299
  update_google_sheets(chat['id'], feedback=1)
300
  with col2:
301
  if st.button("πŸ‘Ž", key=f"down_{chat_index}"):
302
+ if chat['feedback'] == 0:
303
  chat['feedback'] = -1
304
  st.session_state.chat_history[chat_index] = chat
305
  update_google_sheets(chat['id'], feedback=-1)