Reset the model state.
(self)
| 647 | self._seed = seed |
| 648 | |
| 649 | def reset(self): |
| 650 | """Reset the model state.""" |
| 651 | self.n_tokens = 0 |
| 652 | self._requires_eval = True |
| 653 | |
| 654 | if self._is_recurrent or self._is_hybrid: |
| 655 | mem = llama_cpp.llama_get_memory(self._ctx.ctx) |
| 656 | if mem is not None: |
| 657 | llama_cpp.llama_memory_clear(mem, True) |
| 658 | |
| 659 | def eval(self, tokens: Sequence[int]): |
| 660 | """Evaluate a list of tokens. |
no outgoing calls