nemo_automodel.recipes.retrieval.mining_encoder
nemo_automodel.recipes.retrieval.mining_encoder
Checkpoint inference adapters for the hard-negative mining recipe.
Module Contents
Classes
Functions
Data
API
Encode mining queries and documents through the checkpoint’s retrieval processor.
Whether the checkpoint normalizes embeddings.
Pooling mode used by the checkpoint.
Return finite embeddings of shape [batch, hidden] for one processor batch.
Encode corpus documents in input order with bounded processor batches.
Encode queries in input order with bounded processor batches.
Move the model to CPU and release it after embedding generation; safe to repeat.
Build mining inference using the checkpoint’s saved prompts and preprocessing.
Build an encoder using Sentence Transformers metadata or the checkpoint processor.
Parameters:
Device on which model inputs and embeddings are computed.
Local checkpoint directory or Hugging Face model ID.
Whether model loading may execute remote code.
Optional attention backend for model loading.
Returns: 'CheckpointMiningEncoder | SentenceTransformerMiningEncoder'
A configured mining encoder.
Adapt Sentence Transformers query/document inference to the mining corpus.
Encode text, image, and image-text corpus records in input order.
Encode query strings with the checkpoint’s saved prompts and sequence limits.
Move the model to CPU and release it after embedding generation; safe to repeat.
Use all available document content, normalizing absent images and blank text.