Update app.py
Browse files
app.py
CHANGED
@@ -242,9 +242,12 @@ def generate_answer(query: str,
|
|
242 |
s = time.time()
|
243 |
|
244 |
if search_strategy == 'Exact Search':
|
245 |
-
|
246 |
|
247 |
-
|
|
|
|
|
|
|
248 |
else:
|
249 |
regex = build_regex_from_schema(schema, r"[\n ]?")
|
250 |
gen_text = outlines.generate.regex(llm, regex)
|
|
|
242 |
s = time.time()
|
243 |
|
244 |
if search_strategy == 'Exact Search':
|
245 |
+
scored_point = query_keywords_search(query, client, collection_name, sparse_embeddings).points[0]
|
246 |
|
247 |
+
text = scored_point.payload['text']
|
248 |
+
metadata = scored_point.payload['metadata']
|
249 |
+
|
250 |
+
answer = f"{text}\n\n\nSource :\n\n{metadata}"
|
251 |
else:
|
252 |
regex = build_regex_from_schema(schema, r"[\n ]?")
|
253 |
gen_text = outlines.generate.regex(llm, regex)
|