MCPcopy Create free account
hub / github.com/Tele-AI/Telechat / end

Method end

models/12B-V2/generation_utils.py:123–130  ·  view source on GitHub ↗

Flushes any remaining cache and prints a newline to stdout.

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

on_finalized_textMethod · 0.95
clear_cacheMethod · 0.95

Tested by

no test coverage detected