zac commited on
Commit
f01cc65
·
1 Parent(s): cb4c476

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -24,14 +24,15 @@ def generate_text(input_text, history):
24
  print("new input", input_text_with_history)
25
  output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], stream=True)
26
  for out in output:
 
27
  stream = copy.deepcopy(out)
28
  print(stream["choices"][0]["text"])
29
- yield stream["choices"][0]["text"]
30
- print("output ", str(output))
31
- print("stream ", str(stream.object.text_completion))
32
-
33
-
34
- history =["init",str(input_text_with_history)]
35
 
36
 
37
 
 
24
  print("new input", input_text_with_history)
25
  output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], stream=True)
26
  for out in output:
27
+ history1[-1][1] = ""
28
  stream = copy.deepcopy(out)
29
  print(stream["choices"][0]["text"])
30
+ history1[-1][1] += stream["choices"][0]["text"]
31
+ time.sleep(0.05)
32
+ yield history1
33
+
34
+
35
+ history =["init",input_text_with_history]
36
 
37
 
38