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 _load_state_dict_into_meta_model with device_map=None #36488

Merged
merged 2 commits into from
Mar 2, 2025

Conversation

hlky
Copy link
Contributor

@hlky hlky commented Mar 1, 2025

What does this PR do?

https://github.com/huggingface/diffusers/actions/runs/13604967458/job/38035399161?pr=10898

>       device_map_regex = "|".join(sorted(device_map.keys(), reverse=True))
E       AttributeError: 'NoneType' object has no attribute 'keys'

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@hlky hlky requested a review from SunMarc March 1, 2025 13:03
Copy link

github-actions bot commented Mar 1, 2025

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. When it is ready for review, please click the Ready for review button (at the bottom of the PR page).

@github-actions github-actions bot marked this pull request as draft March 1, 2025 13:03
@hlky hlky marked this pull request as ready for review March 1, 2025 13: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.

Copy link
Member

@SunMarc SunMarc 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 that. Just a nit

Comment on lines 789 to 788
device_map_regex = "|".join(sorted(device_map.keys(), reverse=True))
device_map_regex = "|".join(sorted(device_map.keys(), reverse=True))
Copy link
Member

Choose a reason for hiding this comment

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

Yeah sorry, i missed that. Make sure to put it under the condition if device_map is not None. Right now it requires that it also have "" in its keys.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Thanks

@ArthurZucker ArthurZucker merged commit dcbdf7e into huggingface:main Mar 2, 2025
18 of 23 checks passed
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.

4 participants