Skip to content

Commit 3335c35

Browse files
author
Andrei Bratu
committed
PR feedback
1 parent 9ad1a6f commit 3335c35

File tree

5 files changed

+230
-275
lines changed

5 files changed

+230
-275
lines changed

poetry.lock

Lines changed: 13 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Repository = 'https://github.com/humanloop/humanloop-python'
3535

3636
[tool.poetry.dependencies]
3737
python = ">=3.9,<4"
38-
deepdiff = "^6.7.1"
38+
deepdiff = "^8.2.0"
3939
httpx = ">=0.21.2"
4040
httpx-sse = "0.4.0"
4141
mmh3 = "^5.1.0"

src/humanloop/eval_utils/run.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import time
2020
import types
2121
import typing
22-
from concurrent.futures import ThreadPoolExecutor, as_completed
22+
from concurrent.futures import ThreadPoolExecutor
2323
from datetime import datetime
2424
from functools import partial
2525
from 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\nWaiting 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

Comments
 (0)