Update app.py
Browse files
app.py
CHANGED
@@ -157,7 +157,11 @@ def handle_pdf_upload(pdf_file):
|
|
157 |
doc_id = document_manager.add_document(pdf_file.name)
|
158 |
|
159 |
# Return updated dropdown list and the selected document ID
|
160 |
-
|
|
|
|
|
|
|
|
|
161 |
|
162 |
# Function to get PDF content based on selected document
|
163 |
def get_selected_document_content(doc_id):
|
@@ -620,7 +624,7 @@ def create_interface():
|
|
620 |
inputs=[
|
621 |
input_text, image_input, audio_input, pdf_input,
|
622 |
doc_selection, openai_api_key, reasoning_effort,
|
623 |
-
model_choice, current_pdf_content
|
624 |
],
|
625 |
outputs=[
|
626 |
input_text, image_input, audio_input, pdf_input,
|
|
|
157 |
doc_id = document_manager.add_document(pdf_file.name)
|
158 |
|
159 |
# Return updated dropdown list and the selected document ID
|
160 |
+
doc_list = document_manager.get_document_list()
|
161 |
+
# Only set the value if the list is not empty
|
162 |
+
selected_value = doc_id if doc_list else None
|
163 |
+
|
164 |
+
return doc_list, selected_value
|
165 |
|
166 |
# Function to get PDF content based on selected document
|
167 |
def get_selected_document_content(doc_id):
|
|
|
624 |
inputs=[
|
625 |
input_text, image_input, audio_input, pdf_input,
|
626 |
doc_selection, openai_api_key, reasoning_effort,
|
627 |
+
model_choice, current_pdf_content, chat_history_regular # Added chat_history_regular to avoid creating new empty list
|
628 |
],
|
629 |
outputs=[
|
630 |
input_text, image_input, audio_input, pdf_input,
|