Skip to content

Conversation

@Cyrilvallez
Copy link
Member

What does this PR do?

Some old models could not be initialized on meta device because they used dynamic .item() or .tolist() in the __init__, which does not work with meta initialization as the underlying tensor will be on meta.

@github-actions github-actions bot marked this pull request as draft April 16, 2025 21:07
@github-actions
Copy link
Contributor

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the Ready for review button (at the bottom of the PR page). This will assign reviewers and trigger CI.

@Cyrilvallez Cyrilvallez marked this pull request as ready for review April 16, 2025 21:07
@Cyrilvallez Cyrilvallez merged commit 688f470 into main Apr 16, 2025
19 of 21 checks passed
@Cyrilvallez Cyrilvallez deleted the meta-init branch April 16, 2025 21:26
@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.

cyr0930 pushed a commit to cyr0930/transformers that referenced this pull request Apr 18, 2025
* Update test_modeling_common.py

* fix all

* more fixes
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request May 14, 2025
* Update test_modeling_common.py

* fix all

* more fixes
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