Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -112,7 +112,14 @@ def generate(
|
|
112 |
t.start()
|
113 |
|
114 |
outputs = []
|
|
|
115 |
for text in streamer:
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
outputs.append(text)
|
117 |
yield "".join(outputs)
|
118 |
|
|
|
112 |
t.start()
|
113 |
|
114 |
outputs = []
|
115 |
+
capture = False
|
116 |
for text in streamer:
|
117 |
+
if not capture:
|
118 |
+
if "[" in text:
|
119 |
+
capture = True
|
120 |
+
text = text[text.index("["):] # Keep from first '[' onward
|
121 |
+
else:
|
122 |
+
continue # Skip until we find '['
|
123 |
outputs.append(text)
|
124 |
yield "".join(outputs)
|
125 |
|