From ca32ff064536f3e2b0e762576dfef4528151b745 Mon Sep 17 00:00:00 2001 From: Helge Hecht Date: Thu, 7 Nov 2024 14:31:02 +0100 Subject: [PATCH] added item to get explicit python scalar type --- gensim/models/keyedvectors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gensim/models/keyedvectors.py b/gensim/models/keyedvectors.py index ffb808f6cc..09035f9ff5 100644 --- a/gensim/models/keyedvectors.py +++ b/gensim/models/keyedvectors.py @@ -1977,7 +1977,7 @@ def _word2vec_read_text(fin, kv, counts, vocab_size, vector_size, datatype, unic def _word2vec_line_to_vector(line, datatype, unicode_errors, encoding): parts = utils.to_unicode(line.rstrip(), encoding=encoding, errors=unicode_errors).split(" ") - word, weights = parts[0], [datatype(x) for x in parts[1:]] + word, weights = parts[0], [datatype(x).item() for x in parts[1:]] return word, weights