Avoid using tf.tile in embeddings for TF models#14735
Avoid using tf.tile in embeddings for TF models#14735Rocketknight1 merged 3 commits intohuggingface:masterfrom
Conversation
|
I love it, thank you for doing this! I wonder if there's a reason for using the |
|
Either way, it's a straightforward change and I'm happy to merge as-is, so let me know once you're ready. |
I also feel the same, and don't know why The PR is ready. I can rebase on master to see if I can make the tests green. |
3a94ea5 to
e6bc7b4
Compare
|
Failed tests are irrelevant to this PR. Let me know if you prefer to wait and rebase later. |
|
No, we're seeing those tests on every PR. I'm happy to merge now - let me know whenever the PR is done! |
It's is done. You can merge. Thanks! |
|
Done! |
What does this PR do?
Some TF models use
which assume that
position_idshas size 1 along batch dimension. If users don't specifyposition_ids, we create it(before using it)
which will have batch size 1. However, in
INPUTS_DOCSTRING, it specifies the shape to be(batch_size, seq_len).If a user provides a full batch for
position_ids(although this is very unlikely),tf.tileshouldn't be used here.This PR fixes this issue.
Who can review?
@Rocketknight1