Update README.md
Browse filesadd important download info
README.md
CHANGED
@@ -11,7 +11,23 @@ This is `bge-m3-onnx-o4` weights of the original [`BAAI/bge-m3`](https://hugging
|
|
11 |
- [x] Multi-Linguality: It can support more than **100** working languages.
|
12 |
- [x] Multi-Granularity: It is able to process inputs of different granularities, spanning from short sentences to long documents of up to **8192** tokens.
|
13 |
|
14 |
-
## Usage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
### Dense Retrieval
|
17 |
|
@@ -26,7 +42,8 @@ from optimum.onnxruntime import ORTModelForFeatureExtraction
|
|
26 |
from transformers import AutoTokenizer
|
27 |
import torch
|
28 |
|
29 |
-
model
|
|
|
30 |
tokenizer = AutoTokenizer.from_pretrained("hooman650/bge-m3-onnx-o4")
|
31 |
|
32 |
sentences = [
|
|
|
11 |
- [x] Multi-Linguality: It can support more than **100** working languages.
|
12 |
- [x] Multi-Granularity: It is able to process inputs of different granularities, spanning from short sentences to long documents of up to **8192** tokens.
|
13 |
|
14 |
+
## Usage
|
15 |
+
|
16 |
+
### IMPORTANT - DOWNLOAD MODEL WEIGHTS
|
17 |
+
|
18 |
+
Please see the instructions below.
|
19 |
+
|
20 |
+
1. **Download** the checkpoint: For some reason you cannot directly load from this online version (you will get an exception).
|
21 |
+
Please download this repo as below:
|
22 |
+
|
23 |
+
```
|
24 |
+
# pip install huggingface-hub
|
25 |
+
|
26 |
+
from huggingface_hub import snapshot_download
|
27 |
+
|
28 |
+
snapshot_download(repo_id="hooman650/bge-m3-onnx-o4",local_dir="bge-m3-onnx")
|
29 |
+
```
|
30 |
+
|
31 |
|
32 |
### Dense Retrieval
|
33 |
|
|
|
42 |
from transformers import AutoTokenizer
|
43 |
import torch
|
44 |
|
45 |
+
# Make sure that you download the model weights locally to `bge-m3-onnx`
|
46 |
+
model = ORTModelForFeatureExtraction.from_pretrained("bge-m3-onnx", provider="CUDAExecutionProvider") # omit provider for CPU usage.
|
47 |
tokenizer = AutoTokenizer.from_pretrained("hooman650/bge-m3-onnx-o4")
|
48 |
|
49 |
sentences = [
|