Skip to content

Commit

Permalink
fix: weight setter
Browse files Browse the repository at this point in the history
  • Loading branch information
Chkhikvadze committed Feb 13, 2024
1 parent c01c0e6 commit 4b8ea1a
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions validators/weight_setter.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,15 @@ async def perform_synthetic_scoring_and_update_weights(self):
if len(self.available_uids) == 0:
await asyncio.sleep(10)
continue

available_uids = self.available_uids
selected_validator = self.select_validator(self.steps_passed)
scores, _ = await self.process_modality(selected_validator, available_uids)
self.total_scores += scores

self.steps_passed+=1
await asyncio.sleep(10)

for steps_passed in itertools.count():
available_uids = self.available_uids
selected_validator = self.select_validator(steps_passed)
scores, _ = await self.process_modality(selected_validator, available_uids)
self.total_scores += scores

# steps_since_last_update = steps_passed % iterations_per_set_weights

# if steps_since_last_update == iterations_per_set_weights - 1:
# await self.update_weights(steps_passed)
# else:
# bt.logging.info(
# f"Updating weights in {iterations_per_set_weights - steps_since_last_update - 1} iterations."
# )

await asyncio.sleep(10)

def select_validator(self, steps_passed):
return self.text_vali if steps_passed % 5 in (0, 1, 2, 3) else self.image_vali
Expand Down

0 comments on commit 4b8ea1a

Please sign in to comment.