Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
|
|
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})
|