freemt commited on
Commit
fc2ede0
·
1 Parent(s): 04c07b4

Update (dev) dl_csv

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -68,7 +68,7 @@ def ml_fn(
68
  aset = cmat2aset(cmat)
69
 
70
  _ = len(paras1) + len(paras2)
71
- av = t.duration / _ * 1000
72
  logger.info(" %s blocks, took %s, av. %s s/1000 blk", _, t.duration_human, av)
73
 
74
  pairs = aset2pairs(paras1, paras2, aset)
@@ -79,10 +79,13 @@ def ml_fn(
79
  html = df.to_html()
80
 
81
  dl_csv = None
82
- if download_csv:
83
- filepath = Path("aligned-blocks.csv")
84
- _ = df.to_csv(index=False)
85
- dl_csv = filepath.write_text(_, encoding="utf8")
 
 
 
86
 
87
  # return pd.DataFrame([["", "", ""]])
88
  # return df.to_html()
 
68
  aset = cmat2aset(cmat)
69
 
70
  _ = len(paras1) + len(paras2)
71
+ av = f"{t.duration / _ * 1000:.2f}"
72
  logger.info(" %s blocks, took %s, av. %s s/1000 blk", _, t.duration_human, av)
73
 
74
  pairs = aset2pairs(paras1, paras2, aset)
 
79
  html = df.to_html()
80
 
81
  dl_csv = None
82
+ try:
83
+ if download_csv:
84
+ dl_csv = Path("aligned-blocks.csv")
85
+ _ = df.to_csv(index=False)
86
+ dl_csv.write_text(_, encoding="utf8")
87
+ except Exception as exc:
88
+ logger.exception(exc)
89
 
90
  # return pd.DataFrame([["", "", ""]])
91
  # return df.to_html()