Skip to content

Commit de19a94

Browse files
authored
v8.2
1 parent ac55479 commit de19a94

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/database_interactions.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,14 @@ def create_database(self, texts, embeddings):
485485
all_texts[i] = ""
486486

487487
vectors = embeddings.embed_documents(all_texts)
488-
488+
489+
# DEBUG
490+
# print(f"DEBUG: Created {len(vectors)} vectors")
491+
# if vectors:
492+
# print(f"DEBUG: First vector shape: {len(vectors[0])}")
493+
# print(f"DEBUG: First vector sample: {vectors[0][:5]}") # Show first 5 dimensions
494+
# print(f"DEBUG: Vector norm: {np.linalg.norm(vectors[0])}")
495+
489496
embedding_end_time = time.time()
490497
embedding_elapsed = embedding_end_time - embedding_start_time
491498
my_cprint(f"Embedding computation completed in {embedding_elapsed:.2f} seconds.", "cyan")
@@ -814,6 +821,12 @@ def search(self, query, k: Optional[int] = None, score_threshold: Optional[float
814821
k = k if k is not None else int(self.config['database']['contexts'])
815822
score_threshold = score_threshold if score_threshold is not None else float(self.config['database']['similarity'])
816823

824+
# DEBUG
825+
# query_embedding = self.embeddings.embed_query(query)
826+
# print(f"DEBUG: Query embedding shape: {len(query_embedding)}")
827+
# print(f"DEBUG: Query embedding sample: {query_embedding[:5]}")
828+
# print(f"DEBUG: Query embedding norm: {np.linalg.norm(query_embedding)}")
829+
817830
relevant_contexts = self.db.similarity_search_with_score(
818831
query,
819832
k=k,

0 commit comments

Comments
 (0)