diff --git a/cortext/__init__.py b/cortext/__init__.py index b7d0751e..ea9f6eb8 100644 --- a/cortext/__init__.py +++ b/cortext/__init__.py @@ -19,7 +19,7 @@ # version must stay on line 22 -__version__ = "4.0.12" +__version__ = "4.0.13" version_split = __version__.split(".") __spec_version__ = ( (1000 * int(version_split[0])) diff --git a/validators/task_manager.py b/validators/task_manager.py index d2a10e33..b2133068 100644 --- a/validators/task_manager.py +++ b/validators/task_manager.py @@ -64,6 +64,8 @@ def choose_miner(self, synapse: ALL_SYNAPSE_TYPE): available_uids = [] for uid in self.remain_resources: capacity = self.remain_resources.get(uid) + if capacity is None: + continue bandwidth = capacity.get(provider).get(model) if bandwidth is not None and bandwidth > 0: # decrease resource by one after choosing this miner for the request. diff --git a/validators/weight_setter.py b/validators/weight_setter.py index 6d26c510..aec4a4e8 100644 --- a/validators/weight_setter.py +++ b/validators/weight_setter.py @@ -233,7 +233,6 @@ async def perform_synthetic_queries(self): batched_tasks, remain_tasks = self.pop_synthetic_tasks_max_100_per_miner(synthetic_tasks) while batched_tasks: - start_time = time.time() await self.dendrite.aclose_session() await asyncio.gather(*batched_tasks) batched_tasks, remain_tasks = self.pop_synthetic_tasks_max_100_per_miner(remain_tasks) @@ -562,8 +561,9 @@ async def process_queries_from_database(self): async with self.lock: for uid_scores_dict, _, _ in resps: for uid, score in uid_scores_dict.items(): - self.total_scores[uid] += score - self.score_counts[uid] += 1 + if self.total_scores.get(uid) is not None: + self.total_scores[uid] += score + self.score_counts[uid] += 1 bt.logging.info(f"current total score are {self.total_scores}") await self.update_and_refresh()