Skip to content

Commit dad20d8

Browse files
authored
Merge pull request #218 from emmanuel-ferdman/main
[Minor] Migrate to `logger.warning` usage
2 parents 5357128 + 330b4b5 commit dad20d8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pyvene/models/intervenable_base.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ def __init__(self, config, model, backend, **kwargs):
6363
# if as_adaptor is turn on, we pass in the input args to the intervention
6464
self.as_adaptor = kwargs["as_adaptor"] if "as_adaptor" in kwargs else False
6565
if self.as_adaptor:
66-
logging.warn(
66+
logging.warning(
6767
"as_adaptor is turned on. This means the intervention will take "
6868
"the input arguments of the intervening module as well."
6969
)
7070
self.model_has_grad = False
7171
if self.use_fast:
72-
logging.warn(
72+
logging.warning(
7373
"Detected use_fast=True means the intervention location "
7474
"will be static within a batch.\n\nIn case multiple "
7575
"location tags are passed only the first one will "
@@ -184,7 +184,7 @@ def __init__(self, config, model, backend, **kwargs):
184184
if representation.group_key is not None:
185185
_any_group_key = True
186186
if self.config.sorted_keys is not None:
187-
logging.warn(
187+
logging.warning(
188188
"The key is provided in the config. "
189189
"Assuming this is loaded from a pretrained module."
190190
)
@@ -1879,7 +1879,7 @@ def forward(
18791879
actual model forward calls. It will use forward
18801880
hooks to do interventions.
18811881
1882-
In essense, sources will lead to getter hooks to
1882+
In essence, sources will lead to getter hooks to
18831883
get activations. We will use these activations to
18841884
intervene on our base example.
18851885
@@ -1919,7 +1919,7 @@ def forward(
19191919
subspaces is a list of indices indicating which subspace will
19201920
this intervention target given an example in the batch.
19211921
1922-
An intervention could be initialized with subspace parition as,
1922+
An intervention could be initialized with subspace partition as,
19231923
[[... subspace_1 ...], [... subspace_2 ...], [rest]]
19241924
19251925
An intervention may be targeting a specific partition.
@@ -1933,7 +1933,7 @@ def forward(
19331933
19341934
Only setter (where do_intervention is called) needs this field.
19351935
1936-
*We assume base and source targetting the same subspace for now.
1936+
*We assume base and source targeting the same subspace for now.
19371937
*We assume only a single space is targeted for now (although 2d list is provided).
19381938
19391939
Since we now support group-based intervention, the number of sources
@@ -2182,7 +2182,7 @@ def _batch_process_unit_location(self, inputs):
21822182
Each location list in the raw input as,
21832183
21842184
[[i, j, ...], [m, n, ...], ...] batched
2185-
where i, j are the unit index, the outter
2185+
where i, j are the unit index, the outer
21862186
list is for the batch
21872187
21882188

0 commit comments

Comments
 (0)