zeroshot commited on
Commit
199ac13
1 Parent(s): f17f4a3

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -0
README.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+ This is the ONNX variant of the [bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) model for embeddings created with the [DeepSparse Optimum](https://github.com/neuralmagic/optimum-deepsparse) integration.
5
+
6
+ For ONNX export, run:
7
+
8
+ ```bash
9
+ pip install git+https://github.com/neuralmagic/optimum-deepsparse.git
10
+ ```
11
+
12
+ ```python
13
+ from optimum.deepsparse import DeepSparseModelForFeatureExtraction
14
+ from transformers.onnx.utils import get_preprocessor
15
+ from pathlib import Path
16
+
17
+ model_id = "BAAI/bge-base-en-v1.5"
18
+
19
+ # load model and convert to onnx
20
+ model = DeepSparseModelForFeatureExtraction.from_pretrained(model_id, export=True)
21
+ tokenizer = get_preprocessor(model_id)
22
+
23
+ # save onnx checkpoint and tokenizer
24
+ onnx_path = Path("dense-bge-base-en-v1.5")
25
+ model.save_pretrained(onnx_path)
26
+ tokenizer.save_pretrained(onnx_path)
27
+ ```