Braddy commited on
Commit
e9ba98e
1 Parent(s): 108db88

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -10
app.py CHANGED
@@ -48,17 +48,12 @@ def add_text(history, text):
48
 
49
  def bot(history):
50
  print(history)
51
- response = infer(history[-1][0])
52
- history[-1][1] = response
53
 
54
- return history
55
-
56
-
57
- def infer(question):
58
-
59
- result = chain.run(text=question).strip()
60
- print(result)
61
- return result
62
 
63
 
64
  css = """
 
48
 
49
  def bot(history):
50
  print(history)
51
+ history[-1][1] = ""
52
+ user_message = history[-1][0]
53
 
54
+ for chunk in chain.stream({"text": user_message}):
55
+ history[-1][1] += chunk
56
+ yield history
 
 
 
 
 
57
 
58
 
59
  css = """