ONNX Model Zoo

zeroshot/gte-small-sparse

By zeroshot · ↓ 1 · ♥ 1 · Updated 2023-10-22

What's in this repo

This page lists the files in zeroshot/gte-small-sparse, including model.onnx.

  • 1 ONNX models (.onnx files)
  • 5 files, including 2 .json, 1 .md, 1 .onnx
  • Last updated 2023-10-22

ONNX files

File Size Download
model.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

gte-small-sparse

This is the sparse ONNX variant of the gte-small embeddings model created with DeepSparse Optimum for ONNX export and Neural Magic's Sparsify for one-shot quantization (INT8) and unstructured pruning (50%).

Current list of sparse and quantized gte ONNX models:

Links Sparsification Method
zeroshot/gte-large-sparse Quantization (INT8) & 50% Pruning
zeroshot/gte-large-quant Quantization (INT8)
zeroshot/gte-base-sparse Quantization (INT8) & 50% Pruning
zeroshot/gte-base-quant Quantization (INT8)
zeroshot/gte-small-sparse Quantization (INT8) & 50% Pruning
zeroshot/gte-small-quant Quantization (INT8)
pip install -U deepsparse-nightly[sentence_transformers]
from deepsparse.sentence_transformers import SentenceTransformer
model = SentenceTransformer('zeroshot/gte-small-sparse', export=False)

# Our sentences we like to encode
sentences = ['This framework generates embeddings for each input sentence',
    'Sentences are passed as a list of string.',
    'The quick brown fox jumps over the lazy dog.']

# Sentences are encoded by calling model.encode()
embeddings = model.encode(sentences)

# Print the embeddings
for sentence, embedding in zip(sentences, embeddings):
    print("Sentence:", sentence)
    print("Embedding:", embedding.shape)
    print("")

For further details regarding DeepSparse & Sentence Transformers integration, refer to the DeepSparse README.

For general questions on these models and sparsification methods, reach out to the engineering team on our community Slack.

;)

Model info

feature-extraction transformers
transformers onnx bert feature-extraction sparse sparsity quantized onnx embeddings int8 en license:mit endpoints_compatible region:us
↓ 1 ♥ 1

Created: 2023-10-12

Updated: 2023-10-22

View on Hugging Face

Files (5)

.gitattributes
README.md
config.json
model.onnx ONNX
tokenizer.json

Related models