Exception

#2
by ivanstepanovftw - opened

Using code from README card raises the following exception:

Traceback (most recent call last):                                                                                                                            
  File "/home/i/server/src/tools/giga.py", line 23, in <module>
    model = AutoModel.from_pretrained('ai-sage/Giga-Embeddings-instruct', trust_remote_code=True)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/i/server/.venv/lib/python3.12/site-packages/transformers/models/auto/auto_factory.py", line 559, in from_pretrained
    return model_class.from_pretrained(       
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
  File "/home/i/server/.venv/lib/python3.12/site-packages/transformers/modeling_utils.py", line 3886, in from_pretrained
    model = cls(config, *model_args, **model_kwargs)                                                                                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                            File "/root/.cache/huggingface/modules/transformers_modules/ai-sage/Giga-Embeddings-instruct/646f5ff3587e74a18141c8d6b60d1cffd5897b92/modeling_gigarembed.py", line 331, in __init__    
    self.latent_attention_model = AutoModel.from_config(config.latent_attention_config).float()                                                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                         File "/home/i/server/.venv/lib/python3.12/site-packages/transformers/models/auto/auto_factory.py", line 440, in from_config                                     return model_class._from_config(config, **kwargs)                                                                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                         
  File "/home/i/server/.venv/lib/python3.12/site-packages/transformers/modeling_utils.py", line 1494, in _from_config
    if config._attn_implementation_internal is not None:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/i/server/.venv/lib/python3.12/site-packages/transformers/configuration_utils.py", line 202, in __getattribute__
    return super().__getattribute__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'LatentAttentionConfig' object has no attribute '_attn_implementation_internal'

Python 3.12.3
sentence-transformers==3.2.1
transformers==4.45.2

ai-sage org

please use transformers==4.46.0

Should I use 4.46.0 strctly?

I received that error with transformers == 4.47.1

Sign up or log in to comment