-
Notifications
You must be signed in to change notification settings - Fork 826
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
Fixing roberta type id (everything is zero). #1072
Conversation
The documentation is not available anymore as the PR was closed or merged. |
Thanks, @Narsil for working on this issue. First, should this line be changed too:
? In the 0.12.1, it was
If I understand correctly, Overall, LGTM for the change, thanks again. We should probably double check why we used all 0 before (when we get some time). |
Yes indeed.
Yes there was no test basically, so I added the tests with the trait modification. That's why I put the values that seemed logic, not necessarily the ones that used to be there before (I tried to create the test with 0.12.1 version, I may have done it wrong for this one) |
051be5d
to
dcb532f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the docstring in RobertaTokenizer
https://github.com/huggingface/transformers/blob/a04140afb12b5dcf1df023e2180aedf616f3da87/src/transformers/models/roberta/tokenization_roberta.py#L400
and its return value
https://github.com/huggingface/transformers/blob/a04140afb12b5dcf1df023e2180aedf616f3da87/src/transformers/models/roberta/tokenization_roberta.py#L415-L417
all 0s is expected. And the change in this PR is totally right! Thanks.
This is still weird for LayoutLM in the sense that there is a That's what I meant when I said I was unsure about wether it was a bug or not. (regardless this fixes it) |
What I found is See This should answer your question @Narsil . But we are not sure why |
Update: https://huggingface.co/impira/layoutlm-document-qa/discussions/4 |
The original Roberta
type_ids
actually gives out0
for every part:https://github.com/huggingface/tokenizers/blob/python-v0.12.1/tokenizers/src/processors/roberta.rs#L117
This broke 1 integration test in
transformers
.