Commit 41e78c5
authored
server : add support for
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}
```embd_normalize parameter (ggml-org#14964)1 parent ad4a700 commit 41e78c5
2 files changed
+22
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
647 | 656 | | |
648 | 657 | | |
649 | 658 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
141 | 144 | | |
142 | 145 | | |
143 | 146 | | |
| |||
2601 | 2604 | | |
2602 | 2605 | | |
2603 | 2606 | | |
2604 | | - | |
| 2607 | + | |
2605 | 2608 | | |
2606 | 2609 | | |
2607 | 2610 | | |
| |||
4614 | 4617 | | |
4615 | 4618 | | |
4616 | 4619 | | |
| 4620 | + | |
| 4621 | + | |
| 4622 | + | |
| 4623 | + | |
| 4624 | + | |
| 4625 | + | |
| 4626 | + | |
| 4627 | + | |
4617 | 4628 | | |
4618 | 4629 | | |
4619 | 4630 | | |
| |||
4629 | 4640 | | |
4630 | 4641 | | |
4631 | 4642 | | |
| 4643 | + | |
4632 | 4644 | | |
4633 | 4645 | | |
4634 | 4646 | | |
| |||
0 commit comments