Update README.md
Browse files
README.md
CHANGED
@@ -720,6 +720,32 @@ Current list of sparse and quantized bge ONNX models:
|
|
720 |
| [zeroshot/bge-small-en-v1.5-sparse](https://huggingface.co/zeroshot/bge-small-en-v1.5-sparse) | Quantization (INT8) & 50% Pruning |
|
721 |
| [zeroshot/bge-small-en-v1.5-quant](https://huggingface.co/zeroshot/bge-small-en-v1.5-quant) | Quantization (INT8) |
|
722 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
723 |
For general questions on these models and sparsification methods, reach out to the engineering team on our [community Slack](https://join.slack.com/t/discuss-neuralmagic/shared_invite/zt-q1a1cnvo-YBoICSIw3L1dmQpjBeDurQ).
|
724 |
|
725 |
![;)](https://media.giphy.com/media/bYg33GbNbNIVzSrr84/giphy-downsized-large.gif)
|
|
|
720 |
| [zeroshot/bge-small-en-v1.5-sparse](https://huggingface.co/zeroshot/bge-small-en-v1.5-sparse) | Quantization (INT8) & 50% Pruning |
|
721 |
| [zeroshot/bge-small-en-v1.5-quant](https://huggingface.co/zeroshot/bge-small-en-v1.5-quant) | Quantization (INT8) |
|
722 |
|
723 |
+
```bash
|
724 |
+
pip install -U deepsparse-nightly[sentence_transformers]
|
725 |
+
```
|
726 |
+
|
727 |
+
```python
|
728 |
+
from deepsparse.sentence_transformers import SentenceTransformer
|
729 |
+
model = SentenceTransformer('zeroshot/bge-base-en-v1.5-sparse', export=False)
|
730 |
+
|
731 |
+
# Our sentences we like to encode
|
732 |
+
sentences = ['This framework generates embeddings for each input sentence',
|
733 |
+
'Sentences are passed as a list of string.',
|
734 |
+
'The quick brown fox jumps over the lazy dog.']
|
735 |
+
|
736 |
+
# Sentences are encoded by calling model.encode()
|
737 |
+
embeddings = model.encode(sentences)
|
738 |
+
|
739 |
+
# Print the embeddings
|
740 |
+
for sentence, embedding in zip(sentences, embeddings):
|
741 |
+
print("Sentence:", sentence)
|
742 |
+
print("Embedding:", embedding.shape)
|
743 |
+
print("")
|
744 |
+
```
|
745 |
+
|
746 |
+
For further details regarding DeepSparse & Sentence Transformers integration, refer to the [DeepSparse README](https://github.com/neuralmagic/deepsparse/tree/main/src/deepsparse/sentence_transformers).
|
747 |
+
|
748 |
+
|
749 |
For general questions on these models and sparsification methods, reach out to the engineering team on our [community Slack](https://join.slack.com/t/discuss-neuralmagic/shared_invite/zt-q1a1cnvo-YBoICSIw3L1dmQpjBeDurQ).
|
750 |
|
751 |
![;)](https://media.giphy.com/media/bYg33GbNbNIVzSrr84/giphy-downsized-large.gif)
|