abhi1nandy2 commited on
Commit
45b07b2
1 Parent(s): 5d46e47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -44,9 +44,11 @@ def respond(
44
  messages = [{"role": "system", "content": system_message}]
45
 
46
  for val in history:
47
- if val[0]:
 
48
  messages.append({"role": "user", "content": val[0]})
49
- if val[1]:
 
50
  messages.append({"role": "assistant", "content": val[1]})
51
 
52
  messages.append({"role": "user", "content": message})
 
44
  messages = [{"role": "system", "content": system_message}]
45
 
46
  for val in history:
47
+ # if val[0]:
48
+ if len(val)>=1:
49
  messages.append({"role": "user", "content": val[0]})
50
+ # if val[1]:
51
+ if len(val)>=2:
52
  messages.append({"role": "assistant", "content": val[1]})
53
 
54
  messages.append({"role": "user", "content": message})