Skip to content

Commit

Permalink
fix: ZeroDivisionError when predicting on small sample file (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
BioGeek authored Jan 21, 2025
1 parent d2b926b commit dca4423
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions instanovo/transformer/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,10 @@ def get_preds(
delta = time.time() - start

logger.info(f"Time taken for {data_path} is {delta:.1f} seconds")
logger.info(
f"Average time per batch (bs={config['batch_size']}): {delta/len(dl):.1f} seconds"
)
if len(dl) > 0:
logger.info(
f"Average time per batch (bs={config['batch_size']}): {delta/len(dl):.1f} seconds"
)

if not denovo:
pred_df["targets"] = targs
Expand Down

0 comments on commit dca4423

Please sign in to comment.