Skip to content

Commit

Permalink
Update ingest.py
Browse files Browse the repository at this point in the history
compute_deivce has been replaced with device_type
  • Loading branch information
PromtEngineer committed Feb 4, 2024
1 parent c70d068 commit eb32658
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ingest.py
Expand Up @@ -164,22 +164,22 @@ def get_embeddings():
if "instructor" in EMBEDDING_MODEL_NAME:
return HuggingFaceInstructEmbeddings(
model_name=EMBEDDING_MODEL_NAME,
model_kwargs={"device": compute_device},
model_kwargs={"device": device_type},
embed_instruction='Represent the document for retrieval:',
query_instruction='Represent the question for retrieving supporting documents:'
)

elif "bge" in EMBEDDING_MODEL_NAME:
return HuggingFaceBgeEmbeddings(
model_name=EMBEDDING_MODEL_NAME,
model_kwargs={"device": compute_device},
model_kwargs={"device": device_type},
query_instruction='Represent this sentence for searching relevant passages:'
)

else:
return HuggingFaceEmbeddings(
model_name=EMBEDDING_MODEL_NAME,
model_kwargs={"device": compute_device},
model_kwargs={"device": device_type},
)
embeddings = get_embeddings()
logging.info(f"Loaded embeddings from {EMBEDDING_MODEL_NAME}")
Expand Down

0 comments on commit eb32658

Please sign in to comment.