Moved warmup_encoders into scope (#1978)

This commit is contained in:
hagen-danswer
2024-07-30 09:37:32 -07:00
committed by GitHub
parent e4b1f5b963
commit d151082871

View File

@ -349,16 +349,16 @@ def update_loop(
check_index_swap(db_session=db_session) check_index_swap(db_session=db_session)
db_embedding_model = get_current_db_embedding_model(db_session) db_embedding_model = get_current_db_embedding_model(db_session)
# So that the first time users aren't surprised by really slow speed of first # So that the first time users aren't surprised by really slow speed of first
# batch of documents indexed # batch of documents indexed
if db_embedding_model.cloud_provider_id is None: if db_embedding_model.cloud_provider_id is None:
logger.info("Running a first inference to warm up embedding model") logger.info("Running a first inference to warm up embedding model")
warm_up_encoders( warm_up_encoders(
embedding_model=db_embedding_model, embedding_model=db_embedding_model,
model_server_host=INDEXING_MODEL_SERVER_HOST, model_server_host=INDEXING_MODEL_SERVER_HOST,
model_server_port=MODEL_SERVER_PORT, model_server_port=MODEL_SERVER_PORT,
) )
client_primary: Client | SimpleJobClient client_primary: Client | SimpleJobClient
client_secondary: Client | SimpleJobClient client_secondary: Client | SimpleJobClient