Downloads · 30 days
181
30% of all-time downloads
23donge/bge-m3-zeroshot-v2.0-onnx-int8
bge-m3-zeroshot-v2.0-onnx-int8 is a zero-shot classification model from 23donge. Use it when you need labels you did not train the model on. It is set up for transformers. The card lists the license as mit.
MoritzLaurer/bge-m3-zeroshot-v2.0 的 INT8 动态量化 ONNX 版本。多语言零样本分类模型,基于 BAAI/bge-m3-retromae (XLM-RoBERTa-large)。
Downloads · 30 days
181
30% of all-time downloads
All-time downloads
613
Public
Repo size
593 MB
Likes
0
Public
Click a slice to open those files.
.onnx571 MB · 96%
From the Hugging Face model README
MoritzLaurer/bge-m3-zeroshot-v2.0 的 INT8 动态量化 ONNX 版本。多语言零样本分类模型,基于 BAAI/bge-m3-retromae (XLM-RoBERTa-large)。
INT8 dynamic quantized ONNX version of MoritzLaurer/bge-m3-zeroshot-v2.0, a multilingual zero-shot classifier.
原模型 / Original model: https://huggingface.co/MoritzLaurer/bge-m3-zeroshot-v2.0
from transformers import pipeline
classifier = pipeline("zero-shot-classification",
model="23donge/bge-m3-zeroshot-v2.0-onnx-int8")
result = classifier(
"Angela Merkel is a politician in Germany",
candidate_labels=["politics", "sports", "science"],
)
print(result)
环境: CPU 4核 (taskset -c 0-3), ONNX Runtime 1.24.4
| 指标 | fp32 ONNX | INT8 ONNX | 加速 |
|---|---|---|---|
| 模型大小 | 2,166 MB | 544 MB | 4.0x |
| 10类单条推理 | 1,535 ms | 363 ms | 4.2x |
| 5类中文单条推理 | 887 ms | 223 ms | 4.0x |
| 10条 batch 推理 | 20,194 ms | 4,888 ms | 4.1x |
结论: INT8 与 fp32 的 top-1 标签 100% 一致(全部 15 条测试),平均分数差异 0.011。
Conclusion: INT8 preserves 100% top-1 label accuracy across all 15 test prompts. Mean score difference: 0.011.
| # | Text | Label | fp32↑ | INT8↑ | Diff |
|---|---|---|---|---|---|
| 1 | How do I implement binary search in Go? | programming | 0.942 | 0.955 | 0.014 |
| 2 | The weather in Tokyo will be rainy tomorrow with highs of 22 degrees. | weather | 0.994 | 0.996 | 0.002 |
| 3 | To make authentic Italian carbonara, you need eggs, pecorino cheese, guanciale, and black pepper. | cooking | 0.971 | 0.974 | 0.003 |
| 4 | A zero-day vulnerability was discovered in the OpenSSL library affecting TLS handshakes. | security | 0.993 | 0.996 | 0.003 |
| 5 | The Eiffel Tower in Paris attracts over 7 million visitors annually. | travel | 0.810 | 0.873 | 0.063 |
| 6 | Quantum entanglement allows particles to be correlated across vast distances. | science | 0.985 | 0.983 | 0.002 |
| 7 | The S&P 500 index rose 2.3% following the Federal Reserve's interest rate decision. | finance | 0.928 | 0.909 | 0.020 |
| 8 | Active learning techniques improve student engagement and knowledge retention by up to 40%. | education | 0.997 | 0.996 | 0.001 |
| 9 | The new Marvel movie broke box office records in its opening weekend. | entertainment | 0.998 | 0.996 | 0.002 |
| 10 | Regular exercise and a balanced diet are key to maintaining cardiovascular health. | health | 0.995 | 0.997 | 0.001 |
| # | Text | Label | fp32↑ | INT8↑ | Diff |
|---|---|---|---|---|---|
| 1 | 如何在Go语言中实现二分查找? | 编程 | 0.957 | 0.914 | 0.044 |
| 2 | 明天东京天气有雨,最高气温22度。 | 天气 | 0.997 | 0.992 | 0.004 |
| 3 | 制作正宗意大利培根蛋酱意面需要鸡蛋、佩科里诺奶酪、猪脸肉和黑胡椒。 | 烹饪 | 0.986 | 0.989 | 0.003 |
| 4 | 在OpenSSL库中发现了一个影响TLS握手的零日漏洞。 | 安全 | 0.920 | 0.903 | 0.017 |
| 5 | 巴黎埃菲尔铁塔每年吸引超过700万游客。 | 旅游 | 0.984 | 0.991 | 0.007 |
License: MIT