Update README.md
Browse files
README.md
CHANGED
@@ -602,7 +602,28 @@ Current list of sparse and quantized gte ONNX models:
|
|
602 |
| [zeroshot/gte-small-sparse](https://huggingface.co/zeroshot/gte-small-sparse) | Quantization (INT8) & 50% Pruning |
|
603 |
| [zeroshot/gte-small-quant](https://huggingface.co/zeroshot/gte-small-quant) | Quantization (INT8) |
|
604 |
|
|
|
|
|
|
|
605 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
606 |
|
607 |
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).
|
608 |
|
|
|
602 |
| [zeroshot/gte-small-sparse](https://huggingface.co/zeroshot/gte-small-sparse) | Quantization (INT8) & 50% Pruning |
|
603 |
| [zeroshot/gte-small-quant](https://huggingface.co/zeroshot/gte-small-quant) | Quantization (INT8) |
|
604 |
|
605 |
+
```bash
|
606 |
+
pip install -U deepsparse-nightly[sentence_transformers]
|
607 |
+
```
|
608 |
|
609 |
+
```python
|
610 |
+
from deepsparse.sentence_transformers import SentenceTransformer
|
611 |
+
model = SentenceTransformer('zeroshot/gte-small-quant', export=False)
|
612 |
+
|
613 |
+
# Our sentences we like to encode
|
614 |
+
sentences = ['This framework generates embeddings for each input sentence',
|
615 |
+
'Sentences are passed as a list of string.',
|
616 |
+
'The quick brown fox jumps over the lazy dog.']
|
617 |
+
|
618 |
+
# Sentences are encoded by calling model.encode()
|
619 |
+
embeddings = model.encode(sentences)
|
620 |
+
|
621 |
+
# Print the embeddings
|
622 |
+
for sentence, embedding in zip(sentences, embeddings):
|
623 |
+
print("Sentence:", sentence)
|
624 |
+
print("Embedding:", embedding.shape)
|
625 |
+
print("")
|
626 |
+
```
|
627 |
|
628 |
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).
|
629 |
|