Skip to content

Huggingface Transformers forward incompatibility #28

@antoniorv6

Description

@antoniorv6

Hi @antoniorv6 I tried using PRAIG/smt-grandstaff and smt-fp-grandstaff and got the following error:

Edit: I was able to get around this by using transformers==4.40.2 following huggingface/transformers#30965 (comment)

Traceback (most recent call last):
  File "/root/SMT/run.py", line 8, in <module>
    model = SMTModelForCausalLM.from_pretrained("PRAIG/smt-fp-grandstaff").to(device)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/transformers/modeling_utils.py", line 315, in _wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/transformers/modeling_utils.py", line 4930, in from_pretrained
    model = cls(config, *model_args, **model_kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/SMT/smt_model/modeling_smt.py", line 344, in __init__
    super().__init__(config)
  File "/usr/local/lib/python3.11/site-packages/transformers/modeling_utils.py", line 2191, in __init__
    self.config._attn_implementation, is_init_check=True
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/transformers/configuration_utils.py", line 211, in __getattribute__
    return super().__getattribute__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/transformers/configuration_utils.py", line 407, in _attn_implementation
    return self._attn_implementation_internal
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/transformers/configuration_utils.py", line 211, in __getattribute__
    return super().__getattribute__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SMTConfig' object has no attribute '_attn_implementation_internal'

Originally posted by @orge-dev in #26

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions