From b14bac96ccf3ab77a4011fe3ec105559c8f522ec Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Fri, 1 Sep 2023 14:07:15 -0400 Subject: [PATCH] fix overview pickling --- bittensor/commands/overview.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bittensor/commands/overview.py b/bittensor/commands/overview.py index 1cd2d62765..c0969168ff 100644 --- a/bittensor/commands/overview.py +++ b/bittensor/commands/overview.py @@ -116,12 +116,18 @@ def run(cli: 'bittensor.cli'): } all_hotkey_addresses = list(hotkey_addr_to_wallet.keys()) + # Create a copy of the config without the parser and formatter_class. + ## This is needed to pass to the ProcessPoolExecutor, which cannot pickle the parser. + copy_config = cli.config.copy() + copy_config['__parser'] = None + copy_config['formatter_class'] = None + # Pull neuron info for all keys. ## Max len(netuids) or 5 threads. with ProcessPoolExecutor(max_workers=max(len(netuids), 5)) as executor: results = executor.map( OverviewCommand._get_neurons_for_netuid, - [(cli.config, netuid, all_hotkey_addresses) for netuid in netuids], + [(copy_config, netuid, all_hotkey_addresses) for netuid in netuids], ) executor.shutdown(wait=True) # wait for all complete