add return at end of streaming
Browse files- app_modules/qa_chain.py +2 -0
app_modules/qa_chain.py
CHANGED
|
@@ -50,6 +50,8 @@ class TextIteratorStreamer(TextStreamer, StreamingStdOutCallbackHandler):
|
|
| 50 |
"""Put the new text in the queue. If the stream is ending, also put a stop signal in the queue."""
|
| 51 |
self.text_queue.put(text, timeout=self.timeout)
|
| 52 |
if stream_end:
|
|
|
|
|
|
|
| 53 |
self.text_queue.put(self.stop_signal, timeout=self.timeout)
|
| 54 |
|
| 55 |
def on_llm_new_token(self, token: str, **kwargs: Any) -> None:
|
|
|
|
| 50 |
"""Put the new text in the queue. If the stream is ending, also put a stop signal in the queue."""
|
| 51 |
self.text_queue.put(text, timeout=self.timeout)
|
| 52 |
if stream_end:
|
| 53 |
+
print("\n")
|
| 54 |
+
self.text_queue.put("\n", timeout=self.timeout)
|
| 55 |
self.text_queue.put(self.stop_signal, timeout=self.timeout)
|
| 56 |
|
| 57 |
def on_llm_new_token(self, token: str, **kwargs: Any) -> None:
|