Commit
·
9d6dd0f
1
Parent(s):
3a8f1fd
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,12 +41,18 @@ def get_text_file(docs):
|
|
| 41 |
filename, file_content = file_data
|
| 42 |
if isinstance(file_content, str):
|
| 43 |
process_txt_file(file_content)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
return text_list
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
|
|
|
| 50 |
def get_csv_file(docs):
|
| 51 |
text_list = []
|
| 52 |
for doc in docs:
|
|
|
|
| 41 |
filename, file_content = file_data
|
| 42 |
if isinstance(file_content, str):
|
| 43 |
process_txt_file(file_content)
|
| 44 |
+
else:
|
| 45 |
+
try:
|
| 46 |
+
process_txt_file(file_content.decode('utf-8'))
|
| 47 |
+
except AttributeError:
|
| 48 |
+
pass
|
| 49 |
|
| 50 |
return text_list
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
+
|
| 56 |
def get_csv_file(docs):
|
| 57 |
text_list = []
|
| 58 |
for doc in docs:
|