You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import os
# Check if we're in Colab
try:
import google.colab # noqa: F401 # type: ignore
in_colab = True
except ImportError:
in_colab = False
# Install if in Colab
if in_colab:
%pip install sparse_autoencoder transformer_lens transformers wandb
# Otherwise enable hot reloading in dev mode
if not in_colab:
%load_ext autoreload
%autoreload 2
from sparse_autoencoder import (
ActivationResamplerHyperparameters,
AutoencoderHyperparameters,
Hyperparameters,
LossHyperparameters,
Method,
OptimizerHyperparameters,
Parameter,
PipelineHyperparameters,
SourceDataHyperparameters,
SourceModelHyperparameters,
SweepConfig,
sweep,
)
Throws:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
[<ipython-input-3-ef2a52074e18>](https://localhost:8080/#) in <cell line: 3>()
1 import os
2
----> 3 from sparse_autoencoder import (
4 ActivationResamplerHyperparameters,
5 AutoencoderHyperparameters,
1 frames
[/usr/local/lib/python3.10/dist-packages/sparse_autoencoder/optimizer/adam_with_reset.py](https://localhost:8080/#) in <module>
10 from torch.nn.parameter import Parameter
11 from torch.optim import Adam
---> 12 from torch.optim.optimizer import params_t
13
14 from sparse_autoencoder.optimizer.abstract_optimizer import AbstractOptimizerWithReset
ImportError: cannot import name 'params_t' from 'torch.optim.optimizer' (/usr/local/lib/python3.10/dist-packages/torch/optim/optimizer.py)
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
Also just noted that the issue does not occur when building from source (poetry install). I think that suggests there is a discrepancy with the pip install, maybe an incorrectly specified dependency in [tool.poetry.dependencies] or something like that.
Ran this from the demo code:
Throws:
This occurs in Colab.
The text was updated successfully, but these errors were encountered: