Fix encode_batch and encode_batch_fast to accept ndarrays again#1679
Fix encode_batch and encode_batch_fast to accept ndarrays again#1679ArthurZucker merged 2 commits intohuggingface:mainfrom diliop:main
Conversation
|
@ArthurZucker mind giving this a look since I think sooner than later someone is going to complain about |
ArthurZucker
left a comment
There was a problem hiding this comment.
LGTM would be nice to add a case with ndarrays in the test encode format 🤗 LGTM otherwise, good catch
|
(Sorry about the delay we were on a company wide offsite 😅 🌴 |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
Could you update with clippy as well? 🤗 |
| @@ -152,8 +152,6 @@ def test_encode(self): | |||
| assert len(output) == 2 | |||
|
|
|||
| def test_encode_formats(self, bert_files): | |||
There was a problem hiding this comment.
@ArthurZucker there are already a set of tests covering np.array - did you have something else in mind?
There was a problem hiding this comment.
Nope I checked and found then so approved and good to go!
|
Thanks! 🤗 |
* Fix encode_batch and encode_batch_fast to accept ndarrays again * Fix clippy --------- Co-authored-by: Dimitris Iliopoulos <diliopoulos@fb.com>
This is a follow up to my comment from here which essentially reverts the
PyListchange from #1665 andPySequencechange from #1673 with regards to theinputarg forencode_batchandencode_batch_fast, back toVec<..>. This allows passingndarraytogether withlistandtupleasinputtypes. I also turned on the tests that were turned off before to make sure that this change forencode_batchis covered. I will follow up with adding more tests forencode_batch_fastbut prefer to get this out sooner than later.