awacke1 commited on
Commit
ea01ebf
·
1 Parent(s): ce8e27d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -84,12 +84,15 @@ def divide_document(document, max_length):
84
  return [document[i:i+max_length] for i in range(0, len(document), max_length)]
85
 
86
  def get_table_download_link(file_path):
87
- #with open(file_path, 'r') as file:
 
 
 
 
 
 
 
88
  # data = file.read()
89
-
90
- import codecs
91
- with codecs.open(file_path, "r", "utf-8") as file:
92
- data = file.read()
93
 
94
  b64 = base64.b64encode(data.encode()).decode()
95
  file_name = os.path.basename(file_path)
 
84
  return [document[i:i+max_length] for i in range(0, len(document), max_length)]
85
 
86
  def get_table_download_link(file_path):
87
+ with open(file_path, 'r') as file:
88
+ try:
89
+ data = file.read()
90
+ except:
91
+ st.write('')
92
+ return file_path
93
+ #import codecs
94
+ #with codecs.open(file_path, "r", "utf-8") as file:
95
  # data = file.read()
 
 
 
 
96
 
97
  b64 = base64.b64encode(data.encode()).decode()
98
  file_name = os.path.basename(file_path)