CoolFace
Modelpublic

robotastronaut/courses-two-digit-modernbert-base-onnx

sourceHugging Facemitupdated 28d agoView on Hugging Face
0likes24downloads
Model Card

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

{SUBJECTCODE} {CATALOGNUMBER} --- {COURSE_TITLE}

Match this format exactly at inference time.

Export pass: fp32 NegMul(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.