Closed mikeybellissimo closed 4 months ago
Hi @mikeybellissimo thanks for reporting this error! I'm not sure how to immediately resolve this, do you have a candidate fix? Would be happy to take the contribution. Otherwise I will look into this in a few days.
Hi @mikeybellissimo As some time has passed with no further updates, I am going to go ahead and close out this issue. If you have comments to contribute, please feel free to re-open the thread. Thank you! Jeannie / Neural Magic
Despite the code saying that you can specify "token_embeddings" for the DeepSparseSentenceTransformer.encode method as the value for the output_value argument, it is not actually set up properly to do this. The issue can be very clearly seen by looking at the following code from the encode method in this file: https://github.com/neuralmagic/deepsparse/blob/main/src/deepsparse/sentence_transformers/sentence_transformer.py
As you can see, out_features is an empty dict but only a few lines down, within the condition where output_value is "token_emeddings" is met, we attempt to retrieve the value using the key "token_embeddings" from an empty dictionary leading to the following error:
which occurs when running the code shown below:
Really great work on this project overall though so thank you for all the effort you've put in so far so that people like me can easily make use of an awesome project like this! Thanks, Michael