Skip to content

Commit

Permalink
Merge pull request #88 from Datura-ai/Update-Bittensor
Browse files Browse the repository at this point in the history
Update bittensor
  • Loading branch information
surcyf123 authored Oct 2, 2024
2 parents 0f7b600 + 838a788 commit 34f0160
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cortext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down
2 changes: 2 additions & 0 deletions validators/task_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions validators/weight_setter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 34f0160

Please sign in to comment.