Skip to content

Commit

Permalink
add dims to server
Browse files Browse the repository at this point in the history
  • Loading branch information
wirthual committed Dec 6, 2024
1 parent d8ad010 commit 1de6c52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libs/infinity_emb/infinity_emb/infinity_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1de6c52

Please sign in to comment.