Commit
·
35aa65d
1
Parent(s):
b3118c8
remove undo behavior
Browse files- app/app.py +0 -18
app/app.py
CHANGED
@@ -215,18 +215,6 @@ def wrangle_edit_data(
|
|
215 |
return history
|
216 |
|
217 |
|
218 |
-
def wrangle_undo_data(
|
219 |
-
x: gr.UndoData, history: list, dataframe: DataFrame, session_id: str
|
220 |
-
) -> list:
|
221 |
-
"""Undo the last turn and add negative feedback on the original message
|
222 |
-
|
223 |
-
Return the history without the last turn"""
|
224 |
-
add_fake_like_data(history, session_id)
|
225 |
-
# Return the history without the last turn
|
226 |
-
history = history[:-2]
|
227 |
-
return history, update_dataframe(dataframe, history)
|
228 |
-
|
229 |
-
|
230 |
def wrangle_retry_data(
|
231 |
x: gr.RetryData, history: list, dataframe: DataFrame, session_id: str
|
232 |
) -> list:
|
@@ -332,12 +320,6 @@ with gr.Blocks(css=css) as demo:
|
|
332 |
outputs=[chatbot],
|
333 |
).then(update_dataframe, inputs=[dataframe, chatbot], outputs=[dataframe])
|
334 |
|
335 |
-
chatbot.undo(
|
336 |
-
fn=wrangle_undo_data,
|
337 |
-
inputs=[chatbot, dataframe, session_id],
|
338 |
-
outputs=[chatbot, dataframe],
|
339 |
-
)
|
340 |
-
|
341 |
submit_btn.click(
|
342 |
fn=submit_conversation,
|
343 |
inputs=[dataframe, session_id],
|
|
|
215 |
return history
|
216 |
|
217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
def wrangle_retry_data(
|
219 |
x: gr.RetryData, history: list, dataframe: DataFrame, session_id: str
|
220 |
) -> list:
|
|
|
320 |
outputs=[chatbot],
|
321 |
).then(update_dataframe, inputs=[dataframe, chatbot], outputs=[dataframe])
|
322 |
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
submit_btn.click(
|
324 |
fn=submit_conversation,
|
325 |
inputs=[dataframe, session_id],
|