YingxuHe commited on
Commit
61e7d69
·
1 Parent(s): 3ae4433

try stream

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -54,8 +54,11 @@ def bot(history):
54
  history[-1][1] = ""
55
  user_message = history[-1][0]
56
 
57
- for chunk in chain.stream({"text": user_message}):
58
- history[-1][1] += chunk["text"]
 
 
 
59
  yield history
60
 
61
 
 
54
  history[-1][1] = ""
55
  user_message = history[-1][0]
56
 
57
+ full_input = chain.prep_inputs({"text": user_message})
58
+ prompts, stop = chain.prep_prompts([full_input], run_manager=None)
59
+
60
+ for chunk in llm._stream(prompt=prompts[0].to_string(), stop=stop, run_manager=None):
61
+ history[-1][1] += chunk.text
62
  yield history
63
 
64