kaxap commited on
Commit
23b16d0
1 Parent(s): c0e5a43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -59,7 +59,7 @@ with gr.Blocks() as demo:
59
  def _retrieve(message, chat_history):
60
  idx = int(message)
61
  for _, m in chat_history[::-1]:
62
- if m.startswith("results:\n"):
63
  for n in m.split("\n")[1:]:
64
  print(n)
65
  if str(idx) == n.split(".")[0]:
@@ -69,7 +69,8 @@ with gr.Blocks() as demo:
69
  chat_history.append((message, f"contents of {n}:\n{article}"))
70
  return "", chat_history
71
  print("nothing found")
72
- return chat_history.append((message, "article not found"))
 
73
 
74
  def respond(message, chat_history):
75
  print(f"received input '{message}'")
 
59
  def _retrieve(message, chat_history):
60
  idx = int(message)
61
  for _, m in chat_history[::-1]:
62
+ if m.startswith("results"):
63
  for n in m.split("\n")[1:]:
64
  print(n)
65
  if str(idx) == n.split(".")[0]:
 
69
  chat_history.append((message, f"contents of {n}:\n{article}"))
70
  return "", chat_history
71
  print("nothing found")
72
+ chat_history.append((message, "🤔 article not found"))
73
+ return "", chat_history
74
 
75
  def respond(message, chat_history):
76
  print(f"received input '{message}'")