| Model | FP32 | Task |
|---|---|---|
| bge-reranker-v2-m3 | model.onnx, model.onnx_data | text reranking |
# onnxruntime-gpu for run it on GPU
pip install onnxruntime sentencepiece numpy
Every model folder has the same layout:
src/helper.py = onnx session builder (provider selection, threads, memory options)src/example.py = full pipeline: sentencepiece tokenization, batching, inference, sigmoid scoreonnx/ = the model files: xxx.onnx (structure) and xxx.onnx_data (weight), keep them in the same folderRun the commands from the repository root.
python3 bge-reranker-v2-m3/src/example.py
0.953583 | The giant panda (Ailuropoda melanoleuca), sometimes called a panda bear, is a bear species endemic to China.
0.000279 | hi
0.994547 | パンダはクマ科の哺乳類で、中国の固有種である。
Note:
sentencepiece.bpe.model directly, with the fairseq id remap:[bos] prompt [eos] [eos] text [eos], padded per batch to the longest sequence.