Spaces:
Runtime error
Runtime error
ceckenrode
commited on
Commit
•
c2665e5
1
Parent(s):
605bb46
Update app.py
Browse files
app.py
CHANGED
@@ -143,13 +143,12 @@ def append_file(file_path, content):
|
|
143 |
except:
|
144 |
return "Error occurred while appending to file."
|
145 |
|
146 |
-
def download_csv(file_path
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
return "Error occurred while downloading file."
|
153 |
|
154 |
title = """<h1 align="center">Memory Chat Story Generator ChatGPT</h1>"""
|
155 |
description = """
|
|
|
143 |
except:
|
144 |
return "Error occurred while appending to file."
|
145 |
|
146 |
+
def download_csv(file_path):
|
147 |
+
with open(file_path, "rb") as f:
|
148 |
+
contents = f.read()
|
149 |
+
b64 = base64.b64encode(contents).decode()
|
150 |
+
href = f'<a href="data:application/octet-stream;base64,{b64}" download="{file_path}">Download</a>'
|
151 |
+
return href
|
|
|
152 |
|
153 |
title = """<h1 align="center">Memory Chat Story Generator ChatGPT</h1>"""
|
154 |
description = """
|