Problems when loading esm3 model
HelloWorldLTY opened this issue · 2 comments
HelloWorldLTY commented
Hi, when using esm3 model to generate embeddings, I face a new error:
File "/gpfs/radev/scratch/ying_rex/tl688/esm3/esm/test_esm3.py", line 1, in <module>
from esm.models.esm3 import ESM3
File "/gpfs/radev/scratch/ying_rex/tl688/esm3/esm/esm/models/esm3.py", line 13, in <module>
from esm.layers.regression_head import RegressionHead
File "/gpfs/radev/scratch/ying_rex/tl688/esm3/esm/esm/layers/regression_head.py", line 7, in <module>
hidden_dim: int | None = None,
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
Would you please help me check it? Thanks.
francescopatane96 commented
Hi, when using esm3 model to generate embeddings, I face a new error:
File "/gpfs/radev/scratch/ying_rex/tl688/esm3/esm/test_esm3.py", line 1, in <module> from esm.models.esm3 import ESM3 File "/gpfs/radev/scratch/ying_rex/tl688/esm3/esm/esm/models/esm3.py", line 13, in <module> from esm.layers.regression_head import RegressionHead File "/gpfs/radev/scratch/ying_rex/tl688/esm3/esm/esm/layers/regression_head.py", line 7, in <module> hidden_dim: int | None = None, TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
Would you please help me check it? Thanks.
Try with: model = ESM3.from_pretrained("esm3_sm_open_v1", device=torch.device("cuda"))
ebetica commented
Maybe you're on an old version of python that doesn't support type annotations?