Put the text tuple in the queue.
(self, text: str, stream_end: bool = False)
| 137 | self.next_tokens_are_prompt = True |
| 138 | |
| 139 | def on_finalized_text(self, text: str, stream_end: bool = False): |
| 140 | """Put the text tuple in the queue.""" |
| 141 | self.history.update({"role": "bot", "content": self.text_until, "input_ids": self.token_until, |
| 142 | "attention_mask": [1] * len(self.token_until)}) |
| 143 | self.text_queue.put((text, self.history), timeout=self.timeout) |
| 144 | if stream_end: |
| 145 | self.text_queue.put((self.stop_signal, self.history), timeout=self.timeout) |
| 146 | |
| 147 | @staticmethod |
| 148 | def _is_printable(cp): |