Spaces:
Running
on
T4
Running
on
T4
error debug
Browse files- app.py +2 -1
- utils/retriever.py +2 -0
app.py
CHANGED
@@ -19,6 +19,7 @@ def create_metadata_dict(sources_input, sources_value):
|
|
19 |
This helper function creates the filter dictionary based on user input.
|
20 |
"""
|
21 |
if sources_input and sources_value:
|
|
|
22 |
return {sources_input: sources_value}
|
23 |
return None
|
24 |
|
@@ -41,7 +42,7 @@ def retrieve(
|
|
41 |
Returns:
|
42 |
list: List of dictionaries containing document content, metadata, and scores
|
43 |
"""
|
44 |
-
|
45 |
|
46 |
# Call retriever function and return raw results
|
47 |
results = get_context(
|
|
|
19 |
This helper function creates the filter dictionary based on user input.
|
20 |
"""
|
21 |
if sources_input and sources_value:
|
22 |
+
|
23 |
return {sources_input: sources_value}
|
24 |
return None
|
25 |
|
|
|
42 |
Returns:
|
43 |
list: List of dictionaries containing document content, metadata, and scores
|
44 |
"""
|
45 |
+
print(filter_metadata)
|
46 |
|
47 |
# Call retriever function and return raw results
|
48 |
results = get_context(
|
utils/retriever.py
CHANGED
@@ -204,11 +204,13 @@ def get_context(
|
|
204 |
# with_payload=True)
|
205 |
# filter support for QdrantVectorStore
|
206 |
if isinstance(vectorstore, QdrantVectorStore):
|
|
|
207 |
filter_obj = create_filter(filter_metadata)
|
208 |
if filter_obj:
|
209 |
search_kwargs["filter"] = filter_obj
|
210 |
|
211 |
# Perform initial retrieval
|
|
|
212 |
retrieved_docs = vectorstore.search(query, collection_name, top_k, **search_kwargs)
|
213 |
|
214 |
logging.info(f"Retrieved {len(retrieved_docs)} documents for query: {query[:50]}...")
|
|
|
204 |
# with_payload=True)
|
205 |
# filter support for QdrantVectorStore
|
206 |
if isinstance(vectorstore, QdrantVectorStore):
|
207 |
+
print(filter_metadata)
|
208 |
filter_obj = create_filter(filter_metadata)
|
209 |
if filter_obj:
|
210 |
search_kwargs["filter"] = filter_obj
|
211 |
|
212 |
# Perform initial retrieval
|
213 |
+
print(search_kwargs)
|
214 |
retrieved_docs = vectorstore.search(query, collection_name, top_k, **search_kwargs)
|
215 |
|
216 |
logging.info(f"Retrieved {len(retrieved_docs)} documents for query: {query[:50]}...")
|