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

Method on_finalized_text

models/12B/generation_utils.py:139–145  ·  view source on GitHub ↗

Put the text tuple in the queue.

(self, text: str, stream_end: bool = False)

Source from the content-addressed store, hash-verified

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):

Callers 2

putMethod · 0.95
endMethod · 0.95

Calls 2

updateMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected