Spaces:
Runtime error
Runtime error
Upload RAG_QA_Chat_tab.py
Browse files
App_Function_Libraries/Gradio_UI/RAG_QA_Chat_tab.py
CHANGED
|
@@ -33,7 +33,7 @@ def create_rag_qa_chat_tab():
|
|
| 33 |
context_source = gr.Radio(
|
| 34 |
["All Files in the Database", "Search Database", "Upload File"],
|
| 35 |
label="Context Source",
|
| 36 |
-
value="
|
| 37 |
)
|
| 38 |
existing_file = gr.Dropdown(label="Select Existing File", choices=[], interactive=True)
|
| 39 |
file_page = gr.State(value=1)
|
|
@@ -104,7 +104,7 @@ def create_rag_qa_chat_tab():
|
|
| 104 |
|
| 105 |
loading_indicator = gr.HTML(visible=False)
|
| 106 |
|
| 107 |
-
def rag_qa_chat_wrapper(message, history, context_source, search_results, file_upload,
|
| 108 |
convert_to_text, keywords, api_choice):
|
| 109 |
try:
|
| 110 |
logging.info(f"Starting rag_qa_chat_wrapper with message: {message}")
|
|
@@ -127,7 +127,7 @@ def create_rag_qa_chat_tab():
|
|
| 127 |
rephrased_question = message
|
| 128 |
logging.info(f"First question, no rephrasing: {message}")
|
| 129 |
|
| 130 |
-
if context_source == "
|
| 131 |
# Use the enhanced_rag_pipeline to search the entire database
|
| 132 |
context = enhanced_rag_pipeline(rephrased_question, api_choice)
|
| 133 |
logging.info(f"Using enhanced_rag_pipeline for database search")
|
|
|
|
| 33 |
context_source = gr.Radio(
|
| 34 |
["All Files in the Database", "Search Database", "Upload File"],
|
| 35 |
label="Context Source",
|
| 36 |
+
value="All Files in the Database"
|
| 37 |
)
|
| 38 |
existing_file = gr.Dropdown(label="Select Existing File", choices=[], interactive=True)
|
| 39 |
file_page = gr.State(value=1)
|
|
|
|
| 104 |
|
| 105 |
loading_indicator = gr.HTML(visible=False)
|
| 106 |
|
| 107 |
+
def rag_qa_chat_wrapper(message, history, context_source, existing_file, search_results, file_upload,
|
| 108 |
convert_to_text, keywords, api_choice):
|
| 109 |
try:
|
| 110 |
logging.info(f"Starting rag_qa_chat_wrapper with message: {message}")
|
|
|
|
| 127 |
rephrased_question = message
|
| 128 |
logging.info(f"First question, no rephrasing: {message}")
|
| 129 |
|
| 130 |
+
if context_source == "All Files in the Database":
|
| 131 |
# Use the enhanced_rag_pipeline to search the entire database
|
| 132 |
context = enhanced_rag_pipeline(rephrased_question, api_choice)
|
| 133 |
logging.info(f"Using enhanced_rag_pipeline for database search")
|