Skip to content

Update forward signature test for vision models#27681

Merged
ydshieh merged 2 commits intohuggingface:mainfrom
NielsRogge:fix_forward_signature_bis
Nov 27, 2023
Merged

Update forward signature test for vision models#27681
ydshieh merged 2 commits intohuggingface:mainfrom
NielsRogge:fix_forward_signature_bis

Conversation

@NielsRogge
Copy link
Contributor

What does this PR do?

This PR makes sure that vision-only models don't need to overwrite test_forward_signature. Instead, model.main_input_name is leveraged.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 23, 2023

The documentation is not available anymore as the PR was closed or merged.

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.

Looks good to me! Let's just make sure all NLP models have this properly set, but nice cleanup!

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.

Thank you. Nice job!

@ydshieh
Copy link
Collaborator

ydshieh commented Nov 27, 2023

main_input_name is defined in PreTrainedModel (and the corresponding TF/Flax counterpart), so

all (NLP) models have this properly set

is True

@ydshieh ydshieh merged commit 59499bb into huggingface:main Nov 27, 2023
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