kaleidoskop-hug
commited on
Update app.py
Browse files
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.
|
77 |
-
|
78 |
-
|
79 |
-
st.
|
80 |
-
|
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 |
|