From 1de6c5278fa94b1c7c3cbc03027fdd1e9b1b2bb1 Mon Sep 17 00:00:00 2001 From: wirthual Date: Fri, 6 Dec 2024 17:46:22 +0100 Subject: [PATCH] add dims to server --- libs/infinity_emb/infinity_emb/infinity_server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/infinity_emb/infinity_emb/infinity_server.py b/libs/infinity_emb/infinity_emb/infinity_server.py index 0ac1c835..582d7fa3 100644 --- a/libs/infinity_emb/infinity_emb/infinity_server.py +++ b/libs/infinity_emb/infinity_emb/infinity_server.py @@ -354,21 +354,21 @@ def url_to_base64(url, modality = "image"): "[📝] Received request with %s input texts ", len(input_), # type: ignore ) - embedding, usage = await engine.embed(sentences=input_) + embedding, usage = await engine.embed(sentences=input_,matryoshka_dim=data_root.dimensions) elif modality == Modality.audio: urls_or_bytes = _resolve_mixed_input(data_root.input) # type: ignore logger.debug( "[📝] Received request with %s input audios ", len(urls_or_bytes), # type: ignore ) - embedding, usage = await engine.audio_embed(audios=urls_or_bytes) + embedding, usage = await engine.audio_embed(audios=urls_or_bytes,matryoshka_dim=data_root.dimensions) elif modality == Modality.image: urls_or_bytes = _resolve_mixed_input(data_root.input) # type: ignore logger.debug( "[📝] Received request with %s input images ", len(urls_or_bytes), # type: ignore ) - embedding, usage = await engine.image_embed(images=urls_or_bytes) + embedding, usage = await engine.image_embed(images=urls_or_bytes,matryoshka_dim=data_root.dimensions) duration = (time.perf_counter() - start) * 1000 logger.debug("[✅] Done in %s ms", duration)