zhangjf commited on
Commit
f735cdc
1 Parent(s): ca26f27

show latest instead of oldest

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -132,7 +132,7 @@ def showcase(access_key):
132
  if not access_key==os.getenv('access_key'):
133
  chatbot_ret = [(f"Your entered Access Key:<br>{access_key}<br>is incorrect.", f"So i cannot provide you any information in this private space.")]
134
  else:
135
- recent_qas = qas[:10]
136
  chatbot_ret = [(f"Your entered Access Key is correct.", f"The latest {len(recent_qas)} query-responses are displayed below.")]
137
  for qa in recent_qas:
138
  chatbot_ret += [(qa["q"].replace("\n","<br>"), str(qa["a"]).replace("\n","<br>"))]
 
132
  if not access_key==os.getenv('access_key'):
133
  chatbot_ret = [(f"Your entered Access Key:<br>{access_key}<br>is incorrect.", f"So i cannot provide you any information in this private space.")]
134
  else:
135
+ recent_qas = qas[-10:]
136
  chatbot_ret = [(f"Your entered Access Key is correct.", f"The latest {len(recent_qas)} query-responses are displayed below.")]
137
  for qa in recent_qas:
138
  chatbot_ret += [(qa["q"].replace("\n","<br>"), str(qa["a"]).replace("\n","<br>"))]