Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -138,7 +138,7 @@ def main():
|
|
| 138 |
doc_list = []
|
| 139 |
|
| 140 |
for file in docs:
|
| 141 |
-
print('
|
| 142 |
if file.type == 'text/plain':
|
| 143 |
# file is .txt
|
| 144 |
doc_list.extend(get_text_file(file))
|
|
@@ -151,6 +151,8 @@ def main():
|
|
| 151 |
elif file.type == 'application/json':
|
| 152 |
# file is .json
|
| 153 |
doc_list.extend(get_json_file(file))
|
|
|
|
|
|
|
| 154 |
|
| 155 |
# get the text chunks
|
| 156 |
text_chunks = get_text_chunks(doc_list)
|
|
|
|
| 138 |
doc_list = []
|
| 139 |
|
| 140 |
for file in docs:
|
| 141 |
+
print('File type:', file.type) # Add this line for debugging
|
| 142 |
if file.type == 'text/plain':
|
| 143 |
# file is .txt
|
| 144 |
doc_list.extend(get_text_file(file))
|
|
|
|
| 151 |
elif file.type == 'application/json':
|
| 152 |
# file is .json
|
| 153 |
doc_list.extend(get_json_file(file))
|
| 154 |
+
else:
|
| 155 |
+
print('Unsupported file type:', file.type) # Add this line for debugging unsupported types
|
| 156 |
|
| 157 |
# get the text chunks
|
| 158 |
text_chunks = get_text_chunks(doc_list)
|