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

CLI: Don't check the model head when there is no model head #18733

Merged
merged 2 commits into from
Aug 23, 2022

Conversation

gante
Copy link
Member

@gante gante commented Aug 23, 2022

What does this PR do?

As the title says -- when there is no model head, don't check it :)

When architectures is not defined, it is implied that there is no model head in the weights.

@gante gante requested review from ydshieh and amyeroberts August 23, 2022 12:04
@gante
Copy link
Member Author

gante commented Aug 23, 2022

cc @ChrisFugl (related to #18678 )

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@ydshieh
Copy link
Collaborator

ydshieh commented Aug 23, 2022

OK, so it was empty dict, and we can't take max of the values, right? LGTM, thank you @gante

@ydshieh
Copy link
Collaborator

ydshieh commented Aug 23, 2022

nit: I would probably check if the dict is empty or not, instead of check architectures is None.

For example, BertModel has pooler_output.

@gante
Copy link
Member Author

gante commented Aug 23, 2022

@ydshieh that is a great point!

Going to change it

@gante
Copy link
Member Author

gante commented Aug 23, 2022

@ydshieh added your suggestion (plus a check -- a model specified head should have outputs beyond hidden_...)

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

Great! Thanks again.

@gante gante merged commit 6faf283 into main Aug 23, 2022
@gante gante deleted the pt_tf_cli_automodel_fix branch August 23, 2022 14:39
oneraghavan pushed a commit to oneraghavan/transformers that referenced this pull request Sep 26, 2022
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