MCPcopy Create free account
hub / github.com/ml-explore/mlx-examples / sample

Method sample

llms/speculative_decoding/decoder.py:110–111  ·  view source on GitHub ↗
(logits)

Source from the content-addressed store, hash-verified

108 max_tokens: int = 100,
109 ):
110 def sample(logits):
111 return mx.argmax(logits, axis=-1)
112
113 prompt = mx.array(self.tokenizer.encode(prompt), mx.uint32)[None]
114 memory = self.model.encode(prompt)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected