Tonic commited on
Commit
8b67f67
·
1 Parent(s): 66499ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -116,7 +116,13 @@ def _launch_demo(args, model, tokenizer):
116
  query = {'text': chat_query}
117
  history_cp = copy.deepcopy(task_history)
118
  full_response = ""
119
- history = process_history_for_model(history_cp)
 
 
 
 
 
 
120
  response, history = model.chat(tokenizer, query=query, history=history)
121
  image = tokenizer.draw_bbox_on_latest_picture(response, history)
122
  if image is not None:
 
116
  query = {'text': chat_query}
117
  history_cp = copy.deepcopy(task_history)
118
  full_response = ""
119
+ processed_history = []
120
+ for item in task_history:
121
+ if isinstance(item, tuple) and len(item) == 2:
122
+ processed_history.append(item)
123
+ else:
124
+ print("Invalid history item:", item)
125
+ history = process_history_for_model(processed_history)
126
  response, history = model.chat(tokenizer, query=query, history=history)
127
  image = tokenizer.draw_bbox_on_latest_picture(response, history)
128
  if image is not None: