kaleidoskop-hug commited on
Commit
a93d19b
·
verified ·
1 Parent(s): 36e13a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -64,20 +64,18 @@ st.sidebar.button('Reset Chat', on_click=reset_conversation) #Reset button
64
  st.sidebar.write(f"You're now chatting with **{selected_model}**")
65
  st.sidebar.markdown("*Generated content may be inaccurate or false.*")
66
 
67
- @st.dialog("Edit Message")
68
- def edit_text(text):
69
- returnText = st.text_area("message:", value = text)
70
  if st.button("Submit"):
71
  return returnText
72
  if st.button("Cancel"):
73
  return ""
74
 
 
75
  def edit_message(position):
76
- st.toast("try to edit message no: " + str(position-1))
77
- text = edit_text(st.session_state.messages[position-1]["content"])
78
- #text = message["content"]
79
- st.toast("result: " + text)
80
- st.session_state.messages[position-1]["content"] = text
81
  st.rerun()
82
 
83
 
 
64
  st.sidebar.write(f"You're now chatting with **{selected_model}**")
65
  st.sidebar.markdown("*Generated content may be inaccurate or false.*")
66
 
 
 
 
67
  if st.button("Submit"):
68
  return returnText
69
  if st.button("Cancel"):
70
  return ""
71
 
72
+ @st.dialog("Edit Message")
73
  def edit_message(position):
74
+ returnText = st.text_area("message:", value = st.session_state.messages[position-1]["content"])
75
+ if st.button("Submit"):
76
+ st.session_state.messages[position-1]["content"] = returnText
77
+ if st.button("Cancel"):
78
+ pass
79
  st.rerun()
80
 
81