Flushes any remaining cache and prints a newline to stdout.
(self)
| 121 | self.on_finalized_text(output_text) |
| 122 | |
| 123 | def end(self): |
| 124 | """Flushes any remaining cache and prints a newline to stdout.""" |
| 125 | # Flush the cache, if it exists |
| 126 | text = self.tokenizer.decode(self.token_until, **self.decode_kwargs) |
| 127 | output_text = text[len(self.text_until):] |
| 128 | self.text_until = text |
| 129 | self.on_finalized_text(output_text, stream_end=True) |
| 130 | self.clear_cache() |
| 131 | |
| 132 | def clear_cache(self): |
| 133 | self.cache_time = 0 |
nothing calls this directly
no test coverage detected