Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix smart_batching_collate Inefficiency (#2556)
* Fix smart_batching_collate Inefficiency SentenceTransformer.py:846 throws a Inefficiency warning: ".....Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at ../torch/csrc/utils/tensor_new.cpp:275.) labels = torch.tensor([example.label for example in batch])" * Update SentenceTransformer.py * Remove some comments; add edge case (if labels is empty) --------- Co-authored-by: Tom Aarsen <[email protected]>
- Loading branch information