Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -140,22 +140,22 @@ def main():
|
|
140 |
st.title("Document Query App")
|
141 |
|
142 |
# Get user input for authentication method
|
143 |
-
auth_method = st.radio("Choose authentication method", ("Google Drive", "Upload Files"))
|
144 |
|
145 |
-
if auth_method == "Google Drive":
|
146 |
# Authenticate with Google Drive
|
147 |
-
drive_service = authenticate_google_drive()
|
148 |
|
149 |
# Get file IDs from user input
|
150 |
-
file_ids = st.text_input("Enter the file IDs (comma-separated):")
|
151 |
-
file_ids = [file_id.strip() for file_id in file_ids.split(",")]
|
152 |
|
153 |
# Get file contents from Google Drive
|
154 |
-
file_contents = []
|
155 |
-
for file_id in file_ids:
|
156 |
file_content = get_file_from_google_drive(drive_service, file_id)
|
157 |
file_contents.append(file_content)
|
158 |
-
else:
|
159 |
# Allow user to upload files directly
|
160 |
uploaded_files = st.file_uploader("Upload files", accept_multiple_files=True)
|
161 |
file_contents = [file.read() for file in uploaded_files]
|
|
|
140 |
st.title("Document Query App")
|
141 |
|
142 |
# Get user input for authentication method
|
143 |
+
#auth_method = st.radio("Choose authentication method", ("Google Drive", "Upload Files"))
|
144 |
|
145 |
+
#if auth_method == "Google Drive":
|
146 |
# Authenticate with Google Drive
|
147 |
+
#drive_service = authenticate_google_drive()
|
148 |
|
149 |
# Get file IDs from user input
|
150 |
+
#file_ids = st.text_input("Enter the file IDs (comma-separated):")
|
151 |
+
#file_ids = [file_id.strip() for file_id in file_ids.split(",")]
|
152 |
|
153 |
# Get file contents from Google Drive
|
154 |
+
#file_contents = []
|
155 |
+
#for file_id in file_ids:
|
156 |
file_content = get_file_from_google_drive(drive_service, file_id)
|
157 |
file_contents.append(file_content)
|
158 |
+
#else:
|
159 |
# Allow user to upload files directly
|
160 |
uploaded_files = st.file_uploader("Upload files", accept_multiple_files=True)
|
161 |
file_contents = [file.read() for file in uploaded_files]
|