From 8b00e0ae106740df4ce02fad912e487e3b3d9880 Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Fri, 25 Oct 2019 12:17:44 +0200 Subject: [PATCH] misc: small fix or general refactoring i did not bother commenting --- pwnagotchi/ai/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pwnagotchi/ai/__init__.py b/pwnagotchi/ai/__init__.py index 4dbdc9b..d2cf186 100644 --- a/pwnagotchi/ai/__init__.py +++ b/pwnagotchi/ai/__init__.py @@ -16,6 +16,8 @@ def load(config, agent, epoch, from_disk=True): return False try: + begin = time.time() + logging.info("[ai] bootstrapping dependencies ...") start = time.time() @@ -53,8 +55,11 @@ def load(config, agent, epoch, from_disk=True): for key, value in config['params'].items(): logging.info(" %s: %s" % (key, value)) + logging.debug("[ai] total loading time is %.2fs" % (time.time() - begin)) + return a2c except Exception as e: logging.exception("error while starting AI") + logging.warning("[ai] AI not loaded!") return False