llmcompressor.modifiers.interface
ModifierInterface
Bases: ABC
Defines the contract that all modifiers must implement
Source code in src/llmcompressor/modifiers/interface.py
finalized
abstractmethod
property
Returns:
Type | Description |
---|---|
bool | True if the modifier has been finalized |
initialized
abstractmethod
property
Returns:
Type | Description |
---|---|
bool | True if the modifier has been initialized |
finalize(state, **kwargs)
abstractmethod
Finalize the modifier
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state | State | The current state of the model | required |
kwargs | Additional keyword arguments for modifier finalization | {} |
Source code in src/llmcompressor/modifiers/interface.py
initialize(state, **kwargs)
abstractmethod
Initialize the modifier
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state | State | The current state of the model | required |
kwargs | Additional keyword arguments for modifier initialization | {} |
Source code in src/llmcompressor/modifiers/interface.py
update_event(state, event, **kwargs)
abstractmethod
Update the modifier based on the event
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state | State | The current state of the model | required |
event | Event | The event to update the modifier with | required |
kwargs | Additional keyword arguments for modifier update | {} |