Skip to content

Restore FrugalScore compatibility with Transformers 5 - #902

Open
snygginghani wants to merge 1 commit into
huggingface:mainfrom
snygginghani:fix/frugalscore-transformers-trainer-compatibility
Open

snygginghani wants to merge 1 commit into
huggingface:mainfrom
snygginghani:fix/frugalscore-transformers-trainer-compatibility

Conversation

@snygginghani

Copy link
Copy Markdown

What changed

FrugalScore fails before running inference with Transformers 5 because TrainingArguments no longer accepts no_cuda. The same release removed the Trainer(tokenizer=...) argument, which the metric uses to select a dynamic padding collator.

Use use_cpu when available and retain no_cuda for older versions. Supply DataCollatorWithPadding directly so sentence pairs are still padded per batch. Declare the Trainer's existing Accelerate dependency in the metric Space requirements.

Validation

  • python -m pytest -q tests/test_frugalscore.py passes on Transformers 5.24.1. The regression uses a local miniature BERT model and includes a short final batch.
  • Ran the public metric compute path on CPU with the default FrugalScore TinyBERT checkpoint on Transformers 4.57.6 and 5.24.1. The scores matched direct model inference within 1e-6 on both versions. The upstream version failed with an unexpected no_cuda keyword on 5.24.1.

This change was prepared with AI assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant