Spaces:
Runtime error
Runtime error
freemt
commited on
Commit
·
0792e1f
1
Parent(s):
d0123e3
Update (dev) time.tzset()
Browse files
app.py
CHANGED
|
@@ -99,16 +99,17 @@ def ml_fn(
|
|
| 99 |
html = df.to_html()
|
| 100 |
|
| 101 |
dl_csv = None
|
|
|
|
| 102 |
if download_csv:
|
| 103 |
try:
|
| 104 |
dl_csv = Path("aligned-blocks.csv")
|
| 105 |
-
|
| 106 |
-
dl_csv.write_text(
|
| 107 |
ic("Saving df.to_csv to dl_csv...")
|
| 108 |
except Exception as exc:
|
| 109 |
logger.exception(exc)
|
| 110 |
|
| 111 |
-
return df, html,
|
| 112 |
|
| 113 |
|
| 114 |
mlbee = gr.Interface(
|
|
|
|
| 99 |
html = df.to_html()
|
| 100 |
|
| 101 |
dl_csv = None
|
| 102 |
+
csv_str = None
|
| 103 |
if download_csv:
|
| 104 |
try:
|
| 105 |
dl_csv = Path("aligned-blocks.csv")
|
| 106 |
+
csv_str = df.to_csv(index=False)
|
| 107 |
+
dl_csv.write_text(csv_str, encoding="utf8")
|
| 108 |
ic("Saving df.to_csv to dl_csv...")
|
| 109 |
except Exception as exc:
|
| 110 |
logger.exception(exc)
|
| 111 |
|
| 112 |
+
return df, html, csv_str
|
| 113 |
|
| 114 |
|
| 115 |
mlbee = gr.Interface(
|