Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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
|
115 |
-
|
|
|
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()
|