Skip to main content

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