Skip to content

Commit a2c541c

Browse files
authored
Merge pull request #39 from JudgmentLabs/remove_telemetry
Remove telemetry
2 parents b0e8dcf + ef4934e commit a2c541c

File tree

3 files changed

+43
-170
lines changed

3 files changed

+43
-170
lines changed

judgeval/common/telemetry.py

Lines changed: 0 additions & 123 deletions
This file was deleted.

judgeval/playground.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from judgeval.judges.utils import create_judge
1616
from judgeval.scorers.custom_scorer import CustomScorer
1717
from judgeval.scorers.score import *
18-
from judgeval.common.telemetry import capture_metric_type
1918

2019
"""
2120
Testing implementation of CustomFaithfulness
@@ -195,22 +194,21 @@ def metric_progress_indicator(
195194
total: int = 9999,
196195
transient: bool = True,
197196
):
198-
with capture_metric_type(metric.__name__):
199-
console = Console(file=sys.stderr) # Direct output to standard error
200-
if _show_indicator:
201-
with Progress(
202-
SpinnerColumn(style="rgb(106,0,255)"),
203-
TextColumn("[progress.description]{task.description}"),
204-
console=console, # Use the custom console
205-
transient=transient,
206-
) as progress:
207-
progress.add_task(
208-
description=scorer_console_msg(metric, async_mode),
209-
total=total,
210-
)
211-
yield
212-
else:
197+
console = Console(file=sys.stderr) # Direct output to standard error
198+
if _show_indicator:
199+
with Progress(
200+
SpinnerColumn(style="rgb(106,0,255)"),
201+
TextColumn("[progress.description]{task.description}"),
202+
console=console, # Use the custom console
203+
transient=transient,
204+
) as progress:
205+
progress.add_task(
206+
description=scorer_console_msg(metric, async_mode),
207+
total=total,
208+
)
213209
yield
210+
else:
211+
yield
214212

215213

216214
def prettify_list(lst: List[Any]):

judgeval/scorers/score.py

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
)
1919
from judgeval.scorers import CustomScorer
2020
from judgeval.scorers.utils import clone_scorers, scorer_console_msg
21-
from judgeval.common.telemetry import capture_evaluation_run
2221
from judgeval.common.exceptions import MissingTestCaseParamsError
2322
from judgeval.common.logger import example_logging_context, debug, error, warning, info
2423
from judgeval.judges import judgevalJudge
@@ -312,36 +311,10 @@ async def execute_with_semaphore(func: Callable, *args, **kwargs):
312311
debug(f"Scorer threshold: {scorer.threshold}")
313312
if hasattr(scorer, 'model'):
314313
debug(f"Scorer model: {type(scorer.model).__name__}")
315-
with capture_evaluation_run("Example"):
316-
if isinstance(ex, Example):
317-
if len(scorers) == 0:
318-
pbar.update(1)
319-
continue
320-
321-
cloned_scorers: List[CustomScorer] = clone_scorers(
322-
scorers
323-
)
324-
task = execute_with_semaphore(
325-
func=a_eval_examples_helper,
326-
scorers=cloned_scorers,
327-
example=ex,
328-
scoring_results=scoring_results,
329-
score_index=i,
330-
ignore_errors=ignore_errors,
331-
skip_on_missing_params=skip_on_missing_params,
332-
show_indicator=show_indicator,
333-
_use_bar_indicator=_use_bar_indicator,
334-
pbar=pbar,
335-
)
336-
tasks.append(asyncio.create_task(task))
337-
338-
await asyncio.sleep(throttle_value)
339-
await asyncio.gather(*tasks)
340-
else:
341-
for i, ex in enumerate(examples):
342-
with capture_evaluation_run("Example"):
314+
343315
if isinstance(ex, Example):
344316
if len(scorers) == 0:
317+
pbar.update(1)
345318
continue
346319

347320
cloned_scorers: List[CustomScorer] = clone_scorers(
@@ -355,12 +328,37 @@ async def execute_with_semaphore(func: Callable, *args, **kwargs):
355328
score_index=i,
356329
ignore_errors=ignore_errors,
357330
skip_on_missing_params=skip_on_missing_params,
358-
_use_bar_indicator=_use_bar_indicator,
359331
show_indicator=show_indicator,
332+
_use_bar_indicator=_use_bar_indicator,
333+
pbar=pbar,
360334
)
361-
tasks.append(asyncio.create_task((task)))
335+
tasks.append(asyncio.create_task(task))
362336

363337
await asyncio.sleep(throttle_value)
338+
await asyncio.gather(*tasks)
339+
else:
340+
for i, ex in enumerate(examples):
341+
if isinstance(ex, Example):
342+
if len(scorers) == 0:
343+
continue
344+
345+
cloned_scorers: List[CustomScorer] = clone_scorers(
346+
scorers
347+
)
348+
task = execute_with_semaphore(
349+
func=a_eval_examples_helper,
350+
scorers=cloned_scorers,
351+
example=ex,
352+
scoring_results=scoring_results,
353+
score_index=i,
354+
ignore_errors=ignore_errors,
355+
skip_on_missing_params=skip_on_missing_params,
356+
_use_bar_indicator=_use_bar_indicator,
357+
show_indicator=show_indicator,
358+
)
359+
tasks.append(asyncio.create_task((task)))
360+
361+
await asyncio.sleep(throttle_value)
364362
await asyncio.gather(*tasks)
365363
return scoring_results
366364

0 commit comments

Comments
 (0)