Update app.py
Browse files
app.py
CHANGED
@@ -97,8 +97,13 @@ def get_rag_results(prompt):
|
|
97 |
|
98 |
response, additional_metadata = clean_pinecone(response)
|
99 |
print("Here is the pinecone response:", response)
|
100 |
-
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
return response, additional_metadata
|
104 |
|
|
|
97 |
|
98 |
response, additional_metadata = clean_pinecone(response)
|
99 |
print("Here is the pinecone response:", response)
|
100 |
+
if len(response) < 1:
|
101 |
+
response = "No classes were found that matched your criteria"
|
102 |
+
additional_metadata = "None"
|
103 |
+
else:
|
104 |
+
response = reranker(query, response) # BERT cross encoder for ranking
|
105 |
+
print("Here is the response from the reranker", response)
|
106 |
+
|
107 |
|
108 |
return response, additional_metadata
|
109 |
|