MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / sample

Method sample

examples/server/server.py:10338–10339  ·  view source on GitHub ↗
(self, ctx: llama_cpp.llama_context_p, output_index: int)

Source from the content-addressed store, hash-verified

10336 )
10337
10338 def sample(self, ctx: llama_cpp.llama_context_p, output_index: int) -> int:
10339 return int(llama_cpp.llama_sampler_sample(self._sampler, ctx, output_index))
10340
10341 def _ensure_sample_logits_buffer(self, size: int) -> None:
10342 if size == self._sample_logits_size and self._sample_logits_recarray is not None:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected