lfm25-encoder-agnews-smoke

LiquidAI/LFM2.5-Encoder-350M fine-tuned for single-label text classification on fancyzhx/ag_news.

  • Labels (4): World, Sports, Business, Sci/Tech
  • Date: 2026-07-28 16:37 UTC

This model uses a custom classification head (mean pooling over a backbone without a native sequence-classification class), so loading requires trust_remote_code=True. vLLM serving requires a standard architecture.

Evaluation

Metric Value
accuracy 0.7575
f1_macro 0.7568

Usage

from transformers import AutoModelForSequenceClassification, AutoTokenizer

model = AutoModelForSequenceClassification.from_pretrained("davanstrien/lfm25-encoder-agnews-smoke", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("davanstrien/lfm25-encoder-agnews-smoke", trust_remote_code=True)

inputs = tokenizer("your text here", return_tensors="pt", truncation=True)
print(model.config.id2label[model(**inputs).logits.argmax().item()])

Reproduction

Produced on Hugging Face Jobs (gpu) with the train-classifier.py recipe from uv-scripts. Run it yourself:

hf jobs uv run --flavor gpu --secrets HF_TOKEN \
    https://huggingface.co/datasets/uv-scripts/classification/raw/main/train-classifier.py \
    fancyzhx/ag_news davanstrien/lfm25-encoder-agnews-smoke
Downloads last month
46
Safetensors
Model size
0.4B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for davanstrien/lfm25-encoder-agnews-smoke

Finetuned
(17)
this model

Dataset used to train davanstrien/lfm25-encoder-agnews-smoke