diff --git a/fastembed/sparse/sparse_embedding_base.py b/fastembed/sparse/sparse_embedding_base.py index ea9a4907..ac497f5a 100644 --- a/fastembed/sparse/sparse_embedding_base.py +++ b/fastembed/sparse/sparse_embedding_base.py @@ -26,7 +26,7 @@ def as_dict(self) -> dict[int, float]: @classmethod def from_dict(cls, data: dict[int, float]) -> "SparseEmbedding": if len(data) == 0: - return cls(values=np.array([]), indices=np.array([])) + return cls(values=np.array([]), indices=np.array([], dtype=np.int64)) indices, values = zip(*data.items()) return cls(values=np.array(values), indices=np.array(indices))