18
18
)
19
19
from judgeval .scorers import CustomScorer
20
20
from judgeval .scorers .utils import clone_scorers , scorer_console_msg
21
- from judgeval .common .telemetry import capture_evaluation_run
22
21
from judgeval .common .exceptions import MissingTestCaseParamsError
23
22
from judgeval .common .logger import example_logging_context , debug , error , warning , info
24
23
from judgeval .judges import judgevalJudge
@@ -312,36 +311,10 @@ async def execute_with_semaphore(func: Callable, *args, **kwargs):
312
311
debug (f"Scorer threshold: { scorer .threshold } " )
313
312
if hasattr (scorer , 'model' ):
314
313
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
+
343
315
if isinstance (ex , Example ):
344
316
if len (scorers ) == 0 :
317
+ pbar .update (1 )
345
318
continue
346
319
347
320
cloned_scorers : List [CustomScorer ] = clone_scorers (
@@ -355,12 +328,37 @@ async def execute_with_semaphore(func: Callable, *args, **kwargs):
355
328
score_index = i ,
356
329
ignore_errors = ignore_errors ,
357
330
skip_on_missing_params = skip_on_missing_params ,
358
- _use_bar_indicator = _use_bar_indicator ,
359
331
show_indicator = show_indicator ,
332
+ _use_bar_indicator = _use_bar_indicator ,
333
+ pbar = pbar ,
360
334
)
361
- tasks .append (asyncio .create_task (( task ) ))
335
+ tasks .append (asyncio .create_task (task ))
362
336
363
337
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 )
364
362
await asyncio .gather (* tasks )
365
363
return scoring_results
366
364
0 commit comments