Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -84,9 +84,13 @@ 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 |
-
#
|
|
|
|
|
|
|
89 |
data = file.read()
|
|
|
90 |
b64 = base64.b64encode(data.encode()).decode()
|
91 |
file_name = os.path.basename(file_path)
|
92 |
ext = os.path.splitext(file_name)[1] # get the file extension
|
|
|
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)
|
96 |
ext = os.path.splitext(file_name)[1] # get the file extension
|