Skip to content

[Minor] Migrate to logger.warning usage #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions pyvene/models/intervenable_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ def __init__(self, config, model, backend, **kwargs):
# if as_adaptor is turn on, we pass in the input args to the intervention
self.as_adaptor = kwargs["as_adaptor"] if "as_adaptor" in kwargs else False
if self.as_adaptor:
logging.warn(
logging.warning(
"as_adaptor is turned on. This means the intervention will take "
"the input arguments of the intervening module as well."
)
self.model_has_grad = False
if self.use_fast:
logging.warn(
logging.warning(
"Detected use_fast=True means the intervention location "
"will be static within a batch.\n\nIn case multiple "
"location tags are passed only the first one will "
Expand Down Expand Up @@ -184,7 +184,7 @@ def __init__(self, config, model, backend, **kwargs):
if representation.group_key is not None:
_any_group_key = True
if self.config.sorted_keys is not None:
logging.warn(
logging.warning(
"The key is provided in the config. "
"Assuming this is loaded from a pretrained module."
)
Expand Down Expand Up @@ -1879,7 +1879,7 @@ def forward(
actual model forward calls. It will use forward
hooks to do interventions.

In essense, sources will lead to getter hooks to
In essence, sources will lead to getter hooks to
get activations. We will use these activations to
intervene on our base example.

Expand Down Expand Up @@ -1919,7 +1919,7 @@ def forward(
subspaces is a list of indices indicating which subspace will
this intervention target given an example in the batch.

An intervention could be initialized with subspace parition as,
An intervention could be initialized with subspace partition as,
[[... subspace_1 ...], [... subspace_2 ...], [rest]]

An intervention may be targeting a specific partition.
Expand All @@ -1933,7 +1933,7 @@ def forward(

Only setter (where do_intervention is called) needs this field.

*We assume base and source targetting the same subspace for now.
*We assume base and source targeting the same subspace for now.
*We assume only a single space is targeted for now (although 2d list is provided).

Since we now support group-based intervention, the number of sources
Expand Down Expand Up @@ -2182,7 +2182,7 @@ def _batch_process_unit_location(self, inputs):
Each location list in the raw input as,

[[i, j, ...], [m, n, ...], ...] batched
where i, j are the unit index, the outter
where i, j are the unit index, the outer
list is for the batch


Expand Down
Loading