jbloomAus / SAELens

Training Sparse Autoencoders on Language Models
https://jbloomaus.github.io/SAELens/
MIT License
386 stars 106 forks source link

[Bug Report] make check-ci fails with pyright 1.1.366 #174

Closed jettjaniak closed 2 months ago

jettjaniak commented 3 months ago

Describe the bug pyright failing in make check-ci on neuronpedia files Code example

(.venv) ➜  SAELens git:(main) make check-ci
make check-format
poetry run flake8 .
poetry run black --check .
Skipping .ipynb files as Jupyter dependencies are not installed.
You can fix this by running ``pip install "black[jupyter]"``
All done! ✨ 🍰 ✨
75 files would be left unchanged.
poetry run isort --check-only --diff .
Skipped 2 files
make check-type
poetry run pyright .
/Users/jett/Documents/jett/SAELens/sae_lens/analysis/neuronpedia_integration.py
  /Users/jett/Documents/jett/SAELens/sae_lens/analysis/neuronpedia_integration.py:319:13 - error: Expected no arguments to "DataclassInstance" constructor (reportCallIssue)
  /Users/jett/Documents/jett/SAELens/sae_lens/analysis/neuronpedia_integration.py:367:17 - error: Expected no arguments to "DataclassInstance" constructor (reportCallIssue)
  /Users/jett/Documents/jett/SAELens/sae_lens/analysis/neuronpedia_integration.py:373:56 - error: Cannot access attribute "tokens" for class "DataclassInstance"
    Attribute "tokens" is unknown (reportAttributeAccessIssue)
  /Users/jett/Documents/jett/SAELens/sae_lens/analysis/neuronpedia_integration.py:375:51 - error: Cannot access attribute "activations" for class "DataclassInstance"
    Attribute "activations" is unknown (reportAttributeAccessIssue)
  /Users/jett/Documents/jett/SAELens/sae_lens/analysis/neuronpedia_integration.py:397:47 - error: Cannot access attribute "get_preferred_score" for class "DataclassInstance"
    Attribute "get_preferred_score" is unknown (reportAttributeAccessIssue)
  /Users/jett/Documents/jett/SAELens/sae_lens/analysis/neuronpedia_integration.py:406:42 - error: Cannot access attribute "scored_sequence_simulations" for class "DataclassInstance"
    Attribute "scored_sequence_simulations" is unknown (reportAttributeAccessIssue)
  /Users/jett/Documents/jett/SAELens/sae_lens/analysis/neuronpedia_integration.py:435:67 - error: Cannot access attribute "scored_sequence_simulations" for class "DataclassInstance"
    Attribute "scored_sequence_simulations" is unknown (reportAttributeAccessIssue)
7 errors, 0 warnings, 0 informations
make[1]: *** [check-type] Error 1
make: *** [check-ci] Error 2

System Info Describe the characteristic of your environment:

Additional context it works fine with pyright 1.1.361

Checklist

chanind commented 3 months ago

I noticed this as well. It looks like this starts happening in pyright 1.1.366, but doesn't in 1.1.365. I pinned the pyright version in #176 to get CI to pass, but not sure if there's a better solution or if this is something that will be fixed in a later version of pyright.

jbloomAus commented 2 months ago

This is likely stale.