Skip to content

Commit

Permalink
Revert "Feat/thewhaleking/galina fixes (#70)" (#71)
Browse files Browse the repository at this point in the history
This reverts commit 5ee922b.
  • Loading branch information
ibraheem-opentensor authored Sep 13, 2024
1 parent 5ee922b commit 171f38c
Showing 1 changed file with 63 additions and 32 deletions.
95 changes: 63 additions & 32 deletions bittensor_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Options:
wallet_name = typer.Option(
None,
"--wallet-name",
"--name",
"-w",
"--wallet_name",
"--wallet.name",
help="Name of wallet",
Expand Down Expand Up @@ -135,20 +135,10 @@ class Options:
netuids = typer.Option(
[], "--netuids", "-n", help="Set the netuid(s) to filter by (e.g. `0 1 2`)"
)
netuid = (
typer.Option(
None,
help="The netuid (network unique identifier) of the subnet within the root network, (e.g. 1)",
prompt=True,
),
)
weights = (
typer.Option(
[],
"--weights",
"-w",
help="Corresponding weights for the specified UIDs, e.g. `-w 0.2 -w 0.4 -w 0.1 ...",
),
netuid = typer.Option(
None,
help="The netuid (network unique identifier) of the subnet within the root network, (e.g. 1)",
prompt=True,
)
reuse_last = typer.Option(
False,
Expand Down Expand Up @@ -741,11 +731,44 @@ def metagraph_config(

def set_config(
self,
wallet_name: Optional[str] = Options.wallet_name,
wallet_path: Optional[str] = Options.wallet_path,
wallet_hotkey: Optional[str] = Options.wallet_hotkey,
network: Optional[str] = Options.network,
chain: Optional[str] = Options.chain,
wallet_name: Optional[str] = typer.Option(
None,
"--wallet-name",
"--name",
"--wallet_name",
help="Wallet name",
),
wallet_path: Optional[str] = typer.Option(
None,
"--wallet-path",
"--path",
"-p",
"--wallet_path",
help="Path to root of wallets",
),
wallet_hotkey: Optional[str] = typer.Option(
None,
"--wallet-hotkey",
"--hotkey",
"-k",
"--wallet_hotkey",
help="name of the wallet hotkey file",
),
network: Optional[str] = typer.Option(
None,
"--network",
"-n",
"--subtensor.network",
help="Network name: [finney, test, local]",
),
chain: Optional[str] = typer.Option(
None,
"--chain",
"-c",
"--subtensor.chain_endpoint",
help="chain endpoint for the network (e.g. ws://127.0.0.1:9945, "
"wss://entrypoint-finney.opentensor.ai:443)",
),
no_cache: Optional[bool] = typer.Option(
False,
"--no-cache",
Expand Down Expand Up @@ -2120,8 +2143,13 @@ def root_set_weights(
wallet_name: str = Options.wallet_name,
wallet_path: str = Options.wallet_path,
wallet_hotkey: str = Options.wallet_hotkey,
netuids: list[int] = Options.netuids,
weights: list[float] = Options.weights,
netuids: list[int] = typer.Option(
None, help="Netuids, e.g. `-n 0 -n 1 -n 2` ..."
),
weights: list[float] = typer.Argument(
None,
help="Weights: e.g. `0.02 0.03 0.01` ...",
),
prompt: bool = Options.prompt,
quiet: bool = Options.quiet,
verbose: bool = Options.verbose,
Expand All @@ -2147,7 +2175,6 @@ def root_set_weights(
"""
self.verbosity_handler(quiet, verbose)
netuids = list_prompt(netuids, int, "Enter netuids")
weights = list_prompt(weights, float, "Enter weights")
wallet = self.wallet_ask(
wallet_name,
wallet_path,
Expand Down Expand Up @@ -2257,13 +2284,7 @@ def root_boost(
[green]$[/green] btcli root boost --netuid 1 --increase 0.01
"""
self.verbosity_handler(quiet, verbose)
wallet = self.wallet_ask(
wallet_name,
wallet_path,
wallet_hotkey,
ask_for=[WO.NAME, WO.HOTKEY],
validate=WV.WALLET_AND_HOTKEY,
)
wallet = self.wallet_ask(wallet_name, wallet_path, wallet_hotkey)
return self._run_command(
root.set_boost(
wallet, self.initialize_chain(network, chain), netuid, amount, prompt
Expand Down Expand Up @@ -4163,7 +4184,12 @@ def weights_reveal(
"-u",
help="Corresponding UIDs for the specified netuid, e.g. -u 1 -u 2 -u 3 ...",
),
weights: list[float] = Options.weights,
weights: list[float] = typer.Option(
[],
"--weights",
"-w",
help="Corresponding weights for the specified UIDs, e.g. `-w 0.2 -w 0.4 -w 0.1 ...",
),
salt: list[int] = typer.Option(
[],
"--salt",
Expand Down Expand Up @@ -4233,7 +4259,12 @@ def weights_commit(
"-u",
help="Corresponding UIDs for the specified netuid, e.g. -u 1 -u 2 -u 3 ...",
),
weights: list[float] = Options.weights,
weights: list[float] = typer.Option(
[],
"--weights",
"-w",
help="Corresponding weights for the specified UIDs, e.g. `-w 0.2 -w 0.4 -w 0.1 ...",
),
salt: list[int] = typer.Option(
[],
"--salt",
Expand Down

0 comments on commit 171f38c

Please sign in to comment.