zac commited on
Commit
2bde560
·
1 Parent(s): 428c8e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -23,11 +23,10 @@ def generate_text(input_text, history):
23
  output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], stream=True)
24
  for out in output:
25
  stream = copy.deepcopy(out)
26
- print(stream["choices"][0]["text"])
 
27
  history =["init",input_text_with_history]
28
- for i in range(len(output)):
29
- time.sleep(0.3)
30
- yield "You typed: " + output[: i+1]
31
 
32
 
33
  demo = gr.ChatInterface(generate_text)
 
23
  output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], stream=True)
24
  for out in output:
25
  stream = copy.deepcopy(out)
26
+ print(stream["choices"][0]["text"])
27
+ yield stream["choices"][0]["text"]
28
  history =["init",input_text_with_history]
29
+
 
 
30
 
31
 
32
  demo = gr.ChatInterface(generate_text)