Skip to content

Conversation

EricLBuehler
Copy link
Member

No description provided.

@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.

@EricLBuehler
Copy link
Member Author

@BenjaminBossan this should be ready for review!

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the test. Just one comment about how to check the version.

assert torch.isfinite(outputs[: inputs.shape[1] :]).all()

# TODO: remove the skip when 4.45 is released!
@pytest.mark.skipif(int(transformers.__version__.split(".")[1]) < 45, reason="Requires transformers >= 4.45")
Copy link
Member

Choose a reason for hiding this comment

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

Let's do the version check similar to how we do it here:

uses_transformers_4_38 = packaging.version.parse(transformers.__version__) >= packaging.version.parse("4.38.0")

This should be more robust. It requires the import: import packaging.version.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good, I just added this to the PR!

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the test. I checked locally that it's currently skipped and that it would pass with the latest transformers version.

@BenjaminBossan BenjaminBossan merged commit 31fbbd2 into huggingface:main Sep 5, 2024
14 checks passed
@EricLBuehler EricLBuehler deleted the fixing_scalings_logging_test branch September 9, 2024 00:35
Guy-Bilitski pushed a commit to Guy-Bilitski/peft that referenced this pull request May 13, 2025
Fix test for latest transformers, skip for earlier versions.
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