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