Skip to content

Commit

Permalink
Update run_localGPT.py
Browse files Browse the repository at this point in the history
  • Loading branch information
PromtEngineer committed Feb 4, 2024
1 parent eb32658 commit 2018a08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions run_localGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,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 2018a08

Please sign in to comment.