@@ -73,16 +73,16 @@ async def run_step(self) -> RewardLoggingEvent:
7373 await asyncio .sleep (0.1 )
7474 # Only score responses for which the model is loaded
7575 await self .model_scheduler .llm_model_manager .lock .acquire ()
76- # with self.mp_lock:
77- scorable = [
78- scoring_config
79- for scoring_config in self .scoring_queue
80- if (scoring_config .task .llm_model in self .model_scheduler .llm_model_manager .active_models .keys ())
81- or (scoring_config .task .llm_model is None )
82- ]
83- if len (scorable ) == 0 :
84- return
85- self .scoring_queue .remove (scorable [0 ])
76+ with self .mp_lock :
77+ scorable = [
78+ scoring_config
79+ for scoring_config in self .scoring_queue
80+ if (scoring_config .task .llm_model in self .model_scheduler .llm_model_manager .active_models .keys ())
81+ or (scoring_config .task .llm_model is None )
82+ ]
83+ if len (scorable ) == 0 :
84+ return
85+ self .scoring_queue .remove (scorable [0 ])
8686 scoring_config : ScoringConfig = scorable .pop (0 )
8787
8888 # here we generate the actual reference
@@ -106,15 +106,13 @@ async def run_step(self) -> RewardLoggingEvent:
106106 model_manager = self .model_scheduler .llm_model_manager ,
107107 task_queue = self .task_queue ,
108108 )
109-
110- # with self.mp_lock:
111109 self .reward_events .append (reward_events )
112110
113111 # TODO: Remove this once we have a better way to handle organic tasks
114- # if scoring_config.task.organic:
115- # self.reward_events.append(
116- # reward_events
117- # ) # Add the organic a second time, doubling the weight of the organic
112+ if scoring_config .task .organic :
113+ self .reward_events .append (
114+ reward_events
115+ ) # Add the organic a second time, doubling the weight of the organic
118116 logger .debug (
119117 f"Scored { scoring_config .task .__class__ .__name__ } { scoring_config .task .task_id } with model "
120118 f"{ scoring_config .task .llm_model_id } "
0 commit comments