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

Add missing type hints for all flavors of LayoutLMv2 PyTorch models. #16089

Merged
merged 3 commits into from
Mar 13, 2022

Conversation

chainyo
Copy link
Contributor

@chainyo chainyo commented Mar 11, 2022

What does this PR do?

I added type hints for all LayoutLMv2 PyTorch classes as described in #16059 .

@Rocketknight1

@Rocketknight1
Copy link
Member

This also looks good, but same comment about the return types!

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 11, 2022

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

@chainyo
Copy link
Contributor Author

chainyo commented Mar 11, 2022

This also looks good, but same comment about the return types!

Yes I fixed return types + I added all type hints for LayoutLM PyTorch

@Rocketknight1
Copy link
Member

Hi, I'm seeing some tests failing on this one - I think you might have deleted a couple of arguments while adding the annotations!

head_mask=None,
inputs_embeds=None,
encoder_hidden_states=None,
encoder_attention_mask=None,
Copy link
Contributor Author

@chainyo chainyo Mar 11, 2022

Choose a reason for hiding this comment

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

These arguments encoder_hidden_states and encoder_attention_masks are not used.

Should I fix tests too or it's out of the scope of this PR ?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's out of scope of this PR, but good catch nonetheless! I'm not sure why the arguments are there if they're not used, but you can raise an issue after this PR is merged if you like.

Copy link
Member

@Rocketknight1 Rocketknight1 left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@Rocketknight1 Rocketknight1 merged commit 20ab158 into huggingface:master Mar 13, 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.

3 participants