Skip to content

Commit

Permalink
Merge pull request #911 from parea-ai/fix-datset-level-eval-fail-exp
Browse files Browse the repository at this point in the history
Fix datset level eval fail exp
  • Loading branch information
joschkabraun committed May 29, 2024
2 parents 4c401ec + 3ef393a commit a790e1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion parea/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import asyncio
import inspect
import logging
import os
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
Expand All @@ -23,6 +24,7 @@
from parea.utils.universal_encoder import json_dumps

STAT_ATTRS = ["latency", "input_tokens", "output_tokens", "total_tokens", "cost"]
logger = logging.getLogger()


def calculate_avg_std_for_experiment(experiment_stats: ExperimentStatsSchema) -> Dict[str, str]:
Expand Down Expand Up @@ -63,7 +65,12 @@ def apply_dataset_eval(dataset_level_evals: List[Callable]) -> List[EvaluationRe

results = []
for dataset_level_eval in dataset_level_evals:
result = dataset_level_eval(root_traces)
try:
result = dataset_level_eval(root_traces)
except Exception as e:
logger.exception(f"Error occurred calling dataset level eval function '{dataset_level_eval.__name__}': {e}", exc_info=e)
continue

if isinstance(result, EvaluationResult):
results.append(result)
elif isinstance(result, list):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "parea-ai"
packages = [{ include = "parea" }]
version = "0.2.161"
version = "0.2.162"
description = "Parea python sdk"
readme = "README.md"
authors = ["joel-parea-ai <[email protected]>"]
Expand Down

0 comments on commit a790e1b

Please sign in to comment.