diff --git a/pyvene/models/intervenable_base.py b/pyvene/models/intervenable_base.py index db84b57d..4fd51c12 100644 --- a/pyvene/models/intervenable_base.py +++ b/pyvene/models/intervenable_base.py @@ -251,9 +251,9 @@ def __str__(self): Print out basic info about this intervenable instance """ attr_dict = { - "model_type": self.model_type, - "intervention_types": self.intervention_types, - "alignabls": self.sorted_keys, + "model_type": self.model_type.__name__, + "intervention_types": [type(v[0]).__name__ for (k, v) in self.interventions.items()], + "alignables": self.sorted_keys, "mode": self.mode, } return json.dumps(attr_dict, indent=4) diff --git a/tests/integration_tests/IntervenableBasicTestCase.py b/tests/integration_tests/IntervenableBasicTestCase.py index aaedfedc..74b18c2f 100644 --- a/tests/integration_tests/IntervenableBasicTestCase.py +++ b/tests/integration_tests/IntervenableBasicTestCase.py @@ -46,31 +46,7 @@ def test_less_lazy_demo(self): ) print(config) pv_gpt2 = pv.IntervenableModel(config, model=gpt2) - - intervened_outputs = pv_gpt2( - base = tokenizer( - "The capital of Spain is", - return_tensors="pt" - ), - unit_locations={"base": 3} - ) - - def test_less_lazy_demo(self): - - _, tokenizer, gpt2 = pv.create_gpt2(cache_dir=self._test_dir) - - config = pv.IntervenableConfig([ - { - "layer": _, - "component": "mlp_output", - "source_representation": torch.zeros( - gpt2.config.n_embd) - } for _ in range(4)], - mode="parallel" - ) - print(config) - pv_gpt2 = pv.IntervenableModel(config, model=gpt2) - + print(pv_gpt2) intervened_outputs = pv_gpt2( base = tokenizer( "The capital of Spain is",