Update README.md
Browse files
README.md
CHANGED
|
@@ -20,6 +20,31 @@ Current list of sparse and quantized bge ONNX models:
|
|
| 20 |
| [zeroshot/bge-small-en-v1.5-sparse](https://huggingface.co/zeroshot/bge-small-en-v1.5-sparse) | Quantization (INT8) & 50% Pruning |
|
| 21 |
| [zeroshot/bge-small-en-v1.5-quant](https://huggingface.co/zeroshot/bge-small-en-v1.5-quant) | Quantization (INT8) |
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
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).
|
| 25 |
|
|
|
|
| 20 |
| [zeroshot/bge-small-en-v1.5-sparse](https://huggingface.co/zeroshot/bge-small-en-v1.5-sparse) | Quantization (INT8) & 50% Pruning |
|
| 21 |
| [zeroshot/bge-small-en-v1.5-quant](https://huggingface.co/zeroshot/bge-small-en-v1.5-quant) | Quantization (INT8) |
|
| 22 |
|
| 23 |
+
```bash
|
| 24 |
+
pip install -U deepsparse-nightly[sentence_transformers]
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
```python
|
| 28 |
+
from deepsparse.sentence_transformers import SentenceTransformer
|
| 29 |
+
model = SentenceTransformer('zeroshot/bge-large-en-v1.5-quant', export=False)
|
| 30 |
+
|
| 31 |
+
# Our sentences we like to encode
|
| 32 |
+
sentences = ['This framework generates embeddings for each input sentence',
|
| 33 |
+
'Sentences are passed as a list of string.',
|
| 34 |
+
'The quick brown fox jumps over the lazy dog.']
|
| 35 |
+
|
| 36 |
+
# Sentences are encoded by calling model.encode()
|
| 37 |
+
embeddings = model.encode(sentences)
|
| 38 |
+
|
| 39 |
+
# Print the embeddings
|
| 40 |
+
for sentence, embedding in zip(sentences, embeddings):
|
| 41 |
+
print("Sentence:", sentence)
|
| 42 |
+
print("Embedding:", embedding.shape)
|
| 43 |
+
print("")
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
For further details regarding DeepSparse & Sentence Transformers integration, refer to the [DeepSparse README](https://github.com/neuralmagic/deepsparse/tree/main/src/deepsparse/sentence_transformers).
|
| 47 |
+
|
| 48 |
|
| 49 |
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).
|
| 50 |
|