返回模型
说明文档
gibberish_detector_onnx: 量化 avx2
# pip install 'optimum[onnxruntime,exporters]'
from optimum.pipelines import pipeline
classifier = pipeline(
\"text-classification\",
model=\"pszemraj/gibberish_detector_onnx-quant-avx2\",
accelerator=\"ort\",
)
classifier(\"ayy waddup\")
# [{'label': 'noise', 'score': 0.38642483949661255}]
量化参数的区别
带有 -pc 后缀的表示 per_channel=True
>>> src = 'quant_onnx_gibberish_detector' # avx2
>>> classifier = pipeline('text-classification', model=src, accelerator='ort')
>>> classifier('ayy waddup')
[{'label': 'noise', 'score': 0.34829846024513245}]
>>> src = 'quant_onnx_gibberish_detector-pc' # avx2 per channel (this model)
>>> classifier = pipeline('text-classification', model=src, accelerator='ort')
>>> classifier('ayy waddup')
[{'label': 'noise', 'score': 0.38642483949661255}]
>>> src = 'onnx_gibberish_detector' # unquantized onnx
>>> classifier = pipeline('text-classification', model=src, accelerator='ort')
>>> classifier('ayy waddup')
[{'label': 'noise', 'score': 0.6847617626190186}]
pszemraj/gibberish_detector_onnx-quant-avx2
作者 pszemraj
text-classification
transformers
↓ 1
♥ 0
创建时间: 2024-02-21 23:52:26+00:00
更新时间: 2025-12-29 03:52:51+00:00
在 Hugging Face 上查看文件 (9)
.gitattributes
README.md
config.json
model_quantized.onnx
ONNX
ort_config.json
special_tokens_map.json
tokenizer.json
tokenizer_config.json
vocab.txt