Skip to content

Commit 987d234

Browse files
authored
Merge pull request #152 from web-genie-ai/feat/validator-issue
chore: fix get_winner logic
2 parents 6a63817 + fa31217 commit 987d234

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

neurons/validators/score_manager.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,11 @@ def get_winner(self, total_scores: np.ndarray, solved_tasks: np.ndarray, number_
171171
avg_scores = np.zeros(self.neuron.metagraph.n, dtype=np.float32)
172172
for uid in range(self.neuron.metagraph.n):
173173
if self.is_blacklisted(uid):
174-
continue
175-
176-
avg_scores[uid] = total_scores[uid] / number_of_tasks
177-
178-
# if solved_tasks[uid] >= max(1, number_of_tasks - MAX_UNANSWERED_TASKS):
179-
# avg_scores[uid] = total_scores[uid] / solved_tasks[uid]
180-
# else:
181-
# avg_scores[uid] = 0
174+
continue
175+
if solved_tasks[uid] >= max(1, number_of_tasks - MAX_UNANSWERED_TASKS):
176+
avg_scores[uid] = total_scores[uid] / solved_tasks[uid]
177+
else:
178+
avg_scores[uid] = 0
182179
winner = np.argmax(avg_scores) if max(avg_scores) > 0 else -1
183180
return winner
184181

webgenie/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import psutil
44
# Change this value when updating your code base.
55
# Define the version of the webgenie.
6-
__VERSION__ = "1.3.2" # version
6+
__VERSION__ = "1.3.3" # version
77

88
SPEC_VERSION = (
99
(1000 * int(__VERSION__.split(".")[0]))
@@ -89,7 +89,7 @@
8989

9090
MAX_NUMBER_OF_TASKS_PER_SESSION = 18 # max number of tasks per session
9191

92-
MAX_UNANSWERED_TASKS = 3 # max unanswered tasks
92+
MAX_UNANSWERED_TASKS = 4 # max unanswered tasks
9393

9494
NUMBER_OF_CONCURRENT_WORKERS = max(
9595
1,

0 commit comments

Comments
 (0)