xj commited on
Commit
87cd0d0
·
1 Parent(s): f4d598d

fix: 修复undo按钮的bug

Browse files
Files changed (1) hide show
  1. gradio_app.py +2 -0
gradio_app.py CHANGED
@@ -97,6 +97,8 @@ def get_gradio_demo(model, tokenizer, image_processor) -> gr.Interface:
97
  history: list[tuple[str, str]]) -> tuple[list[tuple[str, str]], str]:
98
  try:
99
  message, _ = history.pop()
 
 
100
  except IndexError:
101
  message = ''
102
  return history, message or ''
 
97
  history: list[tuple[str, str]]) -> tuple[list[tuple[str, str]], str]:
98
  try:
99
  message, _ = history.pop()
100
+ if not isinstance(message, str):
101
+ message, _ = history.pop()
102
  except IndexError:
103
  message = ''
104
  return history, message or ''