KingNish commited on
Commit
f1bdb57
·
verified ·
1 Parent(s): 71f65b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -103,7 +103,10 @@ def read_document(file, clean=True):
103
 
104
  kind = filetype.guess(file_content)
105
 
106
- mime = kind.mime
 
 
 
107
 
108
  if mime == "application/pdf":
109
  # PDF Handling (unchanged)
 
103
 
104
  kind = filetype.guess(file_content)
105
 
106
+ if kind is None:
107
+ mime = "text"
108
+ else:
109
+ mime = kind.mime
110
 
111
  if mime == "application/pdf":
112
  # PDF Handling (unchanged)