zeroshot commited on
Commit
5512598
·
1 Parent(s): f3b32f0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -0
README.md CHANGED
@@ -1634,6 +1634,30 @@ Current list of sparse and quantized bge ONNX models:
1634
  | [zeroshot/bge-small-en-v1.5-sparse](https://huggingface.co/zeroshot/bge-small-en-v1.5-sparse) | Quantization (INT8) & 50% Pruning |
1635
  | [zeroshot/bge-small-en-v1.5-quant](https://huggingface.co/zeroshot/bge-small-en-v1.5-quant) | Quantization (INT8) |
1636
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1637
 
1638
 
1639
  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).
 
1634
  | [zeroshot/bge-small-en-v1.5-sparse](https://huggingface.co/zeroshot/bge-small-en-v1.5-sparse) | Quantization (INT8) & 50% Pruning |
1635
  | [zeroshot/bge-small-en-v1.5-quant](https://huggingface.co/zeroshot/bge-small-en-v1.5-quant) | Quantization (INT8) |
1636
 
1637
+ ```bash
1638
+ pip install -U deepsparse-nightly[sentence_transformers]
1639
+ ```
1640
+
1641
+ ```python
1642
+ from deepsparse.sentence_transformers import SentenceTransformer
1643
+ model = SentenceTransformer('zeroshot/bge-small-en-v1.5-sparse', export=False)
1644
+
1645
+ # Our sentences we like to encode
1646
+ sentences = ['This framework generates embeddings for each input sentence',
1647
+ 'Sentences are passed as a list of string.',
1648
+ 'The quick brown fox jumps over the lazy dog.']
1649
+
1650
+ # Sentences are encoded by calling model.encode()
1651
+ embeddings = model.encode(sentences)
1652
+
1653
+ # Print the embeddings
1654
+ for sentence, embedding in zip(sentences, embeddings):
1655
+ print("Sentence:", sentence)
1656
+ print("Embedding:", embedding.shape)
1657
+ print("")
1658
+ ```
1659
+
1660
+ For further details regarding DeepSparse & Sentence Transformers integration, refer to the [DeepSparse README](https://github.com/neuralmagic/deepsparse/tree/main/src/deepsparse/sentence_transformers).
1661
 
1662
 
1663
  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).