+
    UV-jÞ  ã                   ó   € ^ RI Ht R R ltR# )é    Nc                óp   € V ^8„  d   QhR\         P                  R\        R\        R\         P                  /# )é   ÚlogitsÚtop_pÚtemperatureÚreturn)ÚmxÚarrayÚfloat)Úformats   "Úe/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/mlx_vlm/sample_utils.pyÚ__annotate__r      s0   € ÷ +4ñ +4œ2Ÿ8™8ð +4¬Eð +4Äð +4Ì"Ï(É(ñ +4ó    c                óî  € V P                   ^8H  pV'       d
   V R,          p V P                  \        P                  8X  d    V P	                  \        P
                  4      p \        P                  ! W,          RR7      p\        P                  ! VRR7      p\        P                  ! WERR7      p\        P                  ! VRR7      p\        P                  ! V^V,
          8„  V\        P                  ! V4      4      p\        P                  P                  \        P                  ! V4      4      p	\        P                  ! WYR,          RR7      P                  R4      p
V'       d   V
P                  ^ 4      # T
# )aþ  
Apply top-p (nucleus) sampling to logits.

Args:
    logits: The logits from the model's output. Shape [..., vocab];
        commonly [vocab], [B, vocab], or [B, T, vocab] (e.g. MTP
        speculative verify output).
    top_p: The cumulative probability threshold for top-p filtering.
    temperature: Temperature parameter for softmax distribution reshaping.
Returns:
    token selected based on the top-p criterion. Shape matches logits
    with the trailing vocab axis removed (e.g. [], [B], or [B, T]).
N)Úaxiséÿÿÿÿ).N)ÚndimÚdtyper	   Úbfloat16ÚastypeÚfloat32ÚsoftmaxÚargsortÚtake_along_axisÚcumsumÚwhereÚ
zeros_likeÚrandomÚcategoricalÚlogÚsqueeze)r   r   r   Ú	unbatchedÚprobsÚsorted_indicesÚsorted_probsÚcumulative_probsÚ	top_probsÚsampled_posÚtokens   &&&        r   Útop_p_samplingr*      s  € ð —‘˜qÑ €IßØ˜•ˆð 	�‰œŸ™Ô#à—‘œrŸz™zÓ*ˆô �JŠJ�vÕ+°"Ô5€Eô —Z’Z ¨BÔ/€NÜ×%Ò% eÀ"ÔE€Lä—y’y °BÔ7Ðô —’Ø˜1˜u�9Ñ$ØÜ
�Š�lÓ#ó€Iô —)‘)×'Ñ'¬¯ª¨yÓ(9Ó:€KÜ×Ò˜~¸9Õ/EÈBÔO×WÑWØ
ó€E÷  )ˆ5�=‰=˜ÓÐ3¨eÐ3r   )Úmlx.coreÚcorer	   r*   © r   r   Ú<module>r.      s   ðÝ ÷+4r   