fix text classification for datasets 4.0.0#2292
Merged
regisss merged 1 commit intoOct 1, 2025
Merged
Conversation
gplutop7
pushed a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Oct 15, 2025
…gface#736) Co-authored-by: Grzegorz Pluto-Prondzinski <gplutopx@habana.ai>
gplutop7
pushed a commit
to HabanaAI/optimum-habana-fork
that referenced
this pull request
Nov 6, 2025
…gface#736) Co-authored-by: Grzegorz Pluto-Prondzinski <gplutopx@habana.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the requirements to enforce evaluate>=0.4.5, as older versions of the library crash during metric computation when used together with datasets>=4.0.0.
After upgrading datasets from 3.6.0 to 4.0.0, evaluation on GLUE tasks started failing with evaluate==0.4.3 (and reproducible with 0.4.4). The issue occurs inside the simple_accuracy function of the GLUE metric:
AttributeError: 'bool' object has no attribute 'mean'
The problem was observed when running MRPC evaluation with Habana trainer:
"path": "/root/optimum-habana-fork/examples/text-classification", "command": "PT_HPU_LAZY_MODE=1 python3 run_glue.py --task_name mrpc --learning_rate 3e-5 --max_seq_length 128 --output_dir ./output/mrpc/ --use_hpu_graphs_for_inference --model_name_or_path bert-large-uncased-whole-word-masking --gaudi_config_name Habana/bert-large-uncased-whole-word-masking --do_eval --per_device_eval_batch_size 8 --use_habana --use_lazy_mode --throughput_warmup_steps 3 --sdp_on_bf16 "
Upgrading to evaluate>=0.4.5 resolves the crash and restores correct metric computation.