AlignmentResearch / tuned-lens

Tools for understanding how transformer predictions are built layer-by-layer
https://tuned-lens.readthedocs.io/en/latest/
MIT License
438 stars 47 forks source link

`import tuned_lens` fails when not installing in dev mode #25

Closed levmckinney closed 1 year ago

levmckinney commented 1 year ago

Describe the bug Installing from the repository using pip does not work!

To Reproduce Steps to reproduce the behavior:

  1. Create a new virtual environment
  2. $ pip install tuned_lens@git+https://github.com/AlignmentResearch/tuned-lens.git@d54ad26c806328747cebc7963839518ad5e91403
  3. $ python -c "import tuned_lens"
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/home/lev/miniconda3/envs/test-env/lib/python3.10/site-packages/tuned_lens/__init__.py", line 1, in <module>
    from .causal import ablate_layer, layer_intervention
    ModuleNotFoundError: No module named 'tuned_lens.causal'

Expected behavior You should be able to install this package via pip and the above import should work.

Environment:

Additional Context This does not occur when you install from source i.e. pip install -e .

levmckinney commented 1 year ago

Here is a relevant stack overflow though it does not seem to have an answer https://stackoverflow.com/questions/71624489/pip-install-doesnt-install-all-modules-in-package

levmckinney commented 1 year ago

This also occurs when you install from PyPi