Locutusque commited on
Commit
561074d
·
verified ·
1 Parent(s): 9eb4b82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -108,11 +108,12 @@ def generate_text(prompt, system_prompt, temperature, top_p, top_k, repetition_p
108
  # Start generation in a separate thread
109
  thread = Thread(target=generator, kwargs=generation_kwargs)
110
  thread.start()
111
-
112
  # Yield generated text chunks
113
  try:
114
- for new_text in streamer:
115
- yield new_text
 
116
  finally:
117
  # Ensure the thread completes
118
  thread.join()
 
108
  # Start generation in a separate thread
109
  thread = Thread(target=generator, kwargs=generation_kwargs)
110
  thread.start()
111
+ outputs = []
112
  # Yield generated text chunks
113
  try:
114
+ for chunk in streamer:
115
+ outputs.append(chunk)
116
+ yield "".join(outputs)
117
  finally:
118
  # Ensure the thread completes
119
  thread.join()