Instructions to use zeroshot/gte-small-dense with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zeroshot/gte-small-dense with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="zeroshot/gte-small-dense")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("zeroshot/gte-small-dense") model = AutoModel.from_pretrained("zeroshot/gte-small-dense") - Notebooks
- Google Colab
- Kaggle
This is the ONNX variant of the gte-small embeddings model created with the DeepSparse Optimum integration.
To replicate ONNX export, run:
pip install git+https://github.com/neuralmagic/optimum-deepsparse.git
from optimum.deepsparse import DeepSparseModelForFeatureExtraction
from transformers.onnx.utils import get_preprocessor
from pathlib import Path
model_id = "thenlper/gte-small"
# load model and convert to onnx
model = DeepSparseModelForFeatureExtraction.from_pretrained(model_id, export=True)
tokenizer = get_preprocessor(model_id)
# save onnx checkpoint and tokenizer
onnx_path = Path("gte-small-dense")
model.save_pretrained(onnx_path)
tokenizer.save_pretrained(onnx_path)
- Downloads last month
- 6