Skip to content

Commit

Permalink
helpful warning for trivial statemetn removal failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Reini committed Oct 7, 2024
1 parent db8a685 commit 7eeff85
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/feedback/trulens/feedback/llm_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,9 @@ def _remove_trivial_statements(self, statements: List[str]) -> List[str]:
if isinstance(result, list):
return result
except Exception:
warnings.warn(
"Failed to process and remove trivial statements. Proceeding with all statements."
)
pass

return statements
Expand Down Expand Up @@ -1589,12 +1592,8 @@ def groundedness_measure_with_cot_reasons(
messages=llm_messages,
temperature=temperature,
).split("\n")
try:
hypotheses = self._remove_trivial_statements(hypotheses)
except Exception as e:
logger.error(
f"Error removing trivial statements: {e}. Proceeding with all statements."
)

hypotheses = self._remove_trivial_statements(hypotheses)

output_space = self._determine_output_space(
min_score_val, max_score_val
Expand Down

0 comments on commit 7eeff85

Please sign in to comment.