zac commited on
Commit
ef9d113
·
1 Parent(s): 5da22d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -23,7 +23,11 @@ def generate_text(input_text, history):
23
  response = output['choices'][0]['text'] + "\n"
24
  print("response", response)
25
  history =["init",input_text_with_history]
26
- yield response
 
 
 
 
27
 
28
 
29
  demo = gr.ChatInterface(generate_text)
 
23
  response = output['choices'][0]['text'] + "\n"
24
  print("response", response)
25
  history =["init",input_text_with_history]
26
+ bot_message = response
27
+ for character in bot_message:
28
+ history[-1][1] += character
29
+ time.sleep(0.05)
30
+ yield history
31
 
32
 
33
  demo = gr.ChatInterface(generate_text)