Closed michaelfeil closed 1 year ago
Hi @michaelfeil, you are correct! I think it is some legacy code.
Hi @michaelfeil, just getting back to you. It is because the pooling_model.forward()
expects a tensor. So, we do actually need to do a conversion. Either, from np to pt or the other way around.
Awesome work! Just some short questions regarding:
https://github.com/Pandora-Intelligence/fast-sentence-transformers/blob/3f277ee7b49d78e0a61fe72d82e02064d4a33e71/fast_sentence_transformers/FastSentenceTransformer.py#L330-L331
Why are the tokens returned as pt (cuda) tensor, but converted to numpy array in the next line. Am I missing something! Would it make sense to change to return type np?