Skip to content

Remove telemetry #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 0 additions & 123 deletions judgeval/common/telemetry.py

This file was deleted.

30 changes: 14 additions & 16 deletions judgeval/playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from judgeval.judges.utils import create_judge
from judgeval.scorers.custom_scorer import CustomScorer
from judgeval.scorers.score import *
from judgeval.common.telemetry import capture_metric_type

"""
Testing implementation of CustomFaithfulness
Expand Down Expand Up @@ -195,22 +194,21 @@ def metric_progress_indicator(
total: int = 9999,
transient: bool = True,
):
with capture_metric_type(metric.__name__):
console = Console(file=sys.stderr) # Direct output to standard error
if _show_indicator:
with Progress(
SpinnerColumn(style="rgb(106,0,255)"),
TextColumn("[progress.description]{task.description}"),
console=console, # Use the custom console
transient=transient,
) as progress:
progress.add_task(
description=scorer_console_msg(metric, async_mode),
total=total,
)
yield
else:
console = Console(file=sys.stderr) # Direct output to standard error
if _show_indicator:
with Progress(
SpinnerColumn(style="rgb(106,0,255)"),
TextColumn("[progress.description]{task.description}"),
console=console, # Use the custom console
transient=transient,
) as progress:
progress.add_task(
description=scorer_console_msg(metric, async_mode),
total=total,
)
yield
else:
yield


def prettify_list(lst: List[Any]):
Expand Down
60 changes: 29 additions & 31 deletions judgeval/scorers/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
)
from judgeval.scorers import CustomScorer
from judgeval.scorers.utils import clone_scorers, scorer_console_msg
from judgeval.common.telemetry import capture_evaluation_run
from judgeval.common.exceptions import MissingTestCaseParamsError
from judgeval.common.logger import example_logging_context, debug, error, warning, info
from judgeval.judges import judgevalJudge
Expand Down Expand Up @@ -312,36 +311,10 @@ async def execute_with_semaphore(func: Callable, *args, **kwargs):
debug(f"Scorer threshold: {scorer.threshold}")
if hasattr(scorer, 'model'):
debug(f"Scorer model: {type(scorer.model).__name__}")
with capture_evaluation_run("Example"):
if isinstance(ex, Example):
if len(scorers) == 0:
pbar.update(1)
continue

cloned_scorers: List[CustomScorer] = clone_scorers(
scorers
)
task = execute_with_semaphore(
func=a_eval_examples_helper,
scorers=cloned_scorers,
example=ex,
scoring_results=scoring_results,
score_index=i,
ignore_errors=ignore_errors,
skip_on_missing_params=skip_on_missing_params,
show_indicator=show_indicator,
_use_bar_indicator=_use_bar_indicator,
pbar=pbar,
)
tasks.append(asyncio.create_task(task))

await asyncio.sleep(throttle_value)
await asyncio.gather(*tasks)
else:
for i, ex in enumerate(examples):
with capture_evaluation_run("Example"):

if isinstance(ex, Example):
if len(scorers) == 0:
pbar.update(1)
continue

cloned_scorers: List[CustomScorer] = clone_scorers(
Expand All @@ -355,12 +328,37 @@ async def execute_with_semaphore(func: Callable, *args, **kwargs):
score_index=i,
ignore_errors=ignore_errors,
skip_on_missing_params=skip_on_missing_params,
_use_bar_indicator=_use_bar_indicator,
show_indicator=show_indicator,
_use_bar_indicator=_use_bar_indicator,
pbar=pbar,
)
tasks.append(asyncio.create_task((task)))
tasks.append(asyncio.create_task(task))

await asyncio.sleep(throttle_value)
await asyncio.gather(*tasks)
else:
for i, ex in enumerate(examples):
if isinstance(ex, Example):
if len(scorers) == 0:
continue

cloned_scorers: List[CustomScorer] = clone_scorers(
scorers
)
task = execute_with_semaphore(
func=a_eval_examples_helper,
scorers=cloned_scorers,
example=ex,
scoring_results=scoring_results,
score_index=i,
ignore_errors=ignore_errors,
skip_on_missing_params=skip_on_missing_params,
_use_bar_indicator=_use_bar_indicator,
show_indicator=show_indicator,
)
tasks.append(asyncio.create_task((task)))

await asyncio.sleep(throttle_value)
await asyncio.gather(*tasks)
return scoring_results

Expand Down
Loading