Spaces:
Runtime error
Runtime error
Commit
·
1945dae
1
Parent(s):
938f81d
Update app.py
Browse files
app.py
CHANGED
@@ -309,9 +309,12 @@ def ask_questions_abt_dataframes(file,file_ext):
|
|
309 |
|
310 |
|
311 |
def upload_file(chatbot_history,file_uploaded):
|
|
|
|
|
|
|
312 |
|
313 |
print(file_uploaded.__class__)
|
314 |
-
|
315 |
if file_ext not in ['.csv','.xlsx']:
|
316 |
build_embeddings(file_uploaded.name,file_ext)
|
317 |
else:
|
|
|
309 |
|
310 |
|
311 |
def upload_file(chatbot_history,file_uploaded):
|
312 |
+
file_ext = os.path.splitext(file_uploaded.name)[-1]
|
313 |
+
if file_ext not in ['.csv','.docx','.xlsx','.pdf','.txt']:
|
314 |
+
return chatbot_history + [(None, 'Invalid file format. We currently only csv, docx, pdf, txt, xlsx file extensions.')]
|
315 |
|
316 |
print(file_uploaded.__class__)
|
317 |
+
|
318 |
if file_ext not in ['.csv','.xlsx']:
|
319 |
build_embeddings(file_uploaded.name,file_ext)
|
320 |
else:
|