From 3d03565498f761f47b3f84d32305c6cdf2ab0768 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 14 Sep 2024 12:55:53 +0200 Subject: [PATCH] Replace numpy floats in evaluate and update --- spacy/language.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/language.py b/spacy/language.py index f2303c10c..3a86f1b9b 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -1214,7 +1214,7 @@ class Language: examples, ): eg.predicted = doc - return losses + return _replace_numpy_floats(losses) def rehearse( self, @@ -1465,7 +1465,7 @@ class Language: results = scorer.score(examples, per_component=per_component) n_words = sum(len(eg.predicted) for eg in examples) results["speed"] = n_words / (end_time - start_time) - return results + return _replace_numpy_floats(results) def create_optimizer(self): """Create an optimizer, usually using the [training.optimizer] config."""