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!