1919import time
2020import types
2121import typing
22- from concurrent .futures import ThreadPoolExecutor , as_completed
22+ from concurrent .futures import ThreadPoolExecutor
2323from datetime import datetime
2424from functools import partial
2525from logging import INFO
@@ -367,15 +367,8 @@ def upload_callback(log_id: str):
367367 )
368368
369369 with ThreadPoolExecutor (max_workers = workers ) as executor :
370- futures = []
371370 for datapoint in hl_dataset .datapoints :
372- futures .append (executor .submit (_process_datapoint , datapoint ))
373- # Program hangs if any uncaught exceptions are not handled here
374- for future in as_completed (futures ):
375- try :
376- future .result ()
377- except Exception :
378- pass
371+ executor .submit (_process_datapoint , datapoint )
379372
380373 stats = _wait_for_evaluation_to_complete (
381374 client = client ,
@@ -413,7 +406,6 @@ def __init__(self, total: int):
413406 def increment (self ):
414407 """Increment the progress bar by one finished task."""
415408 with self ._lock :
416- # NOTE: There is a deadlock here that needs further investigation
417409 if self ._progress == self ._total :
418410 return
419411 self ._progress += 1
@@ -461,7 +453,7 @@ def _wait_for_evaluation_to_complete(
461453 # Wait for the Evaluation to complete then print the results
462454 complete = False
463455
464- wrote_explainer = False
456+ waiting_for_local_evals_message_printed = False
465457
466458 while not complete :
467459 stats = client .evaluations .get_stats (id = evaluation .id )
@@ -471,9 +463,9 @@ def _wait_for_evaluation_to_complete(
471463 )
472464 complete = run_stats is not None and run_stats .status == "completed"
473465 if not complete :
474- if not wrote_explainer :
466+ if not waiting_for_local_evals_message_printed :
475467 sys .stderr .write ("\n \n Waiting for Evaluators on Humanloop runtime...\n " )
476- wrote_explainer = True
468+ waiting_for_local_evals_message_printed = True
477469 sys .stderr .write (stats .progress )
478470 # Move the cursor up in stderr a number of lines equal to the number of lines in stats.progress
479471 sys .stderr .write ("\033 [A" * (stats .progress .count ("\n " )))
0 commit comments