Skip to content
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

Bug in BoundlessRotatedSpaceIntervention #73

Closed
jiudingsun01 opened this issue Jan 19, 2024 · 1 comment
Closed

Bug in BoundlessRotatedSpaceIntervention #73

jiudingsun01 opened this issue Jan 19, 2024 · 1 comment

Comments

@jiudingsun01
Copy link
Contributor

In the new version, self.embed_dim in line 262 in interventions.py is initialized as None and never assigned value. This will cause the failure of running Doundless_DAS.ipynb:

Traceback (most recent call last):
File "/work/frink/sun.jiu/function_vectors/src/compute_rotational_subspace.py", line 300, in
intervenable = IntervenableModel(intervenable_config, model)
File "/work/frink/sun.jiu/miniconda3/envs/fv/lib/python3.10/site-packages/pyvene/models/intervenable_base.py", line 111, in init
intervention = intervention_function(
File "/work/frink/sun.jiu/miniconda3/envs/fv/lib/python3.10/site-packages/pyvene/models/interventions.py", line 265, in init
torch.arange(0, self.embed_dim), requires_grad=False
TypeError: arange() received an invalid combination of arguments - got (int, NoneType), but expected one of:

  • (Number end, *, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
  • (Number start, Number end, *, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
  • (Number start, Number end, Number step, *, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)

Simply changing the line into:

self.embed_dim = embed_dim

Would solve the issue.

@jiudingsun01
Copy link
Contributor Author

Issue already fixed. I was running under a previous version. Sorry about the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant