diff --git a/builder/data/usr/bin/pwnlib b/builder/data/usr/bin/pwnlib index 4e78adf6..7bda613c 100755 --- a/builder/data/usr/bin/pwnlib +++ b/builder/data/usr/bin/pwnlib @@ -79,7 +79,7 @@ is_auto_mode() { # if usb0 is up, we're in MANU if is_interface_up usb0; then - return 0 + return 1 fi # if eth0 is up (for other boards), we're in MANU @@ -105,7 +105,7 @@ is_auto_mode_no_delete() { # if usb0 is up, we're in MANU if is_interface_up usb0; then - return 0 + return 1 fi # if eth0 is up (for other boards), we're in MANU diff --git a/pwnagotchi/ai/__init__.py b/pwnagotchi/ai/__init__.py index 93a4a9df..1c56d630 100644 --- a/pwnagotchi/ai/__init__.py +++ b/pwnagotchi/ai/__init__.py @@ -20,34 +20,17 @@ def load(config, agent, epoch, from_disk=True): start = time.time() SB_BACKEND = "stable_baselines3" - try: - from stable_baselines3 import A2C - logging.debug("[ai] A2C imported in %.2fs" % (time.time() - start)) + from stable_baselines3 import A2C + logging.debug("[ai] A2C imported in %.2fs" % (time.time() - start)) - start = time.time() - from stable_baselines3.a2c import MlpPolicy - logging.debug("[ai] MlpPolicy imported in %.2fs" % (time.time() - start)) - SB_A2C_POLICY = MlpPolicy + start = time.time() + from stable_baselines3.a2c import MlpPolicy + logging.debug("[ai] MlpPolicy imported in %.2fs" % (time.time() - start)) + SB_A2C_POLICY = MlpPolicy - start = time.time() - from stable_baselines3.common.vec_env import DummyVecEnv - logging.debug("[ai] DummyVecEnv imported in %.2fs" % (time.time() - start)) - - except Exception as e: - logging.debug("[ai] stable_baselines3 not accessible. Trying stable_baselines") - - from stable_baselines import A2C - logging.debug("[ai] A2C imported in %.2fs" % (time.time() - start)) - SB_BACKEND = "stable_baselines" - - start = time.time() - from stable_baselines.common.policies import MlpLstmPolicy - logging.debug("[ai] MlpLstmPolicy imported in %.2fs" % (time.time() - start)) - SB_A2C_POLICY = MlpLstmPolicy - - start = time.time() - from stable_baselines.common.vec_env import DummyVecEnv - logging.debug("[ai] DummyVecEnv imported in %.2fs" % (time.time() - start)) + start = time.time() + from stable_baselines3.common.vec_env import DummyVecEnv + logging.debug("[ai] DummyVecEnv imported in %.2fs" % (time.time() - start)) start = time.time() import pwnagotchi.ai.gym as wrappers diff --git a/pwnagotchi/ai/gym.py b/pwnagotchi/ai/gym.py index 7134628b..2af64f5f 100644 --- a/pwnagotchi/ai/gym.py +++ b/pwnagotchi/ai/gym.py @@ -9,7 +9,8 @@ from pwnagotchi.ai.parameter import Parameter class Environment(gym.Env): - metadata = {'render.modes': ['human']} + render_mode = "human" + metadata = {'render_modes': ['human']} params = [ Parameter('min_rssi', min_value=-200, max_value=-50), Parameter('ap_ttl', min_value=30, max_value=600),