You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
server : add support for embd_normalize parameter (ggml-org#14964)
This commit adds support for the `embd_normalize` parameter in the
server code.
The motivation for this is that currently if the server is started with
a pooling type that is not `none`, then Euclidean/L2 normalization will
be the normalization method used for embeddings. However, this is not
always the desired behavior, and users may want to use other
normalization (or none) and this commit allows that.
Example usage:
```console
curl --request POST \
--url http://localhost:8080/embedding \
--header "Content-Type: application/json" \
--data '{"input": "Hello world today", "embd_normalize": -1}
```
Copy file name to clipboardExpand all lines: tools/server/README.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -644,6 +644,15 @@ The same as [the embedding example](../embedding) does.
644
644
645
645
`image_data`: An array of objects to hold base64-encoded image `data` and its `id`s to be reference in `content`. You can determine the place of the image in the content as in the following: `Image: [img-21].\nCaption: This is a picture of a house`. In this case, `[img-21]` will be replaced by the embeddings of the image with id `21` in the following `image_data` array: `{..., "image_data": [{"data": "<BASE64_STRING>", "id": 21}]}`. Use `image_data` only with multimodal models, e.g., LLaVA.
646
646
647
+
`embd_normalize`: Normalization for pooled embeddings. Can be one of the following values:
648
+
```
649
+
-1: No normalization
650
+
0: Max absolute
651
+
1: Taxicab
652
+
2: Euclidean/L2
653
+
>2: P-Norm
654
+
```
655
+
647
656
### POST `/reranking`: Rerank documents according to a given query
648
657
649
658
Similar to https://jina.ai/reranker/ but might change in the future.
0 commit comments