Two-digit CCM (ModernBERT) classifier (ONNX)
ONNX export of annamp/classifying-courses-at-scale-two-digit-ModernBERT-base for use in non-Python inference environments (desktop apps, embedded systems). See the source repo for training, evaluation, and citation details.
Exported via optimum-cli export onnx --task text-classification. Bit-for-bit parity with the source PyTorch model verified on a held-out corpus (100% argmax agreement; max logit diff < 1e-5).
Input format
{SUBJECT_CODE} {CATALOG_NUMBER} --- {COURSE_TITLE}
Match this format exactly at inference time.
Export pass: fp32 Neg β Mul(x, -1.0)
Every fp32 Neg node in the exported graph (the rotary rotate_half, two per layer) is rewritten to Mul(x, -1.0). ONNX Runtime's CoreML execution provider has no Neg builder, so the original export split every transformer layer into CoreML/CPU partitions around them. Neg(x) and Mul(x, -1.0) are bit-identical in IEEE float; the conversion pipeline asserts zero output difference between the original and rewritten graphs on every run. The graph carries metadata_props coreml_neg_rewrite=1. The unmodified export is the previous revision of this repo.
- Downloads last month
- 20
Model tree for robotastronaut/courses-two-digit-modernbert-base-onnx
Base model
answerdotai/ModernBERT-base