diff --git a/app.py b/app.py index 8065a3d..9ee983a 100644 --- a/app.py +++ b/app.py @@ -84,11 +84,15 @@ def optimizer( difficulty_distribution = optimizer.difficulty_distribution.to_string().replace( "\n", "\n\n" ) - plot_output = optimizer.find_optimal_retention( - learn_span=365, # days to learn - max_ivl=36500, # days - loss_aversion=2.5, # forget cost is multiplied by this factor to simulate loss aversion - )[0] + try: + plot_output = optimizer.find_optimal_retention( + learn_span=365, # days to learn + max_ivl=36500, # days + loss_aversion=2.5, # forget cost is multiplied by this factor to simulate loss aversion + )[0] + except: + print("Failed to find optimal retention") + optimizer.optimal_retention = 0.9 suggested_retention_markdown = ( f"""# Suggested Retention: `{optimizer.optimal_retention:.2f}`""" )