For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python class
AudioGenerationPipeline
AudioGenerationPipeline
class max.pipelines.audio.AudioGenerationPipeline(pipeline_config, pipeline_model)
Bases: Pipeline[AudioGenerationInputs[AudioGenerationContextType], GenerationOutput], Generic[AudioGenerationContextType]
Audio generation pipeline, driven by an AudioExecutor.
Unlike text generation, one request is one call: the executor runs every stage the model has – autoregressive, denoising, vocoding – and returns a finished waveform. The pipeline’s own job is only to hand the batch to the executor and turn its samples into a response.
-
Parameters:
-
- pipeline_config (PipelineConfig) – Configuration for the pipeline and runtime behavior.
- pipeline_model (type[AudioExecutor[Any, Any, Any]]) – The audio executor class to instantiate.
execute()
execute(inputs)
Generates one waveform per request in the batch.
-
Parameters:
-
inputs (AudioGenerationInputs[AudioGenerationContextType])
-
Return type:
max_batch_size
property max_batch_size: int
audio generation runs one request at a time.
-
Type:
-
Returns 1
pipeline_config
property pipeline_config: PipelineConfig
Returns the pipeline configuration.
prepare_batch()
prepare_batch(batch)
Delegates input preparation to the executor.
-
Parameters:
-
batch (dict[RequestID, AudioGenerationContextType]) – Maps each request ID to its
AudioContext. -
Returns:
-
The executor’s inputs, and the batch flattened to
(request_id, context)pairs in the order the executor sees them, which is the order its waveforms come back in. -
Raises:
-
ValueError – If the batch holds more than one request.
-
Return type:
-
tuple[Any, list[tuple[RequestID, AudioGenerationContextType]]]
release()
release(request_id)
Releases resources held for a request.
Nothing to do: an audio request holds no state between calls, since
each one is generated in a single execute().
-
Parameters:
-
request_id (RequestID)
-
Return type:
-
None