zeroshot commited on
Commit
cc0c9b7
·
1 Parent(s): 50de9b8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -1
README.md CHANGED
@@ -1,4 +1,27 @@
1
  ---
2
  license: mit
3
  ---
4
- This is the ONNX variant of the [bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) model for embeddings.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
  ---
4
+ This is the ONNX variant of the [bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5) model for embeddings created with the DeepSparse Optimum integration.
5
+
6
+ To replicate:
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-small-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(f"dense-bge-small-en-v1.5")
25
+ model.save_pretrained(onnx_path)
26
+ tokenizer.save_pretrained(onnx_path)
27
+ ```