From dc7056900c6c4569a0e6a204f501f7fb92940c07 Mon Sep 17 00:00:00 2001 From: Dev Aggarwal Date: Mon, 12 Feb 2024 13:04:00 +0530 Subject: [PATCH] fix expand gdrive folders and accept_multiple_files clash --- daras_ai_v2/doc_search_settings_widgets.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/daras_ai_v2/doc_search_settings_widgets.py b/daras_ai_v2/doc_search_settings_widgets.py index a64572b99..fb69f22a9 100644 --- a/daras_ai_v2/doc_search_settings_widgets.py +++ b/daras_ai_v2/doc_search_settings_widgets.py @@ -78,11 +78,12 @@ def document_uploader( ) st.checkbox("Submit Links in Bulk", key=f"__custom_checkbox_{key}") documents = st.session_state.get(key, []) - try: - documents = list(_expand_gdrive_folders(documents)) - except Exception as e: - capture_exception(e) - st.error(f"Error expanding gdrive folders: {e}") + if accept_multiple_files: + try: + documents = list(_expand_gdrive_folders(documents)) + except Exception as e: + capture_exception(e) + st.error(f"Error expanding gdrive folders: {e}") st.session_state[key] = documents st.session_state[custom_key] = "\n".join(documents) return documents