zac commited on
Commit
dbf3ceb
·
1 Parent(s): f42204b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -20,13 +20,12 @@ def generate_text(input_text, history):
20
  input_text_with_history = f"{history[-1][1]}"+ "\n"
21
  input_text_with_history += f"Q: {input_text} \n A:"
22
  print("new input", input_text_with_history)
23
- output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], stream=True)
24
 
25
  for out in output:
26
  stream = copy.deepcopy(out)
27
  print(stream["choices"][0]["text"])
28
- yield "You typed: " + stream["choices"][i+1]["text"]
29
- print("latest token : " ,stream["choices"][0]["text"])
30
 
31
  history =["init",input_text_with_history]
32
 
 
20
  input_text_with_history = f"{history[-1][1]}"+ "\n"
21
  input_text_with_history += f"Q: {input_text} \n A:"
22
  print("new input", input_text_with_history)
23
+ output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], stream=True, echo=true)
24
 
25
  for out in output:
26
  stream = copy.deepcopy(out)
27
  print(stream["choices"][0]["text"])
28
+ yield output
 
29
 
30
  history =["init",input_text_with_history]
31