TorchDenseIndexConfig

class lightning_ir.retrieve.pytorch.dense_indexer.TorchDenseIndexConfig[source]

Bases: IndexConfig

Configuration for the TorchDenseIndexer.

__init__()

Methods

Attributes

SUPPORTED_MODELS

classmethod from_pretrained(index_dir: Path | str) IndexConfig

Load the index configuration from a directory.

Parameters:

index_dir (Path | str) – Path to the directory containing the index configuration.

Returns:

An instance of the index configuration class.

Return type:

IndexConfig

Raises:

ValueError – If the index type in the configuration does not match the expected class name.

indexer_class

alias of TorchDenseIndexer

save(index_dir: Path) None

Save the index configuration to a directory.

Parameters:

index_dir (Path) – The directory to save the index configuration.

to_dict() dict

Convert the index configuration to a dictionary.

Returns:

A dictionary representation of the index configuration.

Return type:

dict