Spaces:
Paused
Paused
Fixed logging with multiple inputs
Browse files
app.py
CHANGED
@@ -115,7 +115,7 @@ def get_results_from_pinecone(query, top_k=3, re_rank=True, verbose=True):
|
|
115 |
return []
|
116 |
|
117 |
if verbose:
|
118 |
-
logging.info("Query:
|
119 |
|
120 |
final_results = []
|
121 |
|
@@ -354,7 +354,7 @@ def text_to_text_generation(verbose, prompt):
|
|
354 |
modes = ["Kubectl command", "Kubernetes related", "Other"]
|
355 |
|
356 |
logging.info(f'{" Query Start ":-^40}')
|
357 |
-
logging.info("Classified as:
|
358 |
|
359 |
modes[response_num] = f"**{modes[response_num]}**"
|
360 |
modes = " / ".join(modes)
|
@@ -422,16 +422,16 @@ def text_to_text_generation(verbose, prompt):
|
|
422 |
res_prompt, res_semantic_search_prompt, res_google_search_prompt
|
423 |
)
|
424 |
|
425 |
-
logging.info("SEMANTIC BEFORE CLEANUP:
|
426 |
-
logging.info("GOOGLE BEFORE CLEANUP:
|
427 |
|
428 |
|
429 |
res_prompt, res_normal = cleanup(*gen_normal)
|
430 |
res_semantic_search_prompt, res_semantic_search = cleanup(*gen_semantic_search)
|
431 |
res_google_search_prompt, res_google_search = cleanup(*gen_google_search)
|
432 |
|
433 |
-
logging.info("SEMANTIC AFTER CLEANUP:
|
434 |
-
logging.info("GOOGLE AFTER CLEANUP:
|
435 |
|
436 |
if verbose:
|
437 |
return (
|
|
|
115 |
return []
|
116 |
|
117 |
if verbose:
|
118 |
+
logging.info(f"Query: {query}")
|
119 |
|
120 |
final_results = []
|
121 |
|
|
|
354 |
modes = ["Kubectl command", "Kubernetes related", "Other"]
|
355 |
|
356 |
logging.info(f'{" Query Start ":-^40}')
|
357 |
+
logging.info(f"Classified as: {modes[response_num]}")
|
358 |
|
359 |
modes[response_num] = f"**{modes[response_num]}**"
|
360 |
modes = " / ".join(modes)
|
|
|
422 |
res_prompt, res_semantic_search_prompt, res_google_search_prompt
|
423 |
)
|
424 |
|
425 |
+
logging.info(f"SEMANTIC BEFORE CLEANUP: {str(gen_semantic_search)}")
|
426 |
+
logging.info(f"GOOGLE BEFORE CLEANUP: {str(gen_google_search)}")
|
427 |
|
428 |
|
429 |
res_prompt, res_normal = cleanup(*gen_normal)
|
430 |
res_semantic_search_prompt, res_semantic_search = cleanup(*gen_semantic_search)
|
431 |
res_google_search_prompt, res_google_search = cleanup(*gen_google_search)
|
432 |
|
433 |
+
logging.info(f"SEMANTIC AFTER CLEANUP: {str(res_semantic_search)}")
|
434 |
+
logging.info(f"GOOGLE AFTER CLEANUP: {str(res_google_search)}")
|
435 |
|
436 |
if verbose:
|
437 |
return (
|