Skip to content

Commit 31adc4c

Browse files
Fix hyperparams setting. (#252)
* Fix hyperparams setting. * Updates check for registration_allowed --------- Co-authored-by: ibraheem-opentensor <ibraheem@opentensor.dev>
1 parent 233fd05 commit 31adc4c

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

bittensor_cli/cli.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3904,6 +3904,16 @@ def sudo_set(
39043904
)
39053905
param_name = hyperparam_list[choice - 1]
39063906

3907+
if param_name in ["alpha_high", "alpha_low"]:
3908+
param_name = "alpha_values"
3909+
low_val = FloatPrompt.ask(
3910+
"Enter the new value for [dark_orange]alpha_low[/dark_orange]"
3911+
)
3912+
high_val = FloatPrompt.ask(
3913+
"Enter the new value for [dark_orange]alpha_high[/dark_orange]"
3914+
)
3915+
param_value = f"{low_val},{high_val}"
3916+
39073917
if not param_value:
39083918
param_value = Prompt.ask(
39093919
f"Enter the new value for [dark_orange]{param_name}[/dark_orange] in the VALUE column format"

bittensor_cli/src/__init__.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,28 +318,32 @@ class WalletValidationTypes(Enum):
318318

319319

320320
HYPERPARAMS = {
321-
"serving_rate_limit": "sudo_set_serving_rate_limit",
321+
"rho": "sudo_set_rho",
322+
"kappa": "sudo_set_kappa",
323+
"immunity_period": "sudo_set_immunity_period",
324+
"min_allowed_weights": "sudo_set_min_allowed_weights",
325+
"max_weights_limit": "sudo_set_max_weight_limit",
326+
"tempo": "sudo_set_tempo",
322327
"min_difficulty": "sudo_set_min_difficulty",
323328
"max_difficulty": "sudo_set_max_difficulty",
324329
"weights_version": "sudo_set_weights_version_key",
325330
"weights_rate_limit": "sudo_set_weights_set_rate_limit",
326-
"max_weight_limit": "sudo_set_max_weight_limit",
327-
"immunity_period": "sudo_set_immunity_period",
328-
"min_allowed_weights": "sudo_set_min_allowed_weights",
331+
"adjustment_interval": "sudo_set_adjustment_interval",
329332
"activity_cutoff": "sudo_set_activity_cutoff",
330-
"network_registration_allowed": "sudo_set_network_registration_allowed",
331-
"network_pow_registration_allowed": "sudo_set_network_pow_registration_allowed",
333+
"target_regs_per_interval": "sudo_set_target_registrations_per_interval",
332334
"min_burn": "sudo_set_min_burn",
333335
"max_burn": "sudo_set_max_burn",
336+
"bonds_moving_avg": "sudo_set_bonds_moving_average",
337+
"max_regs_per_block": "sudo_set_max_registrations_per_block",
338+
"serving_rate_limit": "sudo_set_serving_rate_limit",
339+
"max_validators": "sudo_set_max_allowed_validators",
334340
"adjustment_alpha": "sudo_set_adjustment_alpha",
335-
"rho": "sudo_set_rho",
336-
"kappa": "sudo_set_kappa",
337341
"difficulty": "sudo_set_difficulty",
338-
"bonds_moving_avg": "sudo_set_bonds_moving_average",
339342
"commit_reveal_weights_interval": "sudo_set_commit_reveal_weights_interval",
340343
"commit_reveal_weights_enabled": "sudo_set_commit_reveal_weights_enabled",
341344
"alpha_values": "sudo_set_alpha_values",
342345
"liquid_alpha_enabled": "sudo_set_liquid_alpha_enabled",
346+
"registration_allowed": "sudo_set_network_registration_allowed",
343347
}
344348

345349
# Help Panels for cli help

bittensor_cli/src/commands/sudo.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,20 @@ async def sudo_set_hyperparameter(
178178

179179
normalized_value: Union[str, bool]
180180
if param_name in [
181-
"network_registration_allowed",
181+
"registration_allowed",
182182
"network_pow_registration_allowed",
183183
"commit_reveal_weights_enabled",
184184
"liquid_alpha_enabled",
185185
]:
186-
normalized_value = param_value.lower() in ["true", "1"]
186+
normalized_value = param_value.lower() in ["true", "True", "1"]
187187
else:
188188
normalized_value = param_value
189189

190190
is_allowed_value, value = allowed_value(param_name, normalized_value)
191191
if not is_allowed_value:
192192
err_console.print(
193-
f"Hyperparameter {param_name} value is not within bounds. Value is {normalized_value} but must be {value}"
193+
f"Hyperparameter [dark_orange]{param_name}[/dark_orange] value is not within bounds. "
194+
f"Value is {normalized_value} but must be {value}"
194195
)
195196
return
196197

0 commit comments

Comments
 (0)