liyaoshi commited on
Commit
0d622e1
1 Parent(s): 3a00add

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -112,9 +112,11 @@ def get_completion(message,history):
112
 
113
  history_openai_format = []
114
  for human, assistant in history:
115
- # check if there is image info in the history message
116
- if isinstance(human, tuple):
 
117
  continue
 
118
  history_openai_format.append({"role": "user", "content": human })
119
  history_openai_format.append({"role": "assistant", "content":assistant})
120
  history_openai_format.append({"role": "user", "content": user_message})
 
112
 
113
  history_openai_format = []
114
  for human, assistant in history:
115
+ # check if there is image info in the history message or empty history messages
116
+
117
+ if isinstance(human, tuple) or human == "" or assistant is None:
118
  continue
119
+
120
  history_openai_format.append({"role": "user", "content": human })
121
  history_openai_format.append({"role": "assistant", "content":assistant})
122
  history_openai_format.append({"role": "user", "content": user_message})