huggingface / evaluate

🤗 Evaluate: A library for easily evaluating machine learning models and datasets.
https://huggingface.co/docs/evaluate
Apache License 2.0
1.9k stars 235 forks source link

Add raw pyarrow type check message for `EvaluationModule` #584

Open shenxiangzhuang opened 2 months ago

shenxiangzhuang commented 2 months ago

Return more friendly error msg to help address error like #550 #585 quickly.

This will add a raw pyarrow error message in the last line, with example like:

ValueError: Predictions and/or references don't match the expected format.
Expected format: {'predictions': Value(dtype='float32', id=None), 'references': Value(dtype='float32', id=None)},
Input predictions: [[0.86903241 0.21559055]
...
Input references: [[0.28399844 0.26635692]
...

+ The original pyarrow error: only length-1 arrays can be converted to Python scalars