Heit39 commited on
Commit
348b668
·
verified ·
1 Parent(s): a9b548b

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -62,8 +62,10 @@ def respond(
62
  generation_thread.start()
63
 
64
  # Stream the output progressively
 
65
  for token in streamer: # Append each token to the accumulated text
66
- yield token
 
67
 
68
 
69
  """
@@ -144,7 +146,7 @@ with gr.Blocks() as demo:
144
 
145
  # Define functionality
146
  translate_button.click(
147
- respond_google_translate,
148
  inputs=[
149
  source_textbox,
150
  system_message_input,
@@ -153,6 +155,7 @@ with gr.Blocks() as demo:
153
  top_p_slider,
154
  ],
155
  outputs=translated_textbox,
 
156
  )
157
 
158
  if __name__ == "__main__":
 
62
  generation_thread.start()
63
 
64
  # Stream the output progressively
65
+ generated_text = ""
66
  for token in streamer: # Append each token to the accumulated text
67
+ generated_text += token
68
+ yield generated_text
69
 
70
 
71
  """
 
146
 
147
  # Define functionality
148
  translate_button.click(
149
+ respond,
150
  inputs=[
151
  source_textbox,
152
  system_message_input,
 
155
  top_p_slider,
156
  ],
157
  outputs=translated_textbox,
158
+ live=True
159
  )
160
 
161
  if __name__ == "__main__":