def slack_exception_notification(line, cell): try: exec(cell) except Exception as e: hostname = socket.gethostname() notify_exception(e, hostname) raise e
), ) axs[0].set_yscale("log") axs[-1].set_yscale("log") viz.mark_min_values(hist_display.axs_metrics_[0], hist_display.plots_["loss"][0]) viz.mark_min_values(hist_display.axs_metrics_[0], hist_display.plots_["val_loss"][0], txt_kwargs=dict(rotation=0)) hist_display.fig_.savefig( t2s_model.model_path / (hist_display.title + ".png"), format='png', ) history_cb.dataframe.to_csv(history_cb.csv_path, index=True) model.save(t2s_model.model_path) # # End slack.notify(f"script `{args.script_name}` on `{args.host.hostname}` finished!") except Exception as ex: slack.notify_exception(ex, args.host.hostname)