Trabis commited on
Commit
46d3c09
·
verified ·
1 Parent(s): 2b4d2dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -436,13 +436,9 @@ with gr.Blocks(css=custom_css) as iface:
436
  # yield response
437
 
438
  def stream_response(question):
439
- previous_words = []
440
  for chunk_response, _ in process_question(question):
441
- current_words = chunk_response.split()
442
- if len(current_words) > len(previous_words):
443
- yield chunk_response
444
- previous_words = current_words
445
- time.sleep(0.05)
446
 
447
  submit_btn.click(
448
  fn=stream_response,
 
436
  # yield response
437
 
438
  def stream_response(question):
 
439
  for chunk_response, _ in process_question(question):
440
+ yield chunk_response
441
+ time.sleep(0.05)
 
 
 
442
 
443
  submit_btn.click(
444
  fn=stream_response,