MCPcopy Index your code
hub / github.com/abetlen/llama-cpp-python / reset

Method reset

llama_cpp/llama.py:649–657  ·  view source on GitHub ↗

Reset the model state.

(self)

Source from the content-addressed store, hash-verified

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.

Callers 7

generateMethod · 0.95
embedMethod · 0.95
decode_batchMethod · 0.45
__call__Method · 0.45
__call__Method · 0.45
__call__Method · 0.45

Calls

no outgoing calls

Tested by 1