From e65556f1748451847b1b84382348e150a200bb34 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 17 Dec 2024 13:36:32 +0200 Subject: [PATCH] server : do not normalize embeddings when there is no pooling ggml-ci --- examples/server/tests/unit/test_embedding.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/server/tests/unit/test_embedding.py b/examples/server/tests/unit/test_embedding.py index e32d74582..af6d14853 100644 --- a/examples/server/tests/unit/test_embedding.py +++ b/examples/server/tests/unit/test_embedding.py @@ -92,6 +92,10 @@ def test_embedding_pooling_none(): for x in res.body[0]['embedding']: assert abs(sum([x ** 2 for x in x]) - 1) > EPSILON + # make sure embedding vector is not normalized + for x in res.body[0]['embedding']: + assert abs(sum([x ** 2 for x in x]) - 1) > EPSILON + def test_embedding_pooling_none_oai(): global server