IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python function

log_probabilities_ragged_graph

log_probabilities_ragged_graph()

max.pipelines.lib.log_probabilities.log_probabilities_ragged_graph(device, *, levels)

source

Create a graph to compute log probabilities over ragged inputs.

A model obtained by this graph is a required input to ‘compute_log_probabilities_ragged’.

Parameters:

  • device (DeviceRef) – The type of device this graph will need to run on.
  • levels (int) – log2(max_k+1) for the desired maximum top-k you’d like to support. To support the OpenAI API maximum of 5 logprobs, use levels=3. Higher levels can be used to support higher k.

Return type:

Graph