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

New JSON encoder for results containing numpy types #598

Open jpodivin opened 1 month ago

jpodivin commented 1 month ago

Existing setup fails with TypeError: Object of type int64 is not JSON serializable if the dictionary contains objects with numpy types. This is fairly common situation so new Encoder is necessary to allow proper result saving.