Python class
GenerateMixin
GenerateMixin
class max.pipelines.GenerateMixin(*args, **kwargs)
Bases: Protocol[TextGenerationContextType, RequestType]
Protocol for pipelines that support text generation.
execute()
execute(inputs)
Executes the pipeline for the given inputs.
-
Parameters:
-
inputs (TextGenerationInputs[TextGenerationContextType])
-
Return type:
generate()
generate(prompts)
Generates outputs for the given prompts.
-
Parameters:
-
prompts (RequestType | list[RequestType])
-
Return type:
generate_async()
async generate_async(prompts)
Generates outputs asynchronously for the given prompts.
kv_manager
property kv_manager: PagedKVCacheManager
Returns the KV cache managers for this pipeline.
pipeline_config
property pipeline_config: PipelineConfig
Returns the pipeline configuration.
release()
release(request_id)
Releases resources for the given request.
-
Parameters:
-
request_id (RequestID)
-
Return type:
-
None
tokenizer
property tokenizer: PipelineTokenizer[TextGenerationContextType, ndarray[tuple[Any, ...], dtype[integer[Any]]], RequestType]
Returns the tokenizer for this pipeline.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!