From c4bdab7992a86ce806976c9f0e23c96f6e3ae336 Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Tue, 26 Nov 2024 20:22:18 +0200 Subject: [PATCH 1/2] Fix hyperparams setting. --- bittensor_cli/cli.py | 10 ++++++++++ bittensor_cli/src/__init__.py | 22 +++++++++++++--------- bittensor_cli/src/commands/sudo.py | 5 +++-- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/bittensor_cli/cli.py b/bittensor_cli/cli.py index 26fff060..55eb4098 100755 --- a/bittensor_cli/cli.py +++ b/bittensor_cli/cli.py @@ -3904,6 +3904,16 @@ def sudo_set( ) param_name = hyperparam_list[choice - 1] + if param_name in ["alpha_high", "alpha_low"]: + param_name = "alpha_values" + low_val = FloatPrompt.ask( + "Enter the new value for [dark_orange]alpha_low[/dark_orange]" + ) + high_val = FloatPrompt.ask( + "Enter the new value for [dark_orange]alpha_high[/dark_orange]" + ) + param_value = f"{low_val},{high_val}" + if not param_value: param_value = Prompt.ask( f"Enter the new value for [dark_orange]{param_name}[/dark_orange] in the VALUE column format" diff --git a/bittensor_cli/src/__init__.py b/bittensor_cli/src/__init__.py index 8cf6aeff..a5ca2170 100644 --- a/bittensor_cli/src/__init__.py +++ b/bittensor_cli/src/__init__.py @@ -318,28 +318,32 @@ class WalletValidationTypes(Enum): HYPERPARAMS = { - "serving_rate_limit": "sudo_set_serving_rate_limit", + "rho": "sudo_set_rho", + "kappa": "sudo_set_kappa", + "immunity_period": "sudo_set_immunity_period", + "min_allowed_weights": "sudo_set_min_allowed_weights", + "max_weights_limit": "sudo_set_max_weight_limit", + "tempo": "sudo_set_tempo", "min_difficulty": "sudo_set_min_difficulty", "max_difficulty": "sudo_set_max_difficulty", "weights_version": "sudo_set_weights_version_key", "weights_rate_limit": "sudo_set_weights_set_rate_limit", - "max_weight_limit": "sudo_set_max_weight_limit", - "immunity_period": "sudo_set_immunity_period", - "min_allowed_weights": "sudo_set_min_allowed_weights", + "adjustment_interval": "sudo_set_adjustment_interval", "activity_cutoff": "sudo_set_activity_cutoff", - "network_registration_allowed": "sudo_set_network_registration_allowed", - "network_pow_registration_allowed": "sudo_set_network_pow_registration_allowed", + "target_regs_per_interval": "sudo_set_target_registrations_per_interval", "min_burn": "sudo_set_min_burn", "max_burn": "sudo_set_max_burn", + "bonds_moving_avg": "sudo_set_bonds_moving_average", + "max_regs_per_block": "sudo_set_max_registrations_per_block", + "serving_rate_limit": "sudo_set_serving_rate_limit", + "max_validators": "sudo_set_max_allowed_validators", "adjustment_alpha": "sudo_set_adjustment_alpha", - "rho": "sudo_set_rho", - "kappa": "sudo_set_kappa", "difficulty": "sudo_set_difficulty", - "bonds_moving_avg": "sudo_set_bonds_moving_average", "commit_reveal_weights_interval": "sudo_set_commit_reveal_weights_interval", "commit_reveal_weights_enabled": "sudo_set_commit_reveal_weights_enabled", "alpha_values": "sudo_set_alpha_values", "liquid_alpha_enabled": "sudo_set_liquid_alpha_enabled", + "registration_allowed": "sudo_set_network_registration_allowed", } # Help Panels for cli help diff --git a/bittensor_cli/src/commands/sudo.py b/bittensor_cli/src/commands/sudo.py index 5711a3c2..990130f3 100644 --- a/bittensor_cli/src/commands/sudo.py +++ b/bittensor_cli/src/commands/sudo.py @@ -183,14 +183,15 @@ async def sudo_set_hyperparameter( "commit_reveal_weights_enabled", "liquid_alpha_enabled", ]: - normalized_value = param_value.lower() in ["true", "1"] + normalized_value = param_value.lower() in ["true", "True", "1"] else: normalized_value = param_value is_allowed_value, value = allowed_value(param_name, normalized_value) if not is_allowed_value: err_console.print( - f"Hyperparameter {param_name} value is not within bounds. Value is {normalized_value} but must be {value}" + f"Hyperparameter [dark_orange]{param_name}[/dark_orange] value is not within bounds. " + f"Value is {normalized_value} but must be {value}" ) return From 2ca267700d953da2208ac7b31494b80c3d2b013a Mon Sep 17 00:00:00 2001 From: ibraheem-opentensor Date: Tue, 26 Nov 2024 10:45:03 -0800 Subject: [PATCH 2/2] Updates check for registration_allowed --- bittensor_cli/src/commands/sudo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bittensor_cli/src/commands/sudo.py b/bittensor_cli/src/commands/sudo.py index 990130f3..5c0057ce 100644 --- a/bittensor_cli/src/commands/sudo.py +++ b/bittensor_cli/src/commands/sudo.py @@ -178,7 +178,7 @@ async def sudo_set_hyperparameter( normalized_value: Union[str, bool] if param_name in [ - "network_registration_allowed", + "registration_allowed", "network_pow_registration_allowed", "commit_reveal_weights_enabled", "liquid_alpha_enabled",