Have issue to load the model

#5
by uthsmujiang - opened

I followed your instruction to install the dependencies, but got an error when I tried to load the model.
Here is the code.

from transformers import AutoModel
from huggingface_hub import login
login(token='xxx')
# Load PRISM model.
model = AutoModel.from_pretrained("paige-ai/Prism", trust_remote_code=True)

Here is the error message.

    File "/data/projects/PrismDemo.py", line 11, in <module>
    model = AutoModel.from_pretrained("paige-ai/Prism", trust_remote_code=True)
  File "/data/jjiang10/conda_envs/prism/lib/python3.9/site-packages/transformers/models/auto/auto_factory.py", line 551, in from_pretrained
    model_class = get_class_from_dynamic_module(
  File "/data/jjiang10/conda_envs/prism/lib/python3.9/site-packages/transformers/dynamic_module_utils.py", line 514, in get_class_from_dynamic_module
    return get_class_in_module(class_name, final_module)
  File "/data/jjiang10/conda_envs/prism/lib/python3.9/site-packages/transformers/dynamic_module_utils.py", line 212, in get_class_in_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/home/jjiang10/.cache/huggingface/modules/transformers_modules/paige-ai/Prism/cd2eae7b1e6e51f3664e1a575c5bfe7045cc37d4/modeling_prism.py", line 11, in <module>
    from .biogpt import BioGPT
  File "/home/jjiang10/.cache/huggingface/modules/transformers_modules/paige-ai/Prism/cd2eae7b1e6e51f3664e1a575c5bfe7045cc37d4/biogpt.py", line 8, in <module>
    from .biogpt_hf import BioGptForCausalLM
  File "/home/jjiang10/.cache/huggingface/modules/transformers_modules/paige-ai/Prism/cd2eae7b1e6e51f3664e1a575c5bfe7045cc37d4/biogpt_hf.py", line 461, in <module>
    CollectAttn = Callable[[int, Tensor | None], None]
TypeError: unsupported operand type(s) for |: 'torch._C._TensorMeta' and 'NoneType'

Could you let us know which python version you use? I got this error on python 3.9.

hi, i've resolved a few issues by upgrading to Python 3.10.9

Sorry @uthsmujiang , I missed your question earlier. I now explicitly added Python 3.10 requirement to the Model Card. Thank you @waticlems !

gshaikov changed discussion status to closed
Your need to confirm your account before you can post a new comment.

Sign up or log in to comment