From 0deebd81ecead7986673242992879b2ab125ac3b Mon Sep 17 00:00:00 2001 From: Sid Date: Tue, 19 Nov 2024 08:17:42 -0800 Subject: [PATCH 1/3] Create a new subtensor for each set weights attempt. --- neurons/validator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neurons/validator.py b/neurons/validator.py index ca37a78..bba3884 100644 --- a/neurons/validator.py +++ b/neurons/validator.py @@ -710,7 +710,8 @@ async def _try_set_weights(): with self.metagraph_lock: uids = self.metagraph.uids try: - success, message = self.subtensor.set_weights( + weight_subtensor = bt.subtensor(config=self.config) + success, message = weight_subtensor.set_weights( netuid=self.config.netuid, wallet=self.wallet, uids=uids, @@ -1502,6 +1503,6 @@ async def run(self): width = os.get_terminal_size().columns except: width = 0 - os.environ['COLUMNS'] = str(max(200,width)) + os.environ["COLUMNS"] = str(max(200, width)) asyncio.run(Validator().run()) From 581e30b27bf9f20d378e2d8194c19c433ec1f4b1 Mon Sep 17 00:00:00 2001 From: Sid Date: Wed, 20 Nov 2024 19:09:13 -0800 Subject: [PATCH 2/3] Adjust rule generation accounting for 200 token limit. --- finetune/eval/if_eval/rule_factory.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/finetune/eval/if_eval/rule_factory.py b/finetune/eval/if_eval/rule_factory.py index 794c0be..5c7cccf 100644 --- a/finetune/eval/if_eval/rule_factory.py +++ b/finetune/eval/if_eval/rule_factory.py @@ -80,13 +80,13 @@ def generate_rule( """Generates a rule based on the provided rule_id and existing rules.""" match rule_id: case RuleId.WORD_COUNT_AT_MOST: - return WordCountAtMostRule(random.choice([x for x in range(50, 150, 5)])) + return WordCountAtMostRule(random.choice([x for x in range(25, 50, 5)])) case RuleId.WORD_COUNT_AT_LEAST: - return WordCountAtLeastRule(random.choice([x for x in range(25, 250, 10)])) + return WordCountAtLeastRule(random.choice([x for x in range(25, 50, 5)])) case RuleId.SENTENCE_COUNT_AT_MOST: - return SentenceCountAtMostRule(random.choice([x for x in range(1, 5)])) + return SentenceCountAtMostRule(random.choice([x for x in range(1, 4)])) case RuleId.SENTENCE_COUNT_AT_LEAST: - return SentenceCountAtLeastRule(random.choice([x for x in range(2, 5)])) + return SentenceCountAtLeastRule(random.choice([x for x in range(2, 4)])) case RuleId.ALL_UPPER_CASE: return UppercaseRule() case RuleId.ALL_LOWER_CASE: From 1c5fe09af4fb625aafc1d494e1492f60ed0a468a Mon Sep 17 00:00:00 2001 From: Sid Date: Wed, 20 Nov 2024 19:17:21 -0800 Subject: [PATCH 3/3] Bump version to 2.5.1. --- constants/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/constants/__init__.py b/constants/__init__.py index 23d54c0..9da1130 100644 --- a/constants/__init__.py +++ b/constants/__init__.py @@ -30,7 +30,7 @@ # Project Constants. # --------------------------------- -__version__ = "2.5.0" +__version__ = "2.5.1" version_split = __version__.split(".") __spec_version__ = ( (1000 * int(version_split[0]))