@@ -308,6 +308,7 @@ def handle_exit_signal(signum, frame):
308308 def _process_datapoint (dp : Datapoint ):
309309 def upload_callback (log_id : str ):
310310 """Logic ran after the Log has been created."""
311+ # Need to get the full log to pass to the evaluators
311312 evaluators_worker_pool .submit (
312313 _run_local_evaluators ,
313314 client = client ,
@@ -901,11 +902,6 @@ def _run_local_evaluators(
901902 progress_bar : _SimpleProgressBar ,
902903):
903904 """Run local Evaluators on the Log and send the judgments to Humanloop."""
904- # If there are no local evaluators, we don't need to do the log lookup.
905- if len (local_evaluators ) == 0 :
906- progress_bar .increment ()
907- return
908-
909905 try :
910906 # Need to get the full log to pass to the evaluators
911907 log = client .logs .get (id = log_id )
@@ -915,12 +911,15 @@ def _run_local_evaluators(
915911 log_dict = log
916912
917913 # Wait for the Flow trace to complete before running evaluators
918- while file_type == "flow" and log_dict ["trace_status" ] != "complete" :
914+ while True :
915+ if file_type != "flow" or log_dict ["trace_status" ] == "complete" :
916+ break
919917 log = client .logs .get (id = log_id )
920918 if not isinstance (log , dict ):
921919 log_dict = log .dict ()
922920 else :
923921 log_dict = log
922+ time .sleep (2 )
924923 datapoint_dict = datapoint .dict () if datapoint else None
925924
926925 for local_evaluator_tuple in local_evaluators :
0 commit comments