Skip to content

Commit

Permalink
Fix: mean_agg returning none-serializable numpy float64 (run-llama#11458
Browse files Browse the repository at this point in the history
)
  • Loading branch information
TonyBotongChu authored and Izuki Matsuba committed Mar 29, 2024
1 parent 3d38adb commit c5f14bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llama-index-core/llama_index/core/base/embeddings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SimilarityMode(str, Enum):

def mean_agg(embeddings: List[Embedding]) -> Embedding:
"""Mean aggregation for embeddings."""
return list(np.array(embeddings).mean(axis=0))
return np.array(embeddings).mean(axis=0).tolist()


def similarity(
Expand Down

0 comments on commit c5f14bf

Please sign in to comment.