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
EncoderPipelineModel
EncoderPipelineModel
class max.pipelines.lib.registration_encoder.EncoderPipelineModel(pipeline_config, session, devices, kv_cache_config, weights, adapter=None, return_logits=ReturnLogits.ALL, *, memory_plan, max_batch_size=1)
Bases: PipelineModel[TextContext, Any, Model]
Serves a registered ENCODER module.
encoder_pipeline_model() subclasses
GraphApiEncoderPipelineModel or
ModuleV3EncoderPipelineModel for each registration. It keeps no
KV cache, and returns the embeddings as the outputs’ logits.
Builds, compiles and initializes the encoder graph.
-
Parameters:
-
- pipeline_config (PipelineConfig)
- session (InferenceSession)
- devices (list[Device])
- kv_cache_config (KVCacheConfig)
- weights (Weights)
- adapter (WeightsAdapter | None)
- return_logits (ReturnLogits)
- memory_plan (MemoryPlan)
- max_batch_size (int)
encoder_cls
The registered ENCODER class.
execute()
execute(model_inputs)
Runs the encoder on the prepared batch.
-
Parameters:
-
model_inputs (ModelInputs)
-
Return type:
model
property model: Model
The compiled and initialized encoder.