mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-21 18:55:16 +02:00
perf: use asyncio.to_thread for embed_text in FastAPI paths
This commit is contained in:
parent
c4f2e9a3a5
commit
a49a4db6d6
4 changed files with 11 additions and 8 deletions
|
|
@ -264,7 +264,9 @@ class ConnectorService:
|
|||
# Reuse caller-provided embedding or compute once for both retrievers.
|
||||
if query_embedding is None:
|
||||
t_embed = time.perf_counter()
|
||||
query_embedding = config.embedding_model_instance.embed(query_text)
|
||||
query_embedding = await asyncio.to_thread(
|
||||
config.embedding_model_instance.embed, query_text
|
||||
)
|
||||
perf.info(
|
||||
"[connector_svc] _combined_rrf embedding in %.3fs type=%s",
|
||||
time.perf_counter() - t_embed,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue