summaryrefslogtreecommitdiff
path: root/common/common.h
diff options
context:
space:
mode:
authorSeungWon Jeong <65549245+redlion0929@users.noreply.github.com>2024-03-09 21:27:58 +0900
committerGitHub <noreply@github.com>2024-03-09 14:27:58 +0200
commitfb215c3832236fec7380c4fb618bd7154cb196ef (patch)
tree1c2d0eb8fce7d2c1f70024b1f2c7b4b35baaa029 /common/common.h
parent2c4f566c88322ebf2f9bd11b01b5ebdaa0130b89 (diff)
server : normalize embeddings (#5956)
* output normalize embedding in '/v1/embeddings' * common : reuse llama_embd_normalize * common : better normalize impl --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Diffstat (limited to 'common/common.h')
-rw-r--r--common/common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/common.h b/common/common.h
index 977ce419..f8d82b87 100644
--- a/common/common.h
+++ b/common/common.h
@@ -260,3 +260,10 @@ void dump_kv_cache_view(const llama_kv_cache_view & view, int row_size = 80);
// Dump the KV cache view showing individual sequences in each cell (long output).
void dump_kv_cache_view_seqs(const llama_kv_cache_view & view, int row_size = 40);
+
+//
+// Embedding utils
+//
+
+void llama_embd_normalize(const float * inp, float * out, int n);
+