File size: 864 Bytes
72b3aca 75bcabd 72b3aca 5e12ebd cc0c9b7 7a97fa6 cc0c9b7 9fa6e15 cc0c9b7 1e26815 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
---
license: mit
language:
- en
---
This is the ONNX variant of the [bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) embeddings model created with the [DeepSparse Optimum](https://github.com/neuralmagic/optimum-deepsparse) integration.
For ONNX export, run:
```bash
pip install git+https://github.com/neuralmagic/optimum-deepsparse.git
```
```python
from optimum.deepsparse import DeepSparseModelForFeatureExtraction
from transformers.onnx.utils import get_preprocessor
from pathlib import Path
model_id = "BAAI/bge-small-en-v1.5"
# 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("bge-small-en-v1.5-dense")
model.save_pretrained(onnx_path)
tokenizer.save_pretrained(onnx_path)
``` |