Skip to content

Commit

Permalink
v2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BBC-Esq authored Oct 10, 2023
1 parent 25fbcc9 commit 33ebcc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ def ask_local_chatgpt(query, persist_directory=PERSIST_DIRECTORY, client_setting
embeddings = HuggingFaceInstructEmbeddings(
model_name=EMBEDDING_MODEL_NAME,
model_kwargs={"device": COMPUTE_DEVICE},
encode_kwargs={'normalize_embeddings': True}
embed_instruction="Represent the document for retrievel:",
query_instruction="Represent the question for retrieving supporting documents:"
)
elif "bge" in EMBEDDING_MODEL_NAME and "large-en-v1.5" not in EMBEDDING_MODEL_NAME:
embeddings = HuggingFaceBgeEmbeddings(
model_name=EMBEDDING_MODEL_NAME,
model_kwargs={"device": COMPUTE_DEVICE},
encode_kwargs={'normalize_embeddings': True}
query_instruction="Represent this sentence for searching relevant passages:"
)
else:
embeddings = HuggingFaceEmbeddings(
model_name=EMBEDDING_MODEL_NAME,
model_kwargs={'device': COMPUTE_DEVICE},
encode_kwargs={'normalize_embeddings': True}
)

db = Chroma(
Expand Down

0 comments on commit 33ebcc3

Please sign in to comment.