CoolFace
Modelpublic

Aniemore/rubert-large-emotion-russian-cedr-m7-quantized

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes
Model Card

rubert-large-emotion-russian-cedr-m7 · quantized

Quantized builds of `Aniemore/rubert-large-emotion-russian-cedr-m7` — multi-label emotion recognition for Russian text over seven classes: anger, disgust, enthusiasm, fear, happiness, neutral, sadness.

The weights here are the published original, quantized. They were not retrained and they are not a different model.

Variants

subfolderschemeweightsROC AUC (macro)macro-F1WAUA
(original repo)fp321629 MiB0.92580.67240.83950.6610
int8W8A16774 MiB0.92600.67270.83850.6605
fp8W8A16-float766 MiB0.92640.67150.84010.6608
int4W4A16_ASYM631 MiB0.92370.67020.84540.6671

<img src="assets/quality.svg" alt="Quality after quantization" width="760">

<img src="assets/size.svg" alt="Weights on disk" width="760">

ROC AUC is listed first because the head is multi-label: macro-F1 depends on the decision threshold, which is 0.5 here because that is what the head was trained under, while ROC AUC does not.

How much this actually saves

Only Linear layers are quantized. In a BERT classifier the embedding matrix is not one of them, and on the smaller models it is most of the checkpoint &mdash; so the saving here scales with the encoder rather than with the parameter count. The large model compresses well; rubert-tiny barely moves, and the table above says so rather than quoting a ratio from the layers that did shrink.

Usage

python
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer

repo = "Aniemore/rubert-large-emotion-russian-cedr-m7-quantized"
model = AutoModelForSequenceClassification.from_pretrained(
    repo, subfolder="int8").eval()          # or "fp8", "int4"
tok = AutoTokenizer.from_pretrained(repo, subfolder="int8")

x = tok("мне сегодня очень грустно", return_tensors="pt")
with torch.no_grad():
    # multi-label: sigmoid per class, not softmax over classes
    probs = model(**x).logits.sigmoid()[0]
print({model.config.id2label[i]: round(p.item(), 3) for i, p in enumerate(probs)})

Limitations

  • —Weight-only, round-to-nearest, no calibration.
  • —Scored on the CEDR-m7 test split only. CEDR is written text; performance on transcribed speech, which carries no punctuation and no casing, is not measured here.
  • —Inherited from `ai-forever/ruBert-large`; the licence follows the base model.