Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ml-explore/mlx-examples
/ sample
Function
sample
lora/utils.py:190–195 ·
view source on GitHub ↗
(logits: mx.array)
Source
from the content-addressed store, hash-verified
188
""
"
189
190
def
sample(logits: mx.array) -> mx.array:
191
return
(
192
mx.argmax(logits, axis=-1)
193
if
temp == 0
194
else
mx.random.categorical(logits * (1 / temp))
195
)
196
197
y = prompt
198
cache = None
Callers
1
generate
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected