Skip to content

SampledSequence

class mint.types.SampledSequence ()

A single sampled sequence from the model.

Provides two ways to access token data:

  • Numpy arrays ( tokens_np , logprobs_np ): As numpy arrays without format conversion.
  • Python lists ( tokens , logprobs ): Standard Python lists, converted lazily on first access.

Fields:

  • stop_reason ( StopReason ) – Reason why sampling stopped.
  • tokens_np ( Optional[np.ndarray] ) – Generated token IDs as a 1-D int32 numpy array, shape (num_tokens,) .
  • logprobs_np ( Optional[np.ndarray] ) – Log probabilities for each generated token as a 1-D float32 numpy array, shape (num_tokens,) . None if logprobs were not requested.

tokens ()

Generated token IDs as a Python list.

Converted from tokens_np on first access (cached afterwards).

Returns: List[int]

logprobs ()

Log probabilities for each generated token (optional).

None if logprobs were not requested. Converted from logprobs_np on first access (cached afterwards).

Returns: Optional[List[float]]

Referenced by

  • mint.types.SampleResponse