layerdiffusion commited on
Commit
c62829f
1 Parent(s): 579bce7

fix some queue problems

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -120,9 +120,9 @@ def chat_fn(message: str, history: list, seed:int, temperature: float, top_p: fl
120
  conversation = [{"role": "system", "content": omost_canvas.system_prompt}]
121
 
122
  for user, assistant in history:
123
- if user is None or assistant is None:
124
- continue
125
- conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
126
 
127
  conversation.append({"role": "user", "content": message})
128
 
 
120
  conversation = [{"role": "system", "content": omost_canvas.system_prompt}]
121
 
122
  for user, assistant in history:
123
+ if isinstance(user, str) and isinstance(assistant, str):
124
+ if len(user) > 0 and len(assistant) > 0:
125
+ conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
126
 
127
  conversation.append({"role": "user", "content": message})
128