Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove useless functions #782

Merged
merged 1 commit into from
Jul 1, 2024
Merged

Conversation

jiqing-feng
Copy link
Collaborator

We don't need patch prepare attention maks functions anymore in the latest transformers version.

Comment on lines -135 to -136
def patch_decoder_attention_mask(model: "PreTrainedModel"):
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the smallest transformers version for which this can be deprecated ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transformers==4.35.0 can still work on this change from my tests. But transformers==4.34.0 failed with the following error:

Traceback (most recent call last):
  File "/home/jiqingfe/jiqing_hf/HuggingFace/tests/workloads/text-generation/run_text-generation.py", line 120, in <module>
    from optimum.intel import IPEXModelForCausalLM
  File "<frozen importlib._bootstrap>", line 1075, in _handle_fromlist
  File "/home/jiqingfe/miniconda3/envs/torch/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1272, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "/home/jiqingfe/miniconda3/envs/torch/lib/python3.10/site-packages/transformers/utils/import_utils.py", line 1284, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import optimum.intel.ipex because of the following error (look up to see its traceback):
No module named 'transformers.modeling_attn_mask_utils'

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@helena-intel helena-intel requested a review from eaidova June 28, 2024 09:11
Copy link
Collaborator

@echarlaix echarlaix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @jiqing-feng

@echarlaix echarlaix merged commit 1d29904 into huggingface:main Jul 1, 2024
12 of 16 checks passed
@jiqing-feng jiqing-feng deleted the model_patch branch July 2, 2024 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants