Skip to content

LLMBasedFaithfulness fails when response cannot be split into score and reasoning #71

@kelvinchanwh

Description

@kelvinchanwh

In continuous_eval/metrics/generation/text/llm_based.py line 72-77, the response is split into a score and reasoning. If the split fails, the score in line 76 should check if "yes" is in response.lower() rather than score_txt.lower() since score_txt has not been defined yet.

AS-IS:

try:
    score_txt, reasoning = response.split("\n", 1)
    score = float("yes" in score_txt.lower())
except ValueError:
    score = float("yes" in score_txt.lower())
    reasoning = response

TO-BE:

  try:
      score_txt, reasoning = response.split("\n", 1)
      score = float("yes" in score_txt.lower())
  except ValueError:
      score = float("yes" in response.lower())
      reasoning = response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions