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

Pin revision for LayoutLMForQuestionAnswering and TFLayoutLMForQuestionAnswering tests #18854

Merged
merged 4 commits into from
Sep 1, 2022

Conversation

ankrgyl
Copy link
Contributor

@ankrgyl ankrgyl commented Sep 1, 2022

What does this PR do?

The newly introduced tests for LayoutLMForQuestionAnswering and TFLayoutLMForQuestionAnswering broke due to a change to the weights in https://huggingface.co/impira/layoutlm-document-qa. To make sure a weights change does not break tests, I've pinned the revisions in these tests. I'll separately investigate the weights and debug if something is broken with them.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.

It was raised here: #18407.

Who can review?

@NielsRogge @ydshieh

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 1, 2022

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

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.

Thanks a lot, @ankrgyl !

@@ -1285,7 +1285,9 @@ def forward(
>>> import torch

>>> tokenizer = AutoTokenizer.from_pretrained("impira/layoutlm-document-qa", add_prefix_space=True)
>>> model = LayoutLMForQuestionAnswering.from_pretrained("impira/layoutlm-document-qa")
>>> model = LayoutLMForQuestionAnswering.from_pretrained(
... "impira/layoutlm-document-qa", revision="1e3ebacae311132a7c4a8df2d350d7e4ffd6ff0a"
Copy link
Collaborator

@sgugger sgugger Sep 1, 2022

Choose a reason for hiding this comment

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

Note that you only need to put the first 7 characters for the commit hash, might be less intimidating (and fit in one line) this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Just updated.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Perfect, thanks!

@sgugger sgugger merged commit 23fab60 into huggingface:main Sep 1, 2022
oneraghavan pushed a commit to oneraghavan/transformers that referenced this pull request Sep 26, 2022
…onAnswering tests (huggingface#18854)

* Pin revision for tests

* Fixup

* Update revision in models

* Shorten revisions

Co-authored-by: Ankur Goyal <ankur@impira.com>
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