LightningIRAdapterMixin

class lightning_ir.base.adapter.LightningIRAdapterMixin(*args, **kwargs)[source]

Bases: object

Mixin class that adds LoRA adapter functionality to Lightning IR models.

__init__(*args, **kwargs)[source]

Methods

__init__(*args, **kwargs)

disable_adapters()

Disable LoRA adapters.

enable_adapters()

(Re-)Enable LoRA adapters.

init_adapters(adapter_config)

Enable LoRA adapters on the model.

disable_adapters() None[source]

Disable LoRA adapters.

enable_adapters() None[source]

(Re-)Enable LoRA adapters.

init_adapters(adapter_config: LoraConfig) None[source]

Enable LoRA adapters on the model.

Parameters:

adapter_config – Configuration for the LoRA adapter.

Raises:
  • ImportError – If PEFT is not available.

  • ValueError – If adapters are already enabled.