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

Fix compatibility with transformers v 4.39.0 #1764

Merged
merged 5 commits into from
Mar 22, 2024

Conversation

echarlaix
Copy link
Collaborator

@echarlaix echarlaix commented Mar 22, 2024

Fix compatibility of ORTModels with transformers pipelines (broken since huggingface/transformers@53d8912)

Failing tests : https://github.com/huggingface/optimum/actions/runs/8377803444

Also update phi default opset (needed since huggingface/transformers#29108)

@echarlaix echarlaix changed the title Fix compatibilitywith transformers v 4.39.0 Fix compatibility with transformers v 4.39.0 Mar 22, 2024
@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.

@echarlaix echarlaix marked this pull request as ready for review March 22, 2024 12:50
@@ -15,7 +15,7 @@
REQUIRED_PKGS = [
"coloredlogs",
"sympy",
"transformers[sentencepiece]>=4.26.0",
"transformers[sentencepiece]>=4.26.0,<4.40.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

wdyt @fxmarty ?

@@ -252,6 +252,7 @@ class GemmaOnnxConfig(LlamaOnnxConfig):


class PhiOnnxConfig(TextDecoderWithPositionIdsOnnxConfig):
DEFAULT_ONNX_OPSET = 14 # Phi now uses F.scaled_dot_product_attention by default for torch>=2.1.1.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

@michaelbenayoun michaelbenayoun left a comment

Choose a reason for hiding this comment

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

LGTM

@echarlaix echarlaix merged commit a06d8b7 into main Mar 22, 2024
51 of 63 checks passed
@echarlaix echarlaix deleted the fix-transformers-compatibility branch March 22, 2024 14:52
@SunMarc SunMarc mentioned this pull request Apr 22, 2024
4 tasks
young-developer pushed a commit to young-developer/optimum that referenced this pull request May 10, 2024
* Add can_generate method to fix compatibility with transformers v4.39.0

* fix style

* fix import

* pin transformers version

* Fix Phi model export
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